Transmit RTU Frame
mbo:tx(adr, fnc, d1, d2, …)
mbo:tx(adr, fnc, txt)
modbus.tx(cpo, adr, fnc, d1, d2, …)
modbus.tx(cpo, adr, fnc, txt)
Transmit a Modbus RTU frame.
Parameter | Type | Description |
---|---|---|
mbo |
object table | Modbus Object |
cpo |
object | COM Port Object |
adr |
integer | Slave address (1-127) |
fnc |
integer | Modbus function number |
dX |
integer | Data Bytes |
txt |
string | Binary string data |
e.g.
modbus.tx(dp, 1,3, 0,1, 0,2) -- read two registers from reg 0001