8 static FT_HANDLE ftHandle[128];
10 static int status[128];
14 CTYPE
int DLL
SE_Open(
char sestilioId,
int usbDevice)
19 seId[usbDevice] = sestilioId;
20 ftStatus = FT_ListDevices(&numDevs, NULL, FT_LIST_NUMBER_ONLY);
21 if(ftStatus == FT_OK && numDevs > 0)
23 ftStatus = FT_Open(usbDevice, &ftHandle[usbDevice]);
27 FT_SetUSBParameters(ftHandle[usbDevice], 512, 512);
28 FT_Purge(ftHandle[usbDevice], FT_PURGE_RX);
29 FT_Purge(ftHandle[usbDevice], FT_PURGE_TX);
31 _buf =
new char[65536];
41 if(FT_Close(ftHandle[usbDevice]) == FT_OK)
43 if(__buf)
delete [] __buf;
55 return status[usbDevice];
58 CTYPE
const char DLL_P
SE_ReadData(
const char * command,
int rxed,
int usbDevice)
60 DWORD bw, timeout = 100;
63 sprintf(_buf,
" %c%s\r", seId[usbDevice], command);
66 FT_Write(ftHandle[usbDevice], _buf, strlen(_buf), &bw);
70 FT_GetQueueStatus(ftHandle[usbDevice], &bw);
72 }
while(bw < rxed && timeout > 0);
74 FT_Read(ftHandle[usbDevice], _buf, rxed, &bw);
85 FT_Purge(ftHandle[usbDevice], FT_PURGE_RX);
92 DWORD bw, timeout = 100;
94 sprintf(_buf,
" %c%s\r", seId[usbDevice], command);
95 FT_Write(ftHandle[usbDevice], _buf, strlen(_buf), &bw);
99 FT_GetQueueStatus(ftHandle[usbDevice], &bw);
101 }
while(bw < rxed && timeout > 0);
103 FT_Read(ftHandle[usbDevice], _buf, rxed, &bw);
110 FT_Purge(ftHandle[usbDevice], FT_PURGE_RX);
119 sprintf(_buf,
" %c%s\r", seId[usbDevice], command);
120 FT_Write(ftHandle[usbDevice], _buf, strlen(_buf), &bw);
121 FT_Read(ftHandle[usbDevice], outBuf, rxed, &bw);
127 return status[usbDevice];
130 CTYPE
int DLL
SE_WriteDataBinary(
const char * command,
const char * buffer,
unsigned length,
int usbDevice)
135 sprintf(_buf,
" %c%s\r", seId[usbDevice], command);
136 FT_Write(ftHandle[usbDevice], _buf, strlen(_buf), &bw);
137 FT_Read(ftHandle[usbDevice], _buf, 4, &bw);
138 if(bw == 4 && _buf[2] ==
'.')
140 status[usbDevice] = ret;
141 FT_Write(ftHandle[usbDevice], (
char *) buffer, length, &bw);
147 const char * ret =
SE_ReadData(command, rxed, usbDevice);
153 CTYPE
int DLL
SE_Command(
const char * command,
int usbDevice)
159 sprintf(buf,
" %c%s\r", seId[usbDevice], command);
160 FT_Write(ftHandle[usbDevice], buf, strlen(buf), &bw);
161 FT_Read(ftHandle[usbDevice], buf, 4, &bw);
162 if(bw == 4 && buf[2] ==
'.')
164 status[usbDevice] = ret;
165 FT_Purge(ftHandle[usbDevice], FT_PURGE_RX);
174 sprintf(buf,
" %c%s\r", seId[usbDevice], command);
175 FT_Write(ftHandle[usbDevice], buf, strlen(buf), &bw);
183 FT_GetQueueStatus(ftHandle[usbDevice], &bw);
186 FT_Read(ftHandle[usbDevice], buf, 4, &bw);
187 if(bw == 4 && buf[2] ==
'.')
190 status[usbDevice] = ret;
194 CTYPE
int DLL
SE_SetID(
char sestilioId,
int usbDevice)
197 sprintf(buf,
"I%c", sestilioId);
198 seId[usbDevice] = sestilioId;
206 if(chan > 7) { ad = 1; chan -= 8; }
208 sprintf(buf,
"c%d%d", ad, chan);
212 CTYPE
unsigned short int DLL
SE_ReadAnalog(
int source,
int average,
int usbDevice)
216 sprintf(buf,
"a%d%05d", source, average);
219 return (
unsigned short int) atol(ret);
226 sprintf(buf,
"d%d%04d", chan, value);
233 sprintf(buf,
"D%04d%04d", val0, val1);
237 CTYPE
int DLL
SE_FastWriteAnalog(
int source,
int trigger,
unsigned period,
int samples,
int usbDevice)
240 sprintf(buf,
"f%d%d%010d%05d", source, trigger, period, samples);
248 if(chan > 7) { ad = 1; chan -= 8; }
249 sprintf(buf,
"g%d%d", ad, gain);
253 CTYPE
int DLL
SE_FastReadAnalog(
int source,
int trigger,
unsigned period,
int samples,
int usbDevice)
256 sprintf(buf,
"S%d%d%010d%05d", source, trigger, period, samples);
260 CTYPE
int DLL
SE_FlowReadAnalog(
int source,
unsigned int num,
unsigned short int * outBuffer,
int usbDevice)
263 sprintf(buf,
"b%d%010d", source, num);
267 CTYPE
const char DLL_P
SE_ReadRAM(
int source,
int address,
int num,
int usbDevice)
270 sprintf(buf,
"R@%d%05u%05u", source, address, num);
274 CTYPE
int DLL
SE_WriteRAM(
int source,
int address,
int num,
const char * buffer,
int usbDevice)
277 sprintf(buf,
"r@%d%05u%05u", source, address, num);
281 CTYPE
int DLL
SE_PutSampleData(
int source,
int address,
int num,
unsigned short int * outBuffer,
int usbDevice)
283 return SE_WriteRAM(source, address, num << 1, (
const char *) outBuffer, usbDevice);
286 CTYPE
int DLL
SE_GetSampleData(
int source,
int address,
int num,
unsigned short int * outBuffer,
int usbDevice)
288 memcpy((
void *) outBuffer, (
void *)
SE_ReadRAM(source, address, num << 1, usbDevice), num << 1);
289 return status[usbDevice];
295 unsigned short int * ptr = (
unsigned short int *) _buf;
296 SE_ReadRAM(source, address, num << 1, usbDevice);
298 for(i = 0; i < num; i++)
299 outBuffer[i] = (
double) ptr[i];
300 return status[usbDevice];
306 unsigned short int * ptr = (
unsigned short int *) _buf;
307 SE_ReadRAM(source, address, num << 2, usbDevice);
309 for(i = 0; i < num; i++)
311 outBuffer0[i] = (double) ptr[i * 2];
312 outBuffer1[i] = (double) ptr[i * 2 + 1];
314 return status[usbDevice];
340 sprintf(buf,
"p%02d%03d", regAdd, regValue);
347 sprintf(buf,
"P%02d", regAdd);
351 CTYPE
int DLL
SE_SetPortDirection(
int port,
int bit7,
int bit6,
int bit5,
int bit4,
int bit3,
int bit2,
int bit1,
int bit0,
int usbDevice)
362 sprintf(buf,
"=%d%03d", port, dir);
366 CTYPE
int DLL
SE_WritePort(
int portAddress,
int portValue,
int usbDevice)
369 sprintf(buf,
">%d%03d", portAddress, portValue);
376 int bitmask[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }, ps;
380 sprintf(buf,
">%d%03d", portAddress, ps);
387 int bitmask[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }, ps;
390 ps &= (~bitmask[bit]);
391 sprintf(buf,
">%d%03d", portAddress, ps & 0xFF);
398 sprintf(buf,
"<%d", portAddress);
402 CTYPE
int DLL
SE_PortPulse(
int port,
int initialValue,
int finalValue,
int pulseWidth,
int timeBase,
int usbDevice)
405 sprintf(buf,
";%d%03d%03d%05d%01d", port, initialValue, finalValue, pulseWidth, timeBase);
411 int bitmask[8] = { 1, 2, 4, 8, 16, 32, 64, 128 };
414 return bitmask[bit] & s;
423 sprintf(buf,
"E@%06u%06u", address, num);
427 __buf =
new char[131072];
428 for(i = 0; i < num; i += 256)
430 sprintf(buf,
"E@%06u%06u", address + i, 256);
435 sprintf(buf,
"E@%06u%06u", address + i, i % 256);
441 CTYPE
int DLL
SE_WriteEEPROM(
int address,
int num,
const char * buffer,
int usbDevice)
447 sprintf(buf,
"e@%06u%05u", address, num);
450 for(i = 0; i < num; i += 256)
452 sprintf(buf,
"e@%06u%05u", address + i, 256);
457 sprintf(buf,
"e@%06u%05u", address + i, i % 256);
466 sprintf(buf,
"w%d%d%03d%03d", bitSelect, enable, lowWidth, highWidth);
473 sprintf(buf,
"^%d", pwrCtrl);
477 CTYPE
int DLL
SE_WriteSPI(
int address,
int slaveAddress,
int num,
const char * buffer,
int usbDevice)
480 sprintf(buf,
"u@%d%d%05u", slaveAddress, address, num);
484 CTYPE
const char DLL_P
SE_ReadSPI(
int address,
int slaveAddress,
int num,
int usbDevice)
487 sprintf(buf,
"U@%d%d%05u", slaveAddress, address, num);
491 CTYPE
const char DLL_P
SE_ReadWriteSPI(
int address,
int slaveAddress,
int num,
const char * buffer,
int usbDevice)
495 sprintf(buf,
"~@%d%d%03u", slaveAddress, address, num);
497 FT_Read(ftHandle[usbDevice], _buf, num, &bw);
503 FT_Purge(ftHandle[usbDevice], FT_PURGE_RX);
508 CTYPE
int DLL
SE_CheckSPI(
int address,
int slaveAddress,
int usbDevice)
512 sprintf(buf,
"k@%d%d", slaveAddress, address);
521 sprintf(buf,
"V%d%d", speed, mode);
528 sprintf(buf,
"n%d%04d%010d%04d", da, daValue, period, samples);
532 CTYPE
int DLL
SE_SetPID(
int pidID,
int controlOutput,
int adChannels,
int measureUnit,
int targetValue,
int controlMaxValue,
int behavior,
int usbDevice)
540 case SE_PID_UNIT_MF: targetValue = (targetValue - 32000) / 1800 + 273150;
544 sprintf(buf,
"i%d%d%05d%d%06u%05u%d", pidID, controlOutput, adChannels, measureUnit, targetValue, controlMaxValue, behavior);
548 CTYPE
int DLL
SE_SetPIDconstants(
int pidID,
int constantId,
int constantBase,
int constantDivider,
int usbDevice)
551 sprintf(buf,
"K%d%d%06u%06u", pidID, constantId, constantBase, constantDivider);
558 sprintf(buf,
"s%05u", timeBaseMultiplier);
562 CTYPE
unsigned short int DLL
SE_PIDdata(
int pidId,
int usbDevice)
566 sprintf(buf,
"j%d", pidId);
569 return (
unsigned short int) atol(ret);
576 sprintf(buf,
"}%d%d%05d%05d",
id, dir, steps, delay);
583 sprintf(buf,
"{%d%d%05d%05d%d",
id, dir, steps, delay, fcLevel);
590 sprintf(buf,
"x%d%010u%d%010u", dir0, steps0, dir1, steps1);
597 sprintf(buf,
"/%d%d%05u", axis, slopeIndex, slope);
604 sprintf(buf,
"-%d%03d%03d", axis, startDelay, endDelay);
611 sprintf(buf,
"X%d", axis);
615 CTYPE
void DLL
SE_MotorCalibrate(
int dir0,
long steps0,
int dir1,
long steps1,
int bitAxis0,
int bitAxis1,
int usbDevice)
618 sprintf(buf,
"C%d%010u%d%010u%03d%03d", dir0, steps0, dir1, steps1, bitAxis0, bitAxis1);
625 sprintf(buf,
"m%d%d", axis, enable);
629 CTYPE
int DLL
SE_BridgePulse(
int bridge,
int activation,
int deactivation,
int activationWidth,
int deactivationWidth,
int timeBase,
int usbDevice)
632 sprintf(buf,
"B%d%d%d%05d%05d%d", bridge, activation, deactivation, activationWidth, deactivationWidth, timeBase);
636 CTYPE
int DLL
SE_BridgeUntil(
int bridge,
int activation,
int portId,
int portBit,
int bitTrue,
int timeout,
int usbDevice)
639 sprintf(buf,
"@%02d%d%d%d%d%05d", bridge, activation, portId, portBit, bitTrue, timeout);
643 CTYPE
int DLL
SE_LinearScanner(
int dir,
long rows,
unsigned short int * outBuffer,
int usbDevice)
646 sprintf(buf,
"|%d%06u", dir, rows);
654 sprintf(buf,
"T%d%d%05d", adSource, muxChan, average);
657 return (
unsigned short int) atol(ret);
661 CTYPE
unsigned int DLL
SE_ReadCurrent(
int adSource,
int highVoltChan,
int lowVoltChan,
int range,
double refResistence,
int average,
int usbDevice)
665 sprintf(buf,
"O%d%d%d%d%07d%05d", adSource, highVoltChan, lowVoltChan, range, (
int) (refResistence * 1000), average);
668 return (
unsigned short int) atol(ret);
672 CTYPE
long DLL SE_DebugData(
int dataId,
int param0,
int param1,
int usbDevice)
676 sprintf(buf,
"!%03d%03d%03d", dataId, param0, param1);
695 const char bytes[4][3] = { { 0x40, 0x0A, 0xA2 },
696 { 0x40, 0x00, 0x00 },
697 { 0x40, 0x10, 0x00 },
698 { 0x41, 0x00, 0x00 }};
705 ret =
SE_WriteSPI(board, 0, 3, bytes[0], usbDevice);
706 ret =
SE_WriteSPI(board, 0, 3, bytes[1], usbDevice);
707 ret =
SE_WriteSPI(board, 0, 3, bytes[2], usbDevice);
715 const char bytes[6][3] = { { 0x40, 0x0A, 0xA2 },
716 { 0x40, 0x00, 0x00 },
717 { 0x40, 0x10, 0x00 },
718 { 0x41, 0x00, 0x00 },
719 { 0x40, 0x00, 0xFF },
720 { 0x40, 0x10, 0xFF }};
727 ret =
SE_WriteSPI(board, 0, 3, bytes[0], usbDevice);
728 ret =
SE_WriteSPI(board, 0, 3, bytes[1], usbDevice);
729 ret =
SE_WriteSPI(board, 0, 3, bytes[2], usbDevice);
730 ret =
SE_WriteSPI(board, 1, 3, bytes[0], usbDevice);
731 ret =
SE_WriteSPI(board, 1, 3, bytes[4], usbDevice);
732 ret =
SE_WriteSPI(board, 1, 3, bytes[5], usbDevice);
740 char lb[3] = { 0x40, 0x0A, 0x00 };
741 char hb[3] = { 0x40, 0x1A, 0x00 };
743 lb[2] = value & 0xFF;
744 hb[2] = (value >> 8) & 0xFF;
754 char lb[3] = { 0x40, 0x0A, 0x00 };
755 char hb[3] = { 0x40, 0x1A, 0x00 };
757 lb[2] = value & 0xFF;
758 hb[2] = (value >> 8) & 0xFF;
767 char lb[3] = { 0x41, 0x0A, 0x00 };
768 char hb[3] = { 0x41, 0x1A, 0x00 };
776 retValue |= ((((int) ret[2]) & 0xFF)<< 8);
782 char lb[3] = { 0x41, 0x0A, 0x00 };
783 char hb[3] = { 0x41, 0x1A, 0x00 };
791 retValue |= ((((int) ret[2]) & 0xFF)<< 8);
797 char lb[3] = { 0x41, 0x09, 0x00 };
798 char hb[3] = { 0x41, 0x19, 0x00 };
806 retValue |= ((((int) ret[2]) & 0xFF)<< 8);
810 CTYPE
int DLL
SE_EspiRlSet(
int board,
int relay,
int ena,
int usbDevice)
820 CTYPE
int DLL
SE_EspiOpSet(
int board,
int opto,
int ena,
int usbDevice)
832 int v = current / (5.0 / 65536.0);
835 if(v > 65535) v = 65535;
837 buf[0] = (v >> 8) & 0xFF;
856 v = ((int) buf[2]) & 0xFF;
857 v |= ((((int) buf[1]) << 8) & 0xFF00);
858 v |= ((((int) buf[0]) << 16) & 0xFF0000);
862 V *= 0.0000762939453125;
872 sprintf(buf,
"W%d%08d", ena, timeout);
CTYPE int DLL SE_FirmwareRev(int usbDevice)
Check Sestilio firmware revision number.
CTYPE const char DLL_P SE_ReadWriteSPI(int address, int slaveAddress, int num, const char *buffer, int usbDevice)
Write and at the same time read a stream of data from the SPI expansion bus.
CTYPE int DLL SE_SetPIDconstants(int pidID, int constantId, int constantBase, int constantDivider, int usbDevice)
Set some intrinsic PID constants.
CTYPE long DLL SE_ReadDataNumber(const char *command, int rxed, int usbDevice)
Send a command and get it's relative answer as long.
CTYPE int DLL SE_Open(char sestilioId, int usbDevice)
Open the connection with SESTILIO.
CTYPE int DLL SE_FastReadAnalog(int source, int trigger, unsigned period, int samples, int usbDevice)
Start a buffered sampling with one or two A/D converters. Sampled data is stored into RAM 0.
CTYPE int DLL SE_ReadPort(int portAddress, int usbDevice)
Allow to read of the selected port.
CTYPE unsigned int DLL SE_ReadTemperature(int adSource, int muxChan, int average, int usbDevice)
This command enables the realization of an accurate thermometer employing a AD590 sensor to that end.
CTYPE int DLL SE_GetSampleDoubleDataSplit(int source, int address, int num, double *outBuffer0, double *outBuffer1, int usbDevice)
RAM0 and RAM1 are used for sampling data, this command allow to read these devices.
CTYPE int DLL SE_SetPortDirection(int port, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0, int usbDevice)
Allow to set direction (Input or Output) of the selected port.
CTYPE int DLL SE_BridgePulse(int bridge, int activation, int deactivation, int activationWidth, int deactivationWidth, int timeBase, int usbDevice)
Generate a pulse on the specified bridge.
CTYPE int DLL SE_EspiBusInit(int speed, int usbDevice)
Init the SPI expansion bus.
CTYPE int DLL SE_WatchDog(int timeout, int usbDevice)
Set watchdog.
CTYPE int DLL SE_ClrPortBit(int portAddress, int bit, int usbDevice)
Allow to clear a bit on the selected port.
CTYPE int DLL SE_ReadDataBinaryExt(const char *command, char *outBuf, int rxed, int usbDevice)
Send a command and get it's relative answer to store in a buffer specified as parameter.
CTYPE int DLL SE_SetPID(int pidID, int controlOutput, int adChannels, int measureUnit, int targetValue, int controlMaxValue, int behavior, int usbDevice)
Enable SESTILIO as a temperature controller. Four simultaneous temperature controls are performed at ...
CTYPE int DLL SE_CheckAck(int usbDevice)
Check if an ACK is received from SESTILIO.
CTYPE int DLL SE_SetMotorSpeed(int axis, int startDelay, int endDelay, int usbDevice)
This command effects the speed setting of the motor on the selected axis. The setting adopts an accel...
CTYPE int DLL SE_SetMotorSlope(int axis, int slopeIndex, int slope, int usbDevice)
If the number of steps is sufficient, the setting command realizes an accelerating and decelerating r...
#define SE_PID_UNIT_MF
milli Fahrenheit (AD590 as temperature sensor) not implemented in SESTILIO firmware but at library le...
CTYPE int DLL SE_Status(int usbDevice)
Return the status of the last execute operation.
CTYPE int DLL SE_WriteRAM(int source, int address, int num, const char *buffer, int usbDevice)
RAM0 and RAM1 are used for sampling or signal generation, this command allow to write these devices.
CTYPE int DLL SE_EspiRlSet(int board, int relay, int ena, int usbDevice)
Turn on or off a relay on the ESPI-RL board.
CTYPE int DLL SE_FlowReadAnalog(int source, unsigned int num, unsigned short int *outBuffer, int usbDevice)
Maximum speed for A/D sample read. Is a procedure that sample the A/D converter at the maximum speed ...
CTYPE int DLL SE_TransientResponse(int da, int daValue, unsigned period, int samples, int usbDevice)
Perform transient response analysis. Sampling of data is performed with AD0 and AD1,...
CTYPE int DLL SE_AuxMotorPositCalib(int id, int dir, int steps, int delay, int fcLevel, int usbDevice)
Executes a positioning on specified axes in the direction of and by a maximum number of steps to find...
CTYPE long DLL SE_ReadMotorCount(int axis, int usbDevice)
After having launched a setting, it may be necessary to know how much time is needed to complete the ...
#define SE_PID_UNIT_MK
milli Kelvin (AD590 as temperature sensor)
#define SE_PID_UNIT_MC
milli Celsius (AD590 as temperature sensor) not implemented in SESTILIO firmware but at library level
#define SE_S_RUN
Command running.
CTYPE const char DLL_P SE_ReadData(const char *command, int rxed, int usbDevice)
Send a command and get it's relative answer as character string.
CTYPE int DLL SE_PortPulse(int port, int initialValue, int finalValue, int pulseWidth, int timeBase, int usbDevice)
Generate a pulse on the specified port.
CTYPE unsigned DLL SE_Counts(int usbDevice)
Some procedures are long task, with this command is possible to check a countdown to the end of task.
CTYPE int DLL SE_PutSampleData(int source, int address, int num, unsigned short int *outBuffer, int usbDevice)
RAM0 and RAM1 are used for signal generation, this command allow to write these devices.
CTYPE const char DLL_P SE_ReadDataBinary(const char *command, int rxed, int usbDevice)
Send a command and get it's relative answer as a buffer of bytes.
CTYPE int DLL SE_EspiOpWrite(int board, int value, int usbDevice)
Write a value on the ESPI-OP board.
CTYPE const char DLL_P SE_ReadEEPROM(int address, int num, int usbDevice)
SESTILIO have an EEPROM of 128Kbyte for user data, this command allow to read this devices.
CTYPE int DLL SE_WriteEEPROM(int address, int num, const char *buffer, int usbDevice)
SESTILIO have an EEPROM of 128Kbyte for user data, this command allow to write this devices.
CTYPE int DLL SE_EspiOpOutRead(int board, int usbDevice)
Read the status of the opto-coupled output port from the ESPI-OP board.
CTYPE int DLL SE_PwmOptoCoupledPowerPort(int bitSelect, int enable, int lowWidth, int highWidth, int usbDevice)
Start (or stop) a PWM the optically decoupled power port.
CTYPE int DLL SE_WritePort(int portAddress, int portValue, int usbDevice)
Allow to write on the selected port.
CTYPE int DLL SE_SetMux(int chan, int usbDevice)
Select a multiplexer channel.
CTYPE int DLL SE_CPUtemperature(int usbDevice)
Read Sestilio CPU temperature.
CTYPE int DLL SE_LinearScanner(int dir, long rows, unsigned short int *outBuffer, int usbDevice)
With the optional module LINCAM-1 SESTILIO can be used to implement an image scanner....
CTYPE unsigned short int DLL SE_ReadAnalog(int source, int average, int usbDevice)
Start a sampling with a selected A/D converters.
CTYPE int DLL SE_GetSampleData(int source, int address, int num, unsigned short int *outBuffer, int usbDevice)
RAM0 and RAM1 are used for sampling data, this command allow to read these devices.
CTYPE int DLL SE_EspiRlInit(int board, int usbDevice)
Init ESPI-RL board connected on SPI expansion bus.
CTYPE int DLL SE_SetPortBit(int portAddress, int bit, int usbDevice)
Allow to set a bit on the selected port.
CTYPE int DLL SE_ClrCounts(int usbDevice)
Clear the countdown.
CTYPE unsigned int DLL SE_ReadCurrent(int adSource, int highVoltChan, int lowVoltChan, int range, double refResistence, int average, int usbDevice)
This command enables the realization of an accurate ammeter using an external resistance and two A/D ...
CTYPE int DLL SE_AuxPower(int pwrCtrl, int usbDevice)
Turn on/off the power on Y4.16, maximum allowed current is 50mA.
#define SE_S_FAIL
Failed operation.
CTYPE int DLL SE_Command(const char *command, int usbDevice)
Send a specified command without any parameters.
CTYPE int DLL SE_SetGain(int chan, int gain, int usbDevice)
Select a gain for specified channel. Gain control is available for group of channels 0-7 and 8-15.
CTYPE int DLL SE_Close(int usbDevice)
Close the connection with SESTILIO. This procedure must be execute at the end of your program.
CTYPE int DLL SE_CheckSPI(int address, int slaveAddress, int usbDevice)
Return the logic level of the MISO line.
CTYPE int DLL SE_SetMotorEnable(int axis, int enable, int usbDevice)
Turn on/off the motor. After a positioning the motor is always on, this can be useful for a great hol...
CTYPE int DLL SE_WriteKPortConfig(int regAdd, int regValue, int usbDevice)
Allow to write a register of the Port Expander (MCP23S17) used for PORT A and B.
CTYPE int DLL SE_SetPIDtimeBase(int timeBaseMultiplier, int usbDevice)
The PID is a preset value and runs a cycle every 100 mS.This command enables modification of before m...
CTYPE int DLL SE_EspiOpSet(int board, int opto, int ena, int usbDevice)
Turn on or off an opto-coupled power output on the ESPI-OP board.
CTYPE int DLL SE_WriteAnalogDual(int val0, int val1, int usbDevice)
Set all DACs to a requested value at the same time.
#define SE_S_SUCCESS
Success.
CTYPE unsigned short int DLL SE_PIDdata(int pidId, int usbDevice)
Read the PID data value.
CTYPE int DLL SE_EspiRlRead(int board, int usbDevice)
Read the set relay from the ESPI-RL board.
CTYPE int DLL SE_FastWriteAnalog(int source, int trigger, unsigned period, int samples, int usbDevice)
Is a function generator on one or two DACs at the same time.
CTYPE int DLL SE_ReadKPortConfig(int regAdd, int usbDevice)
Allow to read a register of the Port Expander (MCP23S17) used for PORT A and B.
CTYPE int DLL SE_CheckPortBit(int port, int bit, int usbDevice)
Check a bit of the opto-coupled port.
CTYPE int DLL SE_EspiOpRead(int board, int usbDevice)
Read the opto-coupled input from the ESPI-OP board.
CTYPE int DLL SE_WriteDataBinary(const char *command, const char *buffer, unsigned length, int usbDevice)
Send a specified command and it's buffer of parameters.
CTYPE int DLL SE_EspiRlWrite(int board, int value, int usbDevice)
Write a value on the ESPI-RL board.
CTYPE void DLL SE_CommandDeaf(const char *command, int usbDevice)
Send a specified command without any parameters and without wait ACK from SESTILIO.
CTYPE int DLL SE_GetSampleDoubleData(int source, int address, int num, double *outBuffer, int usbDevice)
RAM0 and RAM1 are used for sampling data, this command allow to read these devices.
CTYPE const char DLL_P SE_ReadSPI(int address, int slaveAddress, int num, int usbDevice)
Read a stream of data from the SPI expansion bus.
CTYPE int DLL SE_AuxMotorPositioning(int id, int dir, int steps, int delay, int usbDevice)
Executes a positioning on specified axes in the direction of and by the specified number of steps....
Sestilio Library Function and Procedures prototypes.
CTYPE int DLL SE_BridgeUntil(int bridge, int activation, int portId, int portBit, int bitTrue, int timeout, int usbDevice)
Activate a specified bridge until a bit on specified port is true or forever.
CTYPE int DLL SE_SetID(char sestilioId, int usbDevice)
Set a new ID for connected SESTILIO. As factory setting the ID is set to '0'.
CTYPE void DLL SE_MotorCalibrate(int dir0, long steps0, int dir1, long steps1, int bitAxis0, int bitAxis1, int usbDevice)
Command allowing calibration of one or more axes at a time. Executes a maximum number of steps until ...
CTYPE double DLL SE_LsrDrvGet(int board, int usbDevice)
Measure the current set on LSR-PWR1 board on ESPI bus.
CTYPE int DLL SE_WriteSPI(int address, int slaveAddress, int num, const char *buffer, int usbDevice)
Write a stream of data on SPI expansion bus.
CTYPE int DLL SE_LsrDrvSet(int board, double current, int usbDevice)
Set the current for LSR-PWR1 board on ESPI bus.
CTYPE unsigned DLL SE_NumOfDevices()
How many SESTILIO are connected?.
CTYPE int DLL SE_EspiOpInit(int board, int usbDevice)
Init ESPI-OP board connected on SPI expansion bus.
CTYPE int DLL SE_WriteAnalog(int chan, int value, int usbDevice)
Set a specified DAC to a requested value.
CTYPE int DLL SE_SetClockSPI(int speed, int mode, int usbDevice)
Set the SPI clock.
CTYPE const char DLL_P SE_ReadRAM(int source, int address, int num, int usbDevice)
RAM0 and RAM1 are used for sampling or signal generation, this command allow to read these devices.
CTYPE int DLL SE_MotorPositioning(int dir0, long steps0, int dir1, long steps1, int usbDevice)
Executes a positioning on two axes in the direction of and by the specified number of steps.