Modbus function 23 (17 hex), Read/Write Registers.
[Visual Basic] Overloads Public Function readWriteRegisters( _ ByVal slaveAddr As Integer, _ ByVal readRef As Integer, _ ByVal readArr As Short(), _ ByVal writeRef As Integer, _ ByVal writeArr As Short() _ ) As Integer
[C#] public int readWriteRegisters( intslaveAddr, intreadRef, short[]readArr, intwriteRef, short[]writeArr );
Parameters
slaveAddr
Modbus address of slave device or unit identifier (Range: 1 - 255)
readRef
Start registers for reading (Range: 1 - $10000)
readArr
Buffer which will contain the data read. The length of the array determines how many registers are read (Range: 1-125).
writeRef
Start registers for writing (Range: 1 - $10000)
writeArr
Buffer with data to be sent. The length of the array determines how many registers are written (Range: 1-100).
Return Value
BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.
Remarks
Combines reading and writing of the output registers in one transaction (holding registers, 4:00000 table).