int __stdcall SM_SetAnalogInputConfig ( SM_HANDLE  handle,
unsigned char  reference,
unsigned char  mode 
)

Sets the device's analog configuration.

Parameters
[in]handleValid handle returned by SM_Open().
[in]referenceAnalog to digital reference point.
[in]modeDevice input mode.
Return values
0Successful completion.
-1Invalid SeaMAX handle.
-2Error retrieving the mode configuration.
-3Connection is not established. Check the provided Connection object state.
-4Modbus: Read error waiting for response. Unknown Modbus exception.
-5Modbus: Illegal Modbus Function (Modbus Exception 0x01).
-6Modbus: Illegal Data Address (Modbus Exception 0x02).
-7Modbus: Illegal Data Value (Modbus Exception 0x03).
-8Modbus: CRC was invalid. Possible communications problem.
-9Invalid device configuration.

Sets the I/O device's offset reference and A/D channel mode. The reference parameter determines which source each analog input is compared against. The mode parameter determines the overall configuration of the channels and whether they are single-ended or paired.

Note
The reference parameter for almost all purposes should be set to ANALOG. This is the normal reference point for single-ended, differential, and current mode applications. Other reference points have been included as diagnostic tools or references for calibration.

For more information on the appropriate values, see A/D Voltage Reference values and A/D Channel Modes.

Note
This method only applies to certain models. See SeaMAX by Sealevel Model Number for details.