Reading MODBUS holding register
Posted: 20 Jun 2021, 21:53
I have a Connect+ and I'd like to use it as a MODBUS TCP master to read a holding register from a MODBUS device. The holding register is, in this case, 40097. The MODBUS device is connected to my network and from a PC on this network I can read the register -- using a Python script -- and it always has a non-zero value.
I've followed the video and text to set this up:
https://revolution.kunbus.com/tutorials ... r-tutorial
https://youtu.be/VgMXEVCZDIc
In piCtory I've created a virtual device and in the extended data I have:
(I've saved and clicked on 'Reset Driver'.)
When I run
I get
no matter what I try. In fact, even if I remove the Ethernet cable from the MODBUS device, I get the same result, which is odd; also the same if I try any other 'Name', like 'Input_Word_4'. Is this expected behaviour?
I've tried many different things but the result is always the same. I suspect that it's something trivial and I hope someone can point me to the problem so that I could proceed.
(Running latest Buster for RevPi ,and if it matters at all, connected to the network with a WiFi dongle.)
Thanks,
Saar.
I've followed the video and text to set this up:
https://revolution.kunbus.com/tutorials ... r-tutorial
https://youtu.be/VgMXEVCZDIc
In piCtory I've created a virtual device and in the extended data I have:
Code: Select all
1, 1, READ_HOLDING_REGISTERS, 40097, 1, 1000, Input_Word_1
When I run
Code: Select all
piTest -r Input_Word_1
Code: Select all
2 Byte-Value of Input_Word_1: 0 dez (=0000 hex)
I've tried many different things but the result is always the same. I suspect that it's something trivial and I hope someone can point me to the problem so that I could proceed.
(Running latest Buster for RevPi ,and if it matters at all, connected to the network with a WiFi dongle.)
Thanks,
Saar.