tobby
Hi, I am working on a project about RPI(server) to RPI(slave) connect with Modbus TCP recently. Both RPIs are using WIFI. However, I can't control slave output through server. There are connection information about server and slave. Is there something wrong I failed to notice?

1. Server Runtime Logs:

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Device rpi_slave is disconnected. Attempting to reconnect...
Warning: Persistent Storage file not found
Connected to MB device rpi_slave
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command

2. Slave Runtime Logs:

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Warning: Persistent Storage file not found
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Server: Client accepted! Creating thread for the new client ID: 15...
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Server: waiting for new client...
Server: Thread created for client ID: 15
Issued stop_pstorage() command
Reply 0 0
thiagoralves
From the logs everything seems to be working fine. Both master and slave are talking to each other. Perhaps the PLC program on your slave device is interfering with the Modbus commands. Either that or your slave device configuration on the master PLC is incorrect
Reply 0 0
tobby
Understood.
If I'm going to use switch of master to control led on/off of slave, is there something wrong with my program?
Sorry for new to use OPENPLC Modbus.
Thanks!
Reply 0 0
thiagoralves
Your addressing on the slave device is incorrect. From the slave perspective, the master is writing directly to %QX0.2 (the slave %QX0.2 appears as %QX100.2 on the master). So in essence, the program on the slave device should be blank. If you manipulate %QX0.2 on the slave ladder logic, the ladder logic program will overwrite the master commands, as it takes preference over network protocols.
Reply 0 0
tobby
Modify the program on the slave device to be blank is work!
Thanks for a big help!
Reply 0 0
Reply