CClientAPI::ReadAnalog
Form
long ReadAnalog(short DeviceType, short Channel, short * pVal)
Return value is ERRCODE value.
Description
Reads the analog input value from ADC board .
DeviceType value is a type of Analog-to-Digital converter
that is installed on the board
DEVICE_TLC2543.
Available values of Channel are:
ANALOG_CHANNEL1
ANALOG_CHANNEL2
ANALOG_CHANNEL3
ANALOG_CHANNEL4
ANALOG_CHANNEL5
ANALOG_CHANNEL6
ANALOG_CHANNEL7
ANALOG_CHANNEL8
ANALOG_CHANNEL9
ANALOG_CHANNEL10
ANALOG_CHANNEL11
ANALOG_CHANNEL12
DEVICE_MAX127, DEVICE_MAX128
Channel defines a number of physical analog input of ADC board.
Available values of Channel are 0,1,2,3,4,5,6, 7.
pVal is a pointer to the variable that receives analog input information.
Example
// Create an object
CClientAPI obj;
short Value;
if ( !obj.InitPort())
{
// Get the analog input value of channel #4
ERRCODE ec=board.ReadAnalog(DEVICE_TLC2543, ANALOG_CHANNEL4, &Value);
if ( !ec )
// Good request
else
// Bad request
}