121
A/D Converter Methods (WACI NX+ Only)
Available for WACI NX+ ONLY.
AD_ReadVoltage ( Port )
AD_ReadVoltage ( Port )
AD_ReadVoltage ( Port )
AD_ReadVoltage ( Port )
Reads the analog voltage across the specified A/D converter port.
Syntax
HRESULT AD_ReadVoltage(
[in] long Port,
[out, retval] double* Val
);
Parameters
Port
[in] Port number for the A/D converter. Valid values are 1, 2, 3, and 4.
Val
[out, retval] Voltage across the specified A/D port.
Remarks
The value returned by this call represents the raw voltage applied to the specified port. It will fall between
0
and
the value returned by
AD_MaxVoltage
. By default, the maximum voltage value is
10.0
.
AD_ReadDigital ( Port )
AD_ReadDigital ( Port )
AD_ReadDigital ( Port )
AD_ReadDigital ( Port )
Returns the integer value (0 to 1023) that is proportional to the voltage applied to the specified port.
Syntax
HRESULT AD_ReadDigital(
[in] long Port,
[out, retval] long* Val
);
Parameters
Port
[in] Port number for the A/D converter. Valid values are 1, 2, 3, and 4.
Val
[out, retval] An integer value between 0 and 1023
Remarks
The Analog to Digital ports convert voltage values to integer values. The integer value is proportional to the
applied voltage. For example, if the port accepts voltages between 0v and 10v, and the digital values range
between 0 and 1023, then a voltage of 4v would return a digital value of 409. A value of 5v would return a
digital value of 511.
AD_DigitalToVoltage ( Port, Digital )
AD_DigitalToVoltage ( Port, Digital )
AD_DigitalToVoltage ( Port, Digital )
AD_DigitalToVoltage ( Port, Digital )
Converts a digital value to an analog voltage value.