The IOTypes to retrieve a command/response analog input reading are:
LJ_ioGET_AIN //Single-ended. Negative channel is fixed as 0/15/199.
LJ_ioGET_AIN_DIFF //Specify negative channel in x1.
Differential channels are adjacent even/odd pairs only, such as AIN2-AIN3. Thus the positive channel must be even and the negative channel must be +1. The Windows UD driver has different
IOTypes for single-ended or differential reads, but the differential
IOType can always be used as a negative channel (x1 parameter) of 0/15/199 equates to a single-ended reading.
The following are IOTypes used to configure (or read) the input range of a particular analog input channel:
LJ_ioPUT_AIN_RANGE // Range and Gain are synonymous
LJ_ioGET_AIN_RANGE // Range and Gain are synonymous
In addition to specifying the channel number, the following range (i.e. gain) constants are passed in the value parameter when doing a request with the
AIN range
IOType:
LJ_rgBIP10V // +/- 10V, i.e. Gain=x1
LJ_rgBIP1V // +/- 1V, i.e. Gain=x10
LJ_rgBIPP1V // +/- 0.1V, i.e. Gain=x100
LJ_rgBIPP01V // +/- 0.01V, i.e. Gain=x1000
The following are special channels, used with the get/put config
IOTypes, to configure parameters that apply to all analog inputs:
LJ_chAIN_RESOLUTION //0=default, 1-8=high-speed ADC, 9-12=high-res ADC
LJ_chAIN_SETTLING_TIME //0-9 where 0=Auto, see Section 5.2.5.2
LJ_chAIN_BINARY
Following is example pseudocode to read analog inputs:
//Configure all analog inputs for max resolution.
Comments
No comments yet. Speak up. We're listening.