Hello!
I’m query coils on 2 modbus hosts.
One give me the correct values.
The other give me all coils “0” if the first coil is “0”
and if the first coil is “1” the host responds with “1” for the first coil and the rest of the coils with “0”.
here are the values by a “modbus-query-tool”:
values: 1 (ad 00056): 0 2 (ad 00057): 0 3 (ad 00058): 1 4 (ad 00059): 0 values: 1 (ad 00000): 0 2 (ad 00001): 0 3 (ad 00002): 1 4 (ad 00003): 1
and here the complete telegraf-config with results:
[[inputs.modbus]]
name = “test_bad”
slave_id = 200
controller = “tcp://10.0.0.222:502”coils = [
{ name = “Coil_1” , address = [56]},
{ name = “Coil_2” , address = [57]},
{ name = “Coil_3” , address = [58]},
{ name = “Coil_4” , address = [59]},
][[inputs.modbus]]
name = “test_good”
slave_id = 1
controller = “tcp://10.0.0.113:502”coils = [
{ name = “Coil_1” , address = [0]},
{ name = “Coil_2” , address = [1]},
{ name = “Coil_3” , address = [2]},
{ name = “Coil_4” , address = [3]},
]Starting Telegraf 1.17.0
modbus,host=test,name=test_good,type=coil Coil_1=0i,Coil_2=0i,Coil_3=1i,Coil_4=1i 1611599581000000000
modbus,host=test,name=test_bad,type=coil Coil_1=0i,Coil_2=0i,Coil_3=0i,Coil_4=0i 1611599581000000000
Coil_3 (addr 58) should be “1”
here are 2 wireshark packets for each host:
test.pcapng.gz (505 Bytes)