writeRead
R2026bWrite and read holding registers in single Modbus transaction
Syntax
Description
writes and reads data from holding registers on a Modbus server connected to the client
specified by moddata = writeRead(modbusClientObj,writeAddress,values,readAddress,readCount)modbusClientObj. The function writes
values to registers starting at writeAddress,
then reads from registers starting at readAddress in a single Modbus
transaction. readCount specifies the number of consecutive registers
to read.
The write operation is always performed before the read. Performing both operations in a
single transaction avoids the risk of register values changing between separate write and read calls, and reduces communication
overhead. The write and read address ranges must each be contiguous but are specified
independently and need not overlap.
additionally specifies moddata = writeRead(modbusClientObj,writeAddress,values,writePrecision,readAddress,readCount,readPrecision)writePrecision and
readPrecision to determine how the register data is interpreted
for the write and read operations.