How do you evaluate the "RUN / STOP" mode of the CPU via an HMI operator panel?
There are different ways of evaluating the "RUN / STOP" operating mode of a CPU.
System diagnostics is integrated by default in the firmware of the CPU S7-1500 and works independently of the cyclic user program.
- S7-1200 and S7-1500 controllers
- Basic Panel, Comfort Panel, KTP Mobile Panel
The following example uses the system function "GetPLCMode" and the area pointer "Coordination" for evaluating the "RUN/STOP" mode of the CPU. No special knowledge is necessary.
- The "RUN/STOP" mode of the PLC is queried via the HMI system function "GetPLCMode".
- To have the querying run cyclically and automatically, the "life bit" of the panel is evaluated via the "Coordination" area pointer. The "life bit" toggles between "0" and "1" in the cycle of 1 second independently of the status of the PLC.
- The system function "GetPLCMode" is called each time the value of the "life bit" tag changes. The system function outputs an
"integer value" as a result.
4 = PLC in STOP
8 = PLC in RUN
- The PLC status is output via a text list depending on the result.
The PDF document gives a brief description of all the relevant settings.
Documentation (590,6 KB)
The ZIP file includes two sample projects
(Code 1: S7-1200 and KTP1200 Basic. Code 2: S7-1500 and TP1200 Comfort).
109481628_PLC_Status_WinCC_TIA_CODE.zip (26,9 MB)