SESTILIO  3.0.2
C Library for SESTILIO a smart A/D and D/A interface on USB 2.0
Analog channels

Functions

CTYPE int DLL SE_SetMux (int chan, int usbDevice)
 Select a multiplexer channel. More...
 
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. More...
 
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. More...
 
CTYPE unsigned short int DLL SE_ReadAnalog (int source, int average, int usbDevice)
 Start a sampling with a selected A/D converters. More...
 
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 the sample isn't time correlated. More...
 
CTYPE int DLL SE_WriteAnalog (int chan, int value, int usbDevice)
 Set a specified DAC to a requested value. More...
 
CTYPE int DLL SE_WriteAnalogDual (int val0, int val1, int usbDevice)
 Set all DACs to a requested value at the same time. More...
 
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. More...
 

Detailed Description

Basic functions for the full control of all analog channels (A/D and D/A).

Function Documentation

◆ SE_FastReadAnalog()

int 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.

Parameters
sourceSet which A/D is used for sampling. 0 = AD0, 1 = AD1, 2 = AD0 and AD1. A/D Selection
triggerSet requested trigger mode. 0 = No trigger, 1 = INTA, 2 = INTB, 3 = P4.6 Low, 4 = P4.6 High, 5 = P4.7 Low, P4.7 High. Trigger source
periodSet the sampling period in the range 1 to 1E8 us.
samplesSet the number of samples to be acquired, accepted range is 1 to 16384 but with source 2 (AD0+AD1) maximum number of samples is 8192. With source = 2 this number is the total amount.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetMux, SE_SetGain, SE_ReadAnalog.
#include "sest.h"
if(SE_Open('0', 0) == SE_S_SUCCESS)
{
unsigned short int mem[1024]; // Storage area for sampled data
SE_SetMux(0, 0); // Set channel 0 on AD0
SE_FastReadAnalog(0, 0, 2, 1024, 0); // Grab 1024 samples from AD0 @ 500KHz
SE_GetSampleData(SE_RAM_0, 0, 1024, mem, 0); // Get sampled data
// Dump sampled data
for(int i = 0; i < 1024; i++)
printf("[%04d] = %6.3lfV\n", i, SE_ADV((double) mem[i]));
}
Returns
Operation status. Operation Status

Definition at line 253 of file sestilio.cpp.

◆ SE_FastWriteAnalog()

int 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.

Parameters
sourceSet which D/A is used for signal generator. 0 = DA0, 1 = DA1, 2 = DA0 and DA1. D/A Selection
triggerSet requested trigger mode. 0 = No trigger, 1 = INTA, 2 = INTB, 3 = P4.6 Low, 4 = P4.6 High, 5 = P4.7 Low, P4.7 High. Trigger source
periodSet the sampling period in the range 1 to 1E8 us.
samplesSet the number of samples to be used for signal generation, accepted range is 1 to 16384 but with source 2 (DA0+DA1) maximum number of samples is 8192.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_WriteAnalog, SE_WriteAnalogDual.
Returns
Operation status. Operation Status

Definition at line 237 of file sestilio.cpp.

◆ SE_FlowReadAnalog()

int 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 the sample isn't time correlated.

Parameters
sourceSet which A/D is used for sampling. 0 = AD0, 1 = AD1. A/D Selection
samplesSet the number of samples to be acquired.
outBufferWhere will be stored 16 bit A/D data.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetMux, SE_SetGain, SE_ReadAnalog.
Returns
Operation status. Operation Status

Definition at line 260 of file sestilio.cpp.

◆ SE_ReadAnalog()

unsigned short int SE_ReadAnalog ( int  source,
int  average,
int  usbDevice 
)

Start a sampling with a selected A/D converters.

Parameters
sourceSet which A/D is used for sampling. 0 = AD0, 1 = AD1. A/D Selection
averageNumber of samples to use in average.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetMux, SE_SetGain, SE_FastReadAnalog.
#include "sest.h"
if(SE_Open('0', 0) == SE_S_SUCCESS)
{
// Dump all 16 channels
for(int ch = 0; ch < 16; ch++)
printf("CH[%2d] = %6.3lfV\n", ch, SE_ADV((double) SE_ReadAnalog(ch, 1, 0)));
}
Returns
Average of sampled data.

Definition at line 212 of file sestilio.cpp.

◆ SE_SetGain()

int 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.

Parameters
chanSelect a channel for the A/D converter. Range 0-7 set the mux for the A/D 0, range 8-15 for the A/D 1.
gainGain id. 0 = 1X, 1 = 2X, 2 = 4X, 3 = 5X, 4 = 8X, 5 = 10X, 6 = 16X, 7 = 32X. Gain Selection
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetMux, SE_FastReadAnalog, SE_ReadAnalog.
Returns
Operation status. Operation Status

Definition at line 244 of file sestilio.cpp.

◆ SE_SetMux()

int SE_SetMux ( int  chan,
int  usbDevice 
)

Select a multiplexer channel.

Parameters
chanSelect a channel for the A/D converter. Range 0-7 set the mux for the A/D 0, range 8-15 for the A/D 1.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetGain, SE_FastReadAnalog, SE_ReadAnalog.
Returns
Operation status. Operation Status

Definition at line 202 of file sestilio.cpp.

◆ SE_WriteAnalog()

int SE_WriteAnalog ( int  chan,
int  value,
int  usbDevice 
)

Set a specified DAC to a requested value.

Parameters
chanSelect which D/A converter is used, 0 or 1. D/A Selection
valueDAC data in the range 0-4095. 4095 = 4.86V. Conversion Macros
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_WriteAnalogDual, SE_FastWriteAnalog.
Returns
Operation status. Operation Status

Definition at line 223 of file sestilio.cpp.

◆ SE_WriteAnalogDual()

int SE_WriteAnalogDual ( int  val0,
int  val1,
int  usbDevice 
)

Set all DACs to a requested value at the same time.

Parameters
val0DAC0 data in the range 0-4095. 4095 = 4.86V Conversion Macros
val1DAC1 data in the range 0-4095. 4095 = 4.86V Conversion Macros
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_WriteAnalog, SE_FastWriteAnalog.
Returns
Operation status. Operation Status

Definition at line 230 of file sestilio.cpp.