Write Single Coil
t, txt = mbo:wsc(adr, reg, v, [ms])
t, txt = modbus.wsc(cpo, adr, reg, v, [ms])
Write single coil (Modbus function 5/0x05)
Parameter | Type | Description |
---|---|---|
mbo |
object table | Modbus Object |
cpo |
object | COM Port Object |
adr |
integer | Slave address |
reg |
integer | Register to write |
v |
boolean | Value to write |
ms |
integer | Receive timeout |
Returns | Type | Description |
---|---|---|
t |
table | Values returned |
txt |
string | Remaining string (if any) |
This is a bit access function.