blewis9991
I am just starting with OpenPLC and have searched for a pi project to read a modbus sensor without success. I have a Siemens Logo!Soft PLC reading values from an XY-D02 temperature sensor, so I know the hardware is working. I want to switch to OpenPLC and the pi 5 because it seems to have a lot more functionality. But I can't find a simple project to do so. If someone can give me a link or point me in the right direction as a starting point I would be grateful. Thank you for this forum.
Reply 0 0
fg71
If you search in this forum post from me, you could find instruction how to install OpenPLC_v3 on RPi5
In short you need to update the OS, some libraries and include latest version of WiringPi. (pigpio do not work with RPi5)
Reply 0 0
thiagoralves
You don’t need to make changes to OpenPLC if you only plan to use Modbus. The changes @fg71 mentioned are for using the Raspberry Pi GPIO pins. You can refer to this video for an example on how to use Modbus: https://youtu.be/dQ8GcfpGDuA?si=7hEpm7bpaJNKUbi7
Reply 1 0
blewis9991
You don’t need to make changes to OpenPLC if you only plan to use Modbus. The changes @fg71 mentioned are for using the Raspberry Pi GPIO pins. You can refer to this video for an example on how to use Modbus: https://www.youtube.com/watch?v=dQ8GcfpGDuA
Thank you very much, that helped alot.
Reply 0 0
blewis9991
I worked through the video and can follow this setup for DI, DO. But I have looked without success to find how to read analog/temperature values using OpenPLC. I can see how to setup the Slave Addresses for reading and writing following your example. But I can't see how to implement the actual read in the PLC editor. There are a lot of python scripts etc to do this but I am interested in using just OpenPLC ladder logic or function blocks if possible. I found one that was done 4 years ago, but there is no explanation on what is being done although it helped somewhat. He is using tools that he doesn't explain there purpose, where he got them or how it fits with the end objective. Is there any further tutorials you could direct me to please?

OpenPLC - modbus - read + write. P1 and p2

Reply 0 0
thiagoralves
Analog inputs go to %IW location. Just map your variable to the appropriate %IW location and use the in your logic
Reply 1 0
Reply