Hello Nicolai
Many thanks for suggesting that I look into the log files and those registers. That gave me new ways to debug what I'm experiencing.
Code: Select all
sudo journalctl -u pimodbus-master.service
The log file indeed gave an error for reading the holding registers that I specified (40096/7 and others). This was a good clue.
gave an error code '2' , which here
https://revolution.kunbus.com/tutorials ... rect=en_US
told me that the I have an 'ILLEGAL DATA ADDRESS'. Another clue.
There were two things that 'threw me off' trying to debug this:
[1] When I run a Python script on the RevPi (and on a PC on the network) that uses pymodbus
Code: Select all
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
and that reads this range of addresses, it works just fine and I get non-zero values on some registers. I had assumed that it would be possible to read the same registers with the piCtory/piTest setup.
[2] When disconnecting the Ethernet cable from the MODBUS peripheral the data shown by piTest continues to be displayed as if nothing had happened.
As to point [1]:
I would still expect that reading holding registers in that range would work. I'm using the TRi nano-10 for testing
https://triplc.com/nano10.htm
and it is certainly possible that I misunderstood something.
As to point [2]:
I think that this might be a usability/functional issue that needs to be addressed. If there's no reading -- as shown in the pimodbus-master.service log -- then there should be no reading displayed while running piTest. I would think that an error should be returned, not the previously seen value.
As for now, I'm able to read and write registers in the 1-1000 range (problem [2] is still there even when things do work) which lets me cautiously proceed with my development. However, it would be good to know more about what can be done about both points above.
Thanks again,
Saar.