Source
key modbus.get rtu //COM1 9600 8n1 248 4 13958 1 uint32 be 0
---
test case"RTU protocol"
in
key modbus.get rtu //COM1 9600 8n1 2 4 13958 1 uint32 be 0
data 0000 0A12
out
endpoint
protocol rtu
port /dev/COM1
baudrate9600
data_bits8
parity N
stop_bits1
slaveid2
function4
address13958
total_count2
result2578
return SYSINFO_RET_OK
---
test case"RTU protocol, default slaveid"
in
key modbus.get rtu //COM1 9600 8n1 4 13958 1 uint32 be 0
data 0000 0A12
out
endpoint
protocol rtu
port /dev/COM1
baudrate9600
data_bits8
parity N
stop_bits1
slaveid1
function4
address13958
total_count2
result2578
return SYSINFO_RET_OK
---
test case"TCP protocol"
in
key modbus.get tcp //localhost 1 3 40000 3 uint8 be 0
data 0DA3 ABCD
out
endpoint
protocol tcp
ip localhost
port502
slaveid1
function3
address40000
total_count2
result'[13,163,171]'
return SYSINFO_RET_OK
---
test case"TCP protocol, default slaveid"
in
key modbus.get tcp //localhost 3 40000 3 uint8 be 0
data 0DA3 ABCD
out
endpoint
protocol tcp
ip localhost