Resolving S7-1200 RUN/STOP Status Display on TIA Portal HMI

David Krause17 min read
S7-1200SiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview: Surface S7-1200 RUN/STOP on the HMI

Operators of an S7-1200-driven machine line need at-a-glance confirmation that the CPU is executing the user program rather than halted in STOP. Siemens WinCC TIA Portal exposes the operating state through the system function GetPLCMode, which returns an integer that the panel maps to a textual label inside a symbolic IO field. The mechanism requires no ladder code in the PLC; it relies on an HMI tag whose value is refreshed by the runtime through the configured S7 connection.

The most common failure reported on S7-1212C, S7-1214C, and S7-1215C builds is a blank symbolic IO field that never toggles between RUN and STOP, even though the project compiles without errors and downloads to the panel. The fault almost always traces to tag-table placement rather than to the IO field itself: when the PLC status tag is declared in a generic tag table without the dedicated PLC_Status structure that the FAQ example uses, the runtime cannot subscribe to the system status broadcast and the field renders empty.

This article walks through the full commissioning path - from prerequisites and S7 connection setup, through tag configuration and symbolic IO field wiring, to verification against the physical LEDs and the diagnostic buffer.

Prerequisites and Component Selection

Before configuring GetPLCMode, verify that every component in the chain supports the system function and that the engineering release used to compile the project can target the runtime firmware on both the panel and the CPU. The reference FAQ 109481628 ships with a TIA V15 example; the same procedure applies on TIA V16 and V17 with the migration steps covered later in this article.

Component Source Mentioned Notes
S7-1212C DC/DC/DC Yes (FAQ test build) Compact starter CPU used to verify the reference FAQ example
S7-1214C DC/DC/DC Yes (replication target) Mid-range CPU with 14 onboard I/O
S7-1215C DC/DC/DC Yes (replication target) Mid-range CPU with 21 onboard I/O and two PROFINET ports
KTP700 / KTP1200 Basic PN Implied by HMI tags folder WinCC TIA Basic runtime targets
TP1500 / TP1900 Comfort Compatible runtime WinCC TIA Comfort runtime targets
TIA Portal V15 Yes Reference example ships with the FAQ
TIA Portal V17 Yes Migration path required from V15 example
Note: Download the FAQ 109481628 first and compare its project tree against yours before debugging. Engineers who only have TIA V17 should open the example in TIA V15 first to avoid losing the dedicated PLC_Status tag table during a forward migration.

How GetPLCMode Reports Status

The HMI runtime reads the operating state of the S7-1200 through the diagnostic portion of the S7 connection. GetPLCMode writes one of three integer values to the target HMI tag, as documented in the WinCC TIA Portal online help:

Return Value CPU State Typical Front-Panel LED Pattern
0 RUN RUN/STOP green, ERROR off
1 STOP RUN/STOP solid yellow, MAINT may blink
2 Startup / halted / unknown RUN/STOP flashing yellow, ERROR may blink

The target tag can be a standard HMI tag of data type Int or DInt. Declare it inside the HMI tags folder of the HMI station, not inside the PLC's default tag table. The runtime reads the tag through the configured connection only if it is registered as a server-side HMI tag pointing to the S7-1200 connection. PLC-side declarations are ignored by the panel, which is the root cause of a symbolic IO field that compiles cleanly but renders blank.

The function does not require any DB allocation on the CPU. It does not consume application memory and does not interfere with scan time. The single CPU resource involved is the system-status broadcast, which is generated automatically on every mode change and on every diagnostic event.

S7 Connection Configuration

The symbolic IO field receives its value through an S7 connection between the panel and the CPU. A misconfigured connection is the second most common cause of an apparently non-functional field. Verify the connection before debugging the tag.

  1. Open Devices & Networks in the project tree.
  2. Select the S7 connection that links HMI_1 to PLC_1.
  3. In Properties > General > Interface, confirm the panel is using its PROFINET interface and the CPU is using the interface the panel is physically patched to.
  4. In Properties > General > Address details, confirm the CPU's PROFINET IP address matches the address the panel will reach at runtime (default 192.168.0.1 on the S7-1200 PROFINET port).
  5. In Properties > General > Connection mechanism, ensure the connection is set to S7 communication with the rack/slot pointing to the CPU (rack 0, slot 1 for S7-1200).
  6. Compile the connection and resolve any warnings about unresolved subnets.
Critical: When the CPU is swapped via Change device (for example, S7-1212C replaced with S7-1214C), the S7 connection can retain the original slot index and fail to establish at runtime even though the project compiles cleanly. Always delete and recreate the connection after a device change.

HMI Tag Configuration - The Critical Step

This is the most common source of a non-functional symbolic IO field. The user-facing symptom in the field report - "in my project this PLC status tags are declared in a normal tag table on HMI tags folder" - directly contrasts with the FAQ example, which uses a dedicated PLC_Status tag table inside the HMI station. The fix is to mirror the FAQ project structure.

  1. In the project tree expand the HMI station, then expand HMI tags.
  2. Right-click HMI tags and choose Add new tag table. Name it PLC_Status exactly as the FAQ example shows.
  3. Open PLC_Status and add a tag PLCMode of data type Int.
  4. Select PLCMode. In Properties > General > Connection, choose the S7-1200 connection. If no connection exists, create one via Connections in the HMI station root.
  5. Set Acquisition mode to Cyclic continuous with a 1 s cycle so the value refreshes even on screens without an event trigger.
  6. Set Acquisition cycle to 1 s. Lower values are possible but consume more PROFINET bandwidth.
  7. If you need an auxiliary tag for diagnostics, add PLCMode_text of type WString[80] in the same table.
  8. Compile the HMI project (HMI_1 > Compile > Software (rebuild all)).
Critical: Do not declare PLCMode inside the PLC's Default tag table. The name collision confuses the compiler and the HMI runtime will not subscribe to a PLC-side tag for system status. If your project tree shows the tag under PLC_1 > PLC tags > Default tag table, the symbolic IO field will compile but stay blank. The FAQ example avoids this by hosting the tag exclusively on the HMI side.

Configuring GetPLCMode in the Scheduler

The function must be triggered periodically. The standard approach is to attach it to a screen event or to a scheduled task that fires every 1-2 seconds. Without a trigger, the value never updates.

  1. Open the HMI screen that should host the symbolic IO field.
  2. In Properties > Events > Loaded, add a new function list and call System functions > GetPLCMode.
  3. Wire the output of GetPLCMode to the HMI tag PLCMode.
  4. Optionally schedule GetPLCMode via Schedules > Tasks > Add new task with a 1 s trigger so the value refreshes even on screens without the event trigger.
  5. Compile and download the HMI project.

On Basic Panels the scheduler is limited; use the screen Loaded event on the root screen and rely on the connection keep-alive to refresh value on child screens. Comfort and Unified Panels can poll at 500 ms without noticeable load. On Unified Panels, GetPLCMode is also accessible through the JavaScript API via the runtime equivalent, which simplifies deployment on PC-based HMI systems.

Symbolic IO Field Configuration

  1. Drag a Symbolic IO field onto the screen from the toolbox.
  2. In Properties > General > Process value, select the HMI tag PLCMode.
  3. Set Mode to Output for read-only display, or Input/Output if you also want to use the field for status acknowledgement.
  4. Under Appearance, disable Border if a clean indicator look is desired.
  5. Under Text list, assign the text list defined in the next section.

Text List for State Visualisation

Bind a text list to the symbolic IO field so that the integer becomes a human-readable state. The text list is also where colour coding is applied.

  1. In the HMI project tree right-click Text lists and choose Add new text list.
  2. Name it PLCStateList and set Selection mode to Value range.
  3. Add the following entries:
Value Text Back Colour Font Colour
0 RUN Green (#00A000) White
1 STOP Red (#C00000) White
2 STARTUP / FAULT Amber (#FFC000) Black
  1. Open the symbolic IO field properties. Under Text list, assign PLCStateList.
  2. Compile the HMI, then download to the panel.

PLC Mode Selector vs Software Switch

The S7-1200 has two ways to enter STOP: physically toggling the mode selector on the CPU front, or issuing a STP instruction from the user program. GetPLCMode returns 1 in both cases. The distinction matters during commissioning:

Trigger Selector Position After CPU Behaviour GetPLCMode Value Field Display
Mode selector to STOP STOP Halts execution; outputs to safe state 1 STOP
Mode selector to RUN RUN Resumes execution if no fault 0 RUN
Software STP from program RUN Halts execution but selector stays in RUN 1 STOP
Diagnostic event (module pulled) STOP or RUN CPU may enter STOP or stay in RUN with MAINT 2 or 1 STARTUP / FAULT or STOP

Use this table when troubleshooting. If the HMI label says STOP but the selector is in RUN, the cause is a software-triggered stop or a diagnostic event, not operator intervention.

Status LED Cross-Reference

The HMI display must agree with the physical LEDs on the CPU front. The S7-1200 status indicators follow the patterns described in the S7-1200 System Manual, Status LEDs section:

RUN/STOP LED ERROR LED MAINT LED Operating State GetPLCMode Value
Green, solid Off Off RUN 0
Yellow, solid Off Off STOP (user-requested) 1
Yellow, flashing Off Off STOP (internal error) 1
Yellow, flashing Red, flashing Off Fault - diagnostic buffer entry 2
Off Red, flashing Off Firmware update or memory reset in progress 2
Green, solid Off Yellow, solid Maintenance demanded, still RUN 0
Green, solid Red, flashing Off Peripheral fault, still RUN 2
Off Off Off No power or CPU defective 2

If the HMI label and the LED do not agree, the problem is in the connection or the tag wiring, not in the panel rendering. Re-check the Connection setting of PLCMode; the most common cause is that the tag points to a non-existent CPU slot or to a CPU that has been replaced without re-downloading the connection configuration.

Diagnostic Buffer as Backup Verification

If the HMI label disagrees with the LED pattern, the next debugging step is the CPU's diagnostic buffer. Open Online & Diagnostics on the CPU, select Diagnostic buffer, and inspect the recent entries. Each mode change generates a diagnostic event with a timestamp. The buffer is read-only and survives power-cycle, so it is the authoritative record of mode transitions.

For panel-side verification, the runtime writes a system log entry every time GetPLCMode returns a value that differs from the previous sample. To enable the log, open Runtime settings > Logs on the HMI station and add a new log named PLC_Status with the tag PLCMode as the source. After a few mode toggles, export the log and confirm the integer sequence matches the operator actions.

Network and IP Configuration for HMI-PLC Link

The S7 connection used by GetPLCMode is a standard PROFINET link. Misconfigured IP addresses are a frequent cause of a panel that compiles but shows no data. The default addressing scheme for an S7-1200 with a single PROFINET port is:

Device Default IP Subnet Mask Notes
S7-1200 CPU PROFINET port 192.168.0.1 255.255.255.0 Set in Device configuration > PROFINET interface
KTP700 / KTP1200 Basic PN 192.168.0.10 255.255.255.0 Set in Control Panel > Network & Dial-up Connections on the panel
TP1500 Comfort 192.168.0.20 255.255.255.0 Same as Basic PN, accessed via Control Panel
Engineering PG/PC 192.168.0.100 255.255.255.0 Use a static address to avoid DHCP churn

After IP changes, restart the panel and the CPU to flush the ARP cache. GetPLCMode is sensitive to dropped connections - if the link is intermittent, the field freezes at the last value rather than displaying a fault indicator. To detect link loss, bind a separate diagnostic tag to the connection status using the runtime equivalent of Connections > Online.

Maintenance Mode and GetPLCMode Interaction

When the S7-1200 enters maintenance mode (for example, after a wire break on an analog input), the CPU may remain in RUN with the MAINT LED lit. In that case GetPLCMode returns 0 and the HMI label displays "RUN" in green. To surface maintenance demands to the operator, add a second tag that reads the diagnostic status of the most critical module and bind it to a separate text list. The combination of GetPLCMode and module-level diagnostics gives the operator a complete picture.

If the HMI must distinguish "RUN with no faults" from "RUN with maintenance demand", set the symbolic IO field to Input/Output mode and bind the background colour to an animation that references both PLCMode and the maintenance tag. On Comfort Panels the animation is configured through Animations > Appearance; on Unified Panels the equivalent script is written in JavaScript and bound to the field's style property.

Troubleshooting Matrix

Symptom Likely Root Cause Corrective Action
Symbolic IO field is permanently blank PLCMode tag declared in PLC default tag table instead of HMI tags Move tag to HMI_1 > HMI tags > PLC_Status
Symbolic IO field is blank but HMI has a dedicated PLC_Status table Function not triggered - no scheduler and no screen event Attach GetPLCMode to a 1 s scheduler task or to the root screen Loaded event
Field shows raw integer 0 or 1 with no text No text list assigned Assign PLCStateList under Properties > Text list
Field shows RUN when CPU is in STOP Acquisition cycle on the HMI tag is set to "On demand" instead of a fixed cycle Set Acquisition mode to Cyclic continuous with 1 s cycle
Compile error: tag not found Connection not assigned to the HMI tag Open Properties > Connection on the tag and select the S7-1200 connection
Field frozen after firmware update Old HMI image incompatible with new CPU firmware Update the HMI image to match the TIA Portal version used for the firmware update
Field shows STOP permanently after power cycle CPU completed startup but stopped because of missing hardware configuration download Download the device configuration to the CPU, then switch to RUN
Replication worked on S7-1212C but not on S7-1214C/1215C Connection points to the original CPU slot; topology not updated after device change Use Devices & Networks > Change device to re-target the S7 connection
Field shows RUN but MAINT LED is yellow Maintenance mode not surfaced through GetPLCMode Add a second tag bound to module diagnostic status; combine via animation
Field value flickers between 0 and 2 CPU repeatedly transitioning STOP-RUN because of a programming error Inspect diagnostic buffer for the repeating fault; correct the program and download
Field shows correct value on screen A but not on screen B Screen B does not call GetPLCMode on Loaded event Attach the function call to every screen's Loaded event, or rely on the scheduler task
Field value lags by 10+ seconds Acquisition cycle set too long (default 5 s on some Comfort Panels) Reduce Acquisition cycle on the HMI tag to 1 s
Field stays at last value after CPU power loss Panel does not detect link loss; no connection-status diagnostic bound Bind a connection-status tag and add a "NO LINK" text list entry

TIA Portal Version and Firmware Compatibility

The reference FAQ 109481628 ships with a TIA V15 example project. To migrate to TIA V17:

  1. Open the project in TIA V15, then close without modification.
  2. Open the project in the target TIA Portal release (V16 or V17). The portal will offer an upgrade.
  3. Accept the upgrade. The portal recompiles the HMI tags and schedules; no manual rewiring is required when only the HMI tag table is involved.
  4. Re-target the CPU if the original project referenced an S7-1212C but your hardware is an S7-1214C or S7-1215C. Use Devices & Networks > Change device.
  5. Compile the upgraded project and resolve any version-related warnings.
  6. Download the project to the CPU and the panel.

The same procedure works on S7-1212C, S7-1214C, and S7-1215C. Consult the S7-1200 system manual for the exact firmware revision that supports GetPLCMode on your specific CPU order number; the function is part of the standard WinCC TIA system-function library and is supported on every S7-1200 CPU shipping today.

If the source project is in TIA V17 but you only have TIA V15, downgrade is not supported by the engineering tool. Re-import the station description as a generic station, then manually recreate the PLC_Status tag table and the symbolic IO field. The procedure is identical and takes about 10 minutes per panel.

Verification Procedure

  1. Compile the HMI project (HMI_1 > Compile > Software (rebuild all)). Resolve any warning regarding unresolved HMI tags before continuing.
  2. Download the HMI project to the panel. Use Ethernet and set the panel IP to match the configuration in the project.
  3. Download the PLC project to the CPU if it has not been downloaded already.
  4. Toggle the CPU mode selector to STOP. The symbolic IO field should switch to "STOP" within two seconds. The RUN/STOP LED should change from green to solid yellow.
  5. Toggle the selector back to RUN. The field should switch to "RUN" within two seconds and the LED should turn green.
  6. Trigger an error condition (for example, unplug a configured module while the CPU is in RUN to force a diagnostic entry). The field should switch to the "STARTUP / FAULT" text within two seconds and the ERROR LED should flash red.
  7. Open Online & Diagnostics on the CPU and confirm the diagnostic buffer entry timestamp matches the moment of the toggle. This proves the panel is reading the same source as the engineering tool.
  8. Cycle power on the CPU. Confirm the field returns to "RUN" or "STOP" within 10 seconds of the CPU completing startup.
  9. Cycle power on the panel. Confirm the field recovers its value without requiring a project re-download.

If any verification step fails, return to the Troubleshooting Matrix and walk down the list of corrective actions. The most common step that fails on first commissioning is the device-change connection reset; deleting and recreating the S7 connection typically resolves it.

Frequently Asked Questions

Why does the symbolic IO field stay blank even though the HMI project compiles cleanly?

The tag that GetPLCMode writes to must be declared inside a dedicated table under the HMI station's HMI tags folder - typically named PLC_Status to mirror the FAQ example. If the tag is inside the PLC's default tag table or inside a generic HMI tag table without the right connection, the symbolic IO field renders blank. Move the tag declaration to HMI_1 > HMI tags > PLC_Status, assign the S7 connection in the tag properties, recompile, and download.

Why did the project replicate on S7-1212C but not on S7-1214C or S7-1215C?

The HMI-to-PLC connection points to a specific CPU slot inside the device configuration. When the CPU was swapped via Change device, the connection often retains the original slot index. Open Devices & Networks, delete the old connection, and create a new S7 connection that targets the replacement CPU. Recompile and re-download after the change.

What integer values can GetPLCMode return?

0 = RUN, 1 = STOP, 2 = startup, halted, or unknown state. Map these to a text list of length three to cover all observable LED patterns. The exact mapping is documented in the WinCC TIA Portal online help under System functions > GetPLCMode and matches the patterns listed in the S7-1200 status LED documentation.

Can I trigger GetPLCMode only once at screen load?

Yes, on screens without further user interaction the screen-loaded event is sufficient. On root or home screens, however, the event fires only at navigation time; for continuous status, add a scheduler task that calls GetPLCMode every 1 second. Without a periodic trigger, the displayed state can become stale after a CPU mode change while the screen is open.

Does the same procedure apply to Unified Panels and Comfort Panels?

Yes, both panel families expose GetPLCMode under System functions. Comfort Panels are supported from TIA V14; Unified Panels require TIA V16 or later. The tag placement rule under HMI tags > PLC_Status and the LED cross-reference against the CPU front are identical across families.

Back to blog