LJ_chLED_STATE
LJ_chU3HV //Reads TRUE if U3-HV. False if U3-LV or hardware version <1.30.
Following is example pseudocode to write and read the local ID:
//Set the local ID to 4.
ePut (lngHandle, LJ_ioPUT_CONFIG, LJ_chLOCALID, 4, 0);
//Read the local ID.
eGet (lngHandle, LJ_ioGET_CONFIG, LJ_chLOCALID, &dblValue, 0);
4.3.3 - Analog Inputs
The IOTypes to retrieve a command/response analog input reading are:
LJ_ioGET_AIN //Single-ended. Negative channel is fixed as 31/199.
LJ_ioGET_AIN_DIFF //Specify negative channel in x1.
The following are special channels, used with the get/put config IOTypes, to configure parameters that apply to all analog inputs:
LJ_chAIN_RESOLUTION //QuickSample enabled if TRUE.
LJ_chAIN_SETTLING_TIME //LongSettling enabled if TRUE.
LJ_chAIN_BINARY
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 others as
//digital (see Section 4.3.2). b01000110 = 0x46 = d70.
//The ePut function is used, which combines the add/go/get.
ePut (lngHandle, LJ_ioPUT_ANALOG_ENABLE_PORT, 0, 70, 16);
//Now, an add/go/get block to execute multiple requests.
//Request a single-ended read from AIN2.
AddRequest (lngHandle, LJ_ioGET_AIN, 2, 0, 0, 0);
//Request a differential read of AIN1-AIN6.
AddRequest (lngHandle, LJ_ioGET_AIN_DIFF, 1, 0, 6, 0);
//Request a differential read of AIN1-Vref.
AddRequest (lngHandle, LJ_ioGET_AIN_DIFF, 1, 0, 30, 0);
//Request a single-ended read of AIN1.
AddRequest (lngHandle, LJ_ioGET_AIN_DIFF, 1, 0,199, 0);
//Request a read of AIN1 using the special 0-3.6 volt range.
AddRequest (lngHandle, LJ_ioGET_AIN_DIFF, 1, 0, 32, 0);
//Execute the requests.
GoOne (lngHandle);
//Since multiple requests were made with the same IOType
//and Channel, and only x1 was different, GetFirst/GetNext
//must be used to retrieve the results. The simple
//GetResult function does not use the x1 parameter and
//thus there is 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
//the results in order. Normally, GetFirst/GetNext are best
//used in a loop, but here they are simply called in succession.
//Retrieve AIN2 voltage. GetFirstResult returns the IOType,
//Channel, Value, x1, and UserData from the first request.
//In this example we are just retrieving the results in order
//and Value is the only parameter we need.
GetFirstResult (lngHandle, 0, 0, &dblValue, 0, 0);
//Get the AIN1-AIN6 voltage.
GetNextResult (lngHandle, 0, 0, &dblValue, 0, 0);
//Get the AIN1-Vref voltage.
GetNextResult (lngHandle, 0, 0, &dblValue, 0, 0);
//Get the AIN1 voltage.
GetNextResult (lngHandle, 0, 0, &dblValue, 0, 0);
//Get the AIN1 voltage (special 0-3.6 volt range).
GetNextResult (lngHandle, 0, 0, &dblValue, 0, 0);
4.3.4 - Analog Outputs
The IOType to set the voltage on an analog output is:
LJ_ioPUT_DAC
The following are IOTypes used to write/read the enable bit for DAC1:
LJ_ioPUT_DAC_ENABLE //Ignored on hardware rev 1.30+, as DAC1 always enabled.
LJ_ioGET_DAC_ENABLE
The following is a special channel, used with the get/put config IOTypes, to configure a parameter that applies to all DACs:
LJ_chDAC_BINARY
Following is example pseudocode to set DAC0 to 2.5 volts:
//Set DAC0 to 2.5 volts.
ePut (lngHandle, LJ_ioPUT_DAC, 0, 2.50, 0);
4.3.5 - Digital I/O
There are eight IOTypes used to write or read digital I/O information:
LJ_ioGET_DIGITAL_BIT //Also sets direction to input.
34