int __stdcall SM_ReadHoldingRegisters ( SM_HANDLE  handle,
int  start,
int  number,
unsigned char *  values 
)

Reads a 16-bit value from the Sealevel I/O device, depending on the model.

Deprecated:
Version 3.0.4
Parameters
[in]handleValid handle returned by SM_Open().
[in]startModbus address to begin the read (zero-indexed).
[in]numberQuantity of holding registers to read.
[out]valuesRegister state values.
Return values
>=0Number of bytes successfully returned in result array.
-1Invalid SeaMAX handle.
-2Connection is not established. Check the provided Connection object state.
-3Read error waiting for response. Unkown Modbus exception.
-4Illegal Modbus Function (Modbus Exception 0x01).
-5Illegal Data Address (Modbus Exception 0x02).
-6Illegal Data Value (Modbus Exception 0x03).
-7Modbus CRC was invalid. Possible communications problem.

This function performs different tasks depending on the model of Sealevel I/O device. For more information, see

Note
Modbus holding registers are 16-bit wide registers. Therefore, each read will result in 2 bytes in the result array. For multi-register reads, the high-order byte will reside in the first byte (result[0]) with the lower-order byte residing thereafter (result[1]). Other register bytes subsequently follow the same pattern.
Warning
The result array parameter should have enough allocated space, before calling this method, to hold 2 bytes for every register requested.

Referenced by CSeaMaxW32::Read().

 
 
Generated on Mon Nov 26 2018.