//Read the current IP address.
eGet (lngHandle, LJ_ioGET_CONFIG, LJ_chIP_ADDRESS, &dblAddress, 0);
//Convert a double to an address string in dot notation.
//The general form of the DoubleToStringAddress function is:
//DoubleToStringAddress (Number, *String, HexDot)
DoubleToStringAddress (dblAddress, strIPAddress, 0);
4.3.3 - Analog Inputs
The IOType to retrieve a command/response analog input reading is:
LJ_ioGET_AIN
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 constants are passed in the value parameter when doing a
request with the AIN range IOType:
LJ_rgUNI5V // 0-5 V, LabJackUD Default
LJ_rgUNI2P5V // 0-2.5 V (not supported with resolution=18)
LJ_rgUNI1P25V // 0-1.25 V (not supported with resolution=18)
LJ_rgUNIP625V // 0-0.625 V (not supported with resolution=18)
LJ_rgBIP5V // +/- 5 V
The following are special channels, used with the get/put config IOTypes, to configure parameters that apply to all analog inputs:
LJ_chAIN_RESOLUTION
LJ_chAIN_SETTLING_TIME
LJ_chAIN_BINARY
Following is example pseudocode to configure and read two analog inputs:
//Configure all analog inputs for 14-bit resolution. Like most
//settings, this will apply to all further measurements until
//the parameter is changed or the DLL unloaded.
AddRequest (lngHandle, LJ_ioPUT_CONFIG, LJ_chAIN_RESOLUTION, 14, 0, 0);
//Configure AIN2 for +/- 5 volt range.
AddRequest (lngHandle, LJ_ioPUT_AIN_RANGE, 2, LJ_rgBIP5V, 0, 0);
//Configure AIN3 for +/- 5 volt range.
AddRequest (lngHandle, LJ_ioPUT_AIN_RANGE, 3, LJ_rgBIP5V, 0, 0);
//Request a read from AIN2.
AddRequest (lngHandle, LJ_ioGET_AIN, 2, 0, 0, 0);
//Request a read from AIN3.
AddRequest (lngHandle, LJ_ioGET_AIN, 3, 0, 0, 0);
//Execute the requests.
GoOne (lngHandle);
//Get the AIN2 voltage.
GetResult (lngHandle, LJ_ioGET_AIN, 2, &dblValue);
//Get the AIN3 voltage.
GetResult (lngHandle, LJ_ioGET_AIN, 3, &dblValue);
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 each DAC. Note that although there is an enable bit for each DAC
on the UE9, both DACs are enabled or disabled at the same time:
LJ_ioPUT_DAC_ENABLE //Applies to both DACs. Channel # ignored.
LJ_ioGET_DAC_ENABLE //Applies to both DACs. Channel # ignored.
The following is a special channel, used with the get/put config IOTypes, to configure a parameter that applies to both DACs:
LJ_chDAC_BINARY
Following is example pseudocode to set DAC1 to 2.5 volts:
//Set DAC1 to 2.5 volts.
ePut (lngHandle, LJ_ioPUT_DAC, 1, 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.
LJ_ioGET_DIGITAL_BIT_DIR
41
Summary of Contents for UE9
Page 84: ...84 ...