Dom T
As the title says, I'm running into the following error in the logs when trying to run a program in the OpenPLC runtime:
"modbus write coils failed on MB device P1AM: response not from requested slave"
I'm unsure how to resolve this error, so any help is appreciated.
 
Additional Info: Raspberry Pi 4 master and a P1AM-100 slave with two additional Arduino slave devices. I followed the instructions from this video to setup to get the P1AM set up as slave. The P1AM has two modules connected to it (isolated relay, 8 outputs in slot 1, input simulator in slot 2). I cleared the GPIO pins and enabled serial RTU before transferring to PLC.
After using the USB programming cable with the P1-AM I disconnected it from the programming computer (Editor on Windows 10) and plugged it in to the Raspberry Pi. The RPi recognizes the device when setup in the runtime and connects when the program runs.
 
Things I have tried:
  • adjusting the baud rate to match the device when found under properties. I used both 9600 (the default for the P1AM when connected to windows 10) and 115200 (same baud rate as the other slave devices I have attached).
  • removing other slave devices
  • changing the variable addressing on the attached slave program
  • changing the slave ID in both the editor and runtime to different numbers
Things that I can try:
  • setup ethernet communication via the ethernet module
  • run the P1AM on a different and freshly imaged raspberry Pi with no other slave devices attached
I attached the P1AM slave program for reference
Thanks in advance!
thiagoralves
In the video I used Modbus TCP. If you're using Modbus RTU you must make sure that when you are programming your P1AM, the settings from the red box below match what you added as slave device on your Raspberry Pi
 
Screenshot 2024-08-20 at 3.34.15 PM.png
Reply 0 0
Dom T
In the video I used Modbus TCP. If you're using Modbus RTU you must make sure that when you are programming your P1AM, the settings from the red box below match what you added as slave device on your Raspberry Pi
 
Screenshot 2024-08-20 at 3.34.15 PM.png
So I did make sure that I had it set up as a generic RTU device in the OpenPLC runtime where the slave ID and Baudrate match. Only other thing that I can think of is the TX pin. Does TX pin of -1 correspond to the transmission pause, or is there another field in the runtime configuration settings that that is associated with?
Reply 0 0
thiagoralves
No, the TX pin -1 means that no pin is used for flow control (which is correct in case of anything but RS485)
Reply 0 0
Dom T
No, the TX pin -1 means that no pin is used for flow control (which is correct in case of anything but RS485)
Ok, that makes sense. So if everything is matching up properly and I'm still getting the same error are there any other things I can check for how I set up the P1AM or the OpenPLC runtime in order to resolve the read error? I had initially thought that the addressing the slave setup program could be the issue but changing around those values did not help. Would manually flipping switches on the input simulation module and checking via RMMS show whether its communicating in some respect?
Reply 0 0
thiagoralves
Try connecting to the P1AM from RMMS. If that doesn’t work then something is wrong with the program or your P1AM
Reply 0 0
Dom T
Try connecting to the P1AM from RMMS. If that doesn’t work then something is wrong with the program or your P1AM
I have tried connecting to it via RMMS and was only successful using RTU vice ethernet. I was able to control my relay coils but wasn't able to see my switches, but I can reasonably assume the flashing via the OpenPLC editor was done properly. I disconnected the programming USB cable from the programming computer side and plugged that into the my openPLC runtime device (Rpi). Initially adding the device stopped my mouse from working, so I had to take off the other two slave devices and tried again. After I got everything "running" I got a connection error in the actual runtime, so I think I reached a limit with slave devices on my one Rpi. I have an SLR R4 that I will try a fresh install and configuration with, so hopefully that decides to co-operate
Reply 0 0
Reply