Wednesday, April 16, 2025

Time100: The Most Influential People of 2005 | Time

 TIME100: The Most Influential People of 2025 | TIME

Connecting PLC with python

One can connect PLC with following two protocol if the PLC supports the protocol of course.

1) Modbus (RTU or TCP)

2) CIP

For above two protocols, I tried several but following two packages are good for me in many ways:

1) Modbus - pymodbus version 3.9.1

2) CIP - pycomm3 version 1.2.14

My application simply connect the Effluent Water Quality Monitor (mainly pH Value) System to obtain sensor pH values every 5 seconds. And give this value to AB CompactLogix PLC, so that it can provide this value to HMI in Ignition Edge by Inductive Automation. The data collection python code is running on Raspberry Pi 4 node inside protective enclosure with fan. As one can guess, there is Modbus module connecting Water Quality Monitoring system thru RS485 connection (pymodbus) and passing this value to AB CompactLogix through CIP protocol (pycomm3) over Ethernet/TCP connection. Works great! And I was so impressed by the stability of Raspberry Pi 4B and Modbus module. Almost all failures are caused by, in fact, main router (of course its not enterprise level router) even though the failure occurs 2-3 time a year. I have been running this for three year and I just change the fan for enclosure one time.

I will give more details on the configuration later.

LSTM Replaces PID Control

LSTM Replaces PID Control  from  APMonitor.com