I have a few questions that I think you can answer for me to make sure I am have followed the right steps:
1.- Is it at all possible that a Revpi Connect+ slaves a Revpi Connect using the RS485 ports on both?
2.- I am using the Connect+ as a Master and the Connect as a slave.
3.- My cable is two-wire like the following (+) -> (+) and (-) -> (-):
See image
4.- My configuration on the slave: I had to change the device path from /dev/ttyUSB0 to /dev/ttyRS485 but also noticed that the file named as ttyRS485 is a link with target ttyUSB0, which doesn't make sense to me. Of course I activated the RTU Slave service on the slave and the Master Service on the Master. I have tried 1 and 2 for the slave addresses without luck.
5.- On my master and extended data I have tried several combinations of addresses and Modbus function codes (Read and Write) but never succeeded to get any readings.
(Here I was supposed to paste two more images but the system would not let me. I will try to add them on a reply or edition of this issue. These images show my enabling of the Modbus Master service on my master Revpi Connect+ and the extended data of my ModbusRTU Master device alongside of my Revpi connect+ )
6.- To force my cyclic readings I am using a python code of yours, modified to fit the case as follows:
Code: Select all
import revpimodio2
def eventfunction(ioname, iovalue):
"""Event function, which is executed when the value changes."""
print("Input {} has value {}".format(ioname, iovalue))
# Instantiate RevPiModIO
rpi = revpimodio2.RevPiModIO(autorefresh=True)
# Catch Ctrl+C signal and exit program clean
rpi.handlesignalend()
# Register input events
rpi.io.Input_Word_1.reg_event(eventfunction)
rpi.io.Input_Word_2.reg_event(eventfunction)
rpi.io.Output_Word_1.reg_event(eventfunction)
rpi.io.Output_Word_2.reg_event(eventfunction)
#rpi.io.Core_Temperature.reg_event(eventfunction)
# Start event processing (program will block here)
print("start mainloop")
rpi.mainloop()
7.- To force value changes I use piTest on both ends.
For example: Suppose I write a value to Output_Word_1 on the master and should be able to read the same change in Input_1 on the slave side.
But nothing's working.
8.- I would like help on how to install a Modbus Master simulator on the Revpi, but I thought It should work the way I got it set up.
9.- Can you help pointing out what's wrong?
Thanks!!!!