Reem
Hi ,
I chose Raspberry Pi driver in the "Hardware" section. I understood from the discussion in this post that we should consider the OpenPLC as Modbus master in this case. I studied the Raspberrypi.cpp file inside the hardware_layer folder but I didn't find the Modbus slave communication code. Can you please inidcate its location. Thanks!
Quote 0 0
thiagoralves
That post is from several years ago. OpenPLC has a built-in Modbus Master client running independently of the hardware layer. You can add modbus slave devices to the runtime by going to the Slave Devices menu and adding a new "Generic Modbus RTU" or "Generic Modbus TCP".

The code for this modbus client is in /webserver/core/modbus_master.cpp
Quote 0 0
Reem
Thanks dr.Ralves. My question about the Raspberrypi driver, I am assuming it is one of the modbus slave(server) offered by the OpenPLC .Where can I find its modbus connection?
Quote 0 0
thiagoralves
The Raspberry Pi driver has nothing to do with Modubs, neither master or slave. It is only responsible for controlling the GPIO pins on the Raspberry Pi board. Modbus (both master and slave) work independently of the driver selected. The Modbus master code (server) can be found on /webserver/core/modbus.cpp. The Modbus slave code (client) can be found on /webserver/core/modbus_master.cpp.
Quote 0 0
Reem
Thanks a lot for this clarification.
Quote 0 0