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]handleValid handle returned by SM_Open().
[out]valueAfter completion, contains a double floating-point voltage representation of 'data'.
[in]dataTwo bytes of data - usually returned by SM_ReadInputRegisters().
[in]channelRangeA/D channel range of the Sealevel I/O module.
Return values
0Successful completion.
-1Invalid SeaMAX handle.
-2Unknown 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
 
 
Generated on Mon Nov 26 2018.