CLI arguments
--host
,-h
address of the machine hosting modbus server--port
,-p
port on which modbus server is listening, by default502
--proto
,-P
protocol to be used, possible options areudp
ortcp
, by defaulttcp
--headless
,-H
if set, given--command
will be executed after successful connection, it's result will be printed to stdout and application will exit--command
,-c
command to be executed in headless mode
commands
# write coils wc A C1 C2 ... Cn
# write holding registers wh A R1 R2 ... Rn
where:
A
is address on which writing should startC
is coil value1
or0
that should be setR
is 16-bit register value that should be set, hexadecimal format is supported with prefix0x
# read coils rc A N
# read descrete coils rd A N
# read input registers ri A N
# read holding registers rh A N
where:
A
address on which reading should startN
number of registers or coils to read