LJ_ioGET_AIN //Single-ended. Negative channel is fixed as 31.
configure
J_chAIN_SETTLING_TIME //LongSettling enabled if TRUE.
J_chAIN_BINARY
s as
.
Put (lngHandle, LJ_ioPUT_ANALOG_ENABLE_PORT, 0, 70, 16);
ddRequest (lngHandle, LJ_ioGET_AIN_DIFF, 1, 0, 6, 0);
e-ended read of AIN1.
andle, LJ_ioGET_AIN_DIFF, 1, 0, 31, 0);
N_DIFF, 1, 0, 32, 0);
requests.
ts were made with the same IOType
1 was different, GetFirst/GetNext
ve the results. The simple
ction does not use the x1 parameter and
no way to specify which result is desired.
/Rather than specifying the IOType and Channel of the
/result to be read, the GetFirst/GetNext functions retrieve
t
/used in a loop, but here they are simply called in succession.
ype,
st.
re just retrieving the results in order
//Get the AIN1-AIN6 voltage.
e, 0, 0, &dblValue, 0, 0);
etNextResult (lngHandle, 0, 0, &dblValue, 0, 0);
LJ_ioGET_AIN_DIFF //Specify negative channel in x1.
The following are special channels, used with the get/put config IOTypes, to
parameters that applies to all analog inputs:
J_chAIN_RESOLUTION //QuickSample enabled if TRUE.
L
L
L
Following is example pseudocode to read analog inputs:
//Execute the pin_configuration_reset IOType so that all
//pin assignments are in the factory default condition.
//The ePut function is used, which combines the add/go/get.
ePut (lngHandle, LJ_ioPIN_CONFIGURATION_RESET, 0, 0, 0);
//Configure FIO1, FIO2, and FIO6 as analog, all other
//digital (see Section 4.3.2).
//The ePut function is used, which combines the add/go/get
e
//Now, an add/go/get block to execute multiple requests.
//Request a single-ended read from AIN2.
ddRequest (lngHandle, LJ_ioGET_AIN, 2, 0, 0, 0);
A
/Request a differential read of AIN1-AIN6.
/
A
//Request a differential read of AIN1-Vref.
ddRequest (lngHandle, LJ_ioGET_AIN_DIFF, 1, 0, 30, 0);
A
//Request a singl
ddRequest (lngH
A
//Request a read of AIN1 using the special 0-3.6 volt range.
AddRequest (lngHandle, LJ_ioGET_AI
//Execute the
GoOne (lngHandle);
//Since multiple reques
//and Channel, and only x
o retrie
//must be used t
//GetResult fun
/thus there is
/
/
/
//the results in order. Normally, GetFirst/GetNext are bes
/
//Retrieve AIN2 voltage. GetFirstResult returns the IOT
Channel, Value, x1, and UserData from the first reque
//
//In this example we a
//and Value is the only parameter we need.
etFirstResult (lngHandle, 0, 0, &dblValue, 0, 0);
G
GetNextResult (lngHandl
//Get the AIN1-Vref voltage.
G
64