Write Multiple Registers
t, txt = mbo:wmr(adr, regs, tfmt, ttab, [ms])
t, txt = modbus.wmr(cpo, adr, regs, tfmt, ttab, [ms])
Write multiple registers (Modbus function 16/0x10)
Parameter | Type | Description |
---|---|---|
mbo |
object table | Modbus Object |
cpo |
object | COM Port Object |
adr |
integer | Slave address |
regs |
integer | First register to read |
tfmt |
string | Transmit format string ([Modbus Format Strings]) |
ttab |
table | Transmit data tabl;e |
ms |
integer | Receive timeout |
Returns | Type | Description |
---|---|---|
t |
table | Values returned (should be just start register and count) |
txt |
string | Remaining string (if any) |
e.g.
modbus.wmr(dp,2,19,'W',{5}) -- sets OverFLO average length=5
Each "Register" is 16-bits wide.