Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 109481628, Entry date: 09/13/2019

How do you evaluate the "RUN / STOP" mode of the CPU via an HMI operator panel?

  • Entry
  • Associated product(s)
Evaluating the RUN / STOP mode of the CPU via the system function "GetPLCMode".

There are different ways of evaluating the "RUN / STOP" operating mode of a CPU.

Example 1

System diagnostics with S7-1500 and TIA Portal, Entry ID: 68011497
System diagnostics is integrated by default in the firmware of the CPU S7-1500 and works independently of the cyclic user program.

Example 2
Evaluation via the system function "GetPLCMode".

Supported hardware
  • 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.

Program sequence

  • 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.

Configured plant picture

Pic 01

Program details
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).
 Registrierung notwendig  109481628_PLC_Status_WinCC_TIA_CODE.zip (26,9 MB) 

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.