/plc2hmi.snap7

Gateway script (python3/snap7) for reducing the communication load on PLC (Siemens S7-300, S7-1200, S7-1500, Vipa) in a situation with many HMI connects.

Primary LanguagePython

plc2hmi gateway script

About

This is a Snap7 based script for:

  • reducing communication load on PLC (Siemens S7-300, S7-1200, S7-1500, Vipa) in the situation with many HMI connection
  • restriction access to PLC.HMI can read/write data only into DBs from the list.

Requirements

Main features

  • automatically loading selected DBs from PLC into memory

  • read DBs data from PLC with a fixed frequency

  • write change from HMI immediately

Known issues

  • server part runs one process for every HMI connection. The big quantity of connections and queries/sec can overload the gateway CPU and overheat it (tested on RPi4 with 8 HMI Siemens). Script can't control timings or "answers count"/sec. You can reduce connection speed on the server interface only.
  • no error answer when you read /write data from DBs with wrong(bigger) offset. You receive the wrong values.

Recomendations

Use in couple with supervisord (http://supervisord.org/).