Dom T
Hello,
I am trying to use the Qwiic pHat v2 sensor modules to provide real time environmental data for an OpenPLC testbed. The testbed has multiple slave devices and is also being displayed using ScadaBR. I am going through the process of accessing and reading the sensor information via a python script (Qwiic Kit for Raspberry Pi V2 Hookup Guide - SparkFun Learn) but was wondering whether anyone is more familiar with the hardware and can answer the following questions: 
1 - is there a way for the python script to push the information to the openplc runtime/ScadaBR?
2 - how would the raspberry pi need to be configured in the OpenPLC editor to push the sensor information directly to monitor the sensor outputs without having to use a python script? I feel this would be way quicker, since I can use gpio readall to get the information from the pins as shown below (for example):
IMG_1746.jpg
Thanks in advance for any help!
Reply 0 0
thiagoralves
1. Communication with OpenPLC happens through Modbus. You can use pymodbus on your Python script to read/write OpenPLC registers:  https://autonomylogic.com/docs/2-5-modbus-addressing/
 
2. You can read Raspberry Pi pins directly using the Raspberry Pi hardware layer. Just make sure you select it on the Hardware menu on the web interface. You can check the pins assignment here:  https://autonomylogic.com/docs/2-4-physical-addressing/
Reply 0 0
Reply