|
int __stdcall SM_AtoDConversion |
( |
SM_HANDLE |
handle, |
|
|
double * |
value, |
|
|
unsigned char * |
data, |
|
|
int |
channelRange |
|
) |
| |
Converts a two-byte input register value to a double type voltage.
- Deprecated:
- Version 3.0.4
- Parameters
-
[in] | handle | Valid handle returned by SM_Open(). |
[out] | value | After completion, contains a double floating-point voltage representation of 'data'. |
[in] | data | Two bytes of data - usually returned by SM_ReadInputRegisters(). |
[in] | channelRange | A/D channel range of the Sealevel I/O module. |
- Return values
-
0 | Successful completion. |
-1 | Invalid SeaMAX handle. |
-2 | Unknown voltage range. |
This function has been provided as a way to simply for calculations required to convert the 16-bit data returned by SM_ReadInputRegisters() into a more usuable double-precision floating point form. This function converts a two-byte array into a single floating point given a valid A/D channel range.
- Note
- If your particular Sealevel I/O device supports current mode conversions, call this function to return the voltage reading across the internal precision resistor. To convert to a current reading, divide that value by 249.0(Ohms).
- See also
- Channel Range values, Manual Conversion of A/D Values
|