supriyo
Hi,
I'm using a raspberry pi as a master device and I want to use another raspberry pi as a slave device. And I have already installed open_plc runtime in both master and slave devices. Now what should I put as "slave id" in master rpi runtime when I'm adding another rpi as slave device?
Reply 0 0
thiagoralves
Use Modbus TCP, not RTU. On Modbus TCP the slave id is ignored
Reply 0 0
supriyo
Thank you so much for your response Thiago.
I have tried with Modbus TCP and I have put slave id=0 with the slave ip address. 
 
Now I think the slave is connected as the runtime doesn't throw any error. But the program (which is a LL circuit in the openplc editor) is not executed.
 
My program is very simple. So there is a push button (PB) switch and a LED. PB is connected to master Rpi with location %QX0.0 (pin 3) and LED is connected to slave Rpi with location %QX100.0 (pin 8). I just want to turn on the led. 
 
Am I doing it right or I'm missing something?
Reply 0 0
thiagoralves
What are you master dashboard logs? How is the slave configured in the master? What are your slave dashboard logs? What program is running on your slave? 
Reply 0 0
supriyo
  1. I'm attaching a screenshot (Master_logs.png) of the master dashboard logs.
  2. I'm attaching another screenshot (Slave_configuration_in _master.png) of the slave configuration in master.
  3. Slave dashboard log's screenshot is also attached (Slave_logs.png).
  4. I'm running a blank program in the slave device which was already present in the runtime.
Also I'm attaching a screenshot (Open_plc_editor_program.png) of the ladder logic program which I'm trying to exicute.
 
Kindly let me know if I'm missing something.
Reply 0 0
thiagoralves
You mapped PB to %QX0.0. This is an output, not an input. You can only toggle %QX if you send a Modbus write coil command to the master, as that output is not connected to anything. If you plan on using a physical push button, you must use %IX. 
Reply 0 0
supriyo
Yes I mapped PB to %QX0.0 because I'm using Radzio Modbus master simulator. 
 
Also I tried with a physical push button switch and mapped PB to %IX0.0 but it's also not working. 
Reply 0 0
thiagoralves
Have you enabled the Raspberry Pi driver on the Hardware tab? Can you see the signal going through on the Monitoring tab?
Reply 0 0
supriyo
Yes I've enabled the Rpi driver on hardware tab for both master and slave Rpi.
 
I can see the signal going through on the monitoring tab. Suppose if I change the input status of the Modbus simulator then coil status is changing in the monitoring tab. But it's not reflecting on the breadboard led.
Reply 0 0
thiagoralves
Update the blank program on the slave to just include a %QX0.0 located variable. The body of the program could be something useless like setting a local variable (not located) to 1. Then you will be able to monitor the %QX0.0 on the slave at the monitoring tab and see if that is going high as well.
Reply 0 0
supriyo
Okay I'll try that and will let you know.
Reply 0 0
supriyo
I have tried what you suggested but it's not working. And yes the %QX0.0 is going high but the led on the breadboard is not turning on.
Reply 0 0
thiagoralves
So either you have a raspberry pi 5 that doesn’t work with OpenPLC or your wiring is incorrect
Reply 0 0
supriyo
Sorry but it was big mistake from my side. The 'remote access GPIO pins' of the raspberry Pi were disabled. I have enabled it and now it's working fine.
 
Thank you for all your help. I have just started using Open Plc and it is awesome.
Reply 0 0
Reply