Configuring M Memory Bits in PCS 7 OS Text Lists (WinCC)

David Krause11 min read
HMI / SCADASiemensTutorial / 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

1. Overview: Why M Memory Bits Disappear from the OS Text List

When configuring a Text list in the WinCC Graphics Designer of a SIMATIC PCS 7 Operator Station (OS), the tag-selection dialog only shows the variables that the OS has imported from the Engineering Station (ES). If you define a plain bit memory address such as M 10.0 in the STEP 7 / SIMATIC Manager symbol table, the dialog returns an empty result. The root cause is that the bit memory address has not been flagged for OS access, so the AS-OS data transfer does not propagate it through the symbol server to the WinCC tag database.

This article documents the field-proven procedure to make M memory bits selectable inside PCS 7 text lists, including:

  • Marking the address with the Operator Control and Monitoring attribute in the symbol table.
  • Compiling the CFC and the OS so the tag is published to the WinCC channel.
  • Wiring a pump duty/standby example with two text values driven by a single M bit.
  • Validating the result in the online WinCC tag manager.
  • Covering fault scenarios such as a 0x022E OS compile error, a missing AS-OS connection, and a mismatch between the symbol table and the CFC instance DB.

The procedure is valid for PCS 7 V8.2, V9.0, V9.1, and V10.0 with S7-300, S7-400, AS 410 (CPU 410-5H), and AS 410 SMART. It also applies to the WinCC Runtime Advanced / Professional targets when those are used as the OS in a TIA-Portal-based PCS 7 V10 project.

2. Prerequisites

Verify the following before starting:

  1. PCS 7 Engineering Station installed with the matching Service Pack (SP) for the OS (e.g., PCS 7 V9.1 SP2). See the official release matrix on the Siemens Industry Online Support portal.
  2. SIMATIC Manager or TIA Portal with the PCS 7 option package installed.
  3. An AS project with at least one CFC chart and a working AS-OS connection (industrial Ethernet / ISO-on-TCP, MAC, or named connection).
  4. The S7 program has been compiled successfully and downloaded to the AS at least once.
  5. WinCC Explorer or WinCC Professional is installed on the OS, and the project is opened on the same ES.
  6. You have administrator rights on the ES so that the OS compile and download can be performed.
Note. M memory bits that you intend to manipulate from the HMI must be located in the non-retentive area of the CPU. Retentive bits are reserved for power-fail recovery and must not be used as operating flags. See the memory-management section of the SIMATIC S7-1200 manual collection (TIA Portal) for the general principles; the same rules apply to S7-300/400 and AS 410.

3. Root Cause: Why a Plain M Bit is Invisible to the OS

PCS 7 enforces a strict separation between the AS-side program (the S7 symbol table and CFC instances) and the OS-side picture system. The OS downloads the tag list from a server-side data set that the ES generates during the OS compile. By default, that data set only contains:

  • CFC block icon structures (CH_DIAG, CTRL, MOT_SPEED, VALVE_ANA, etc.).
  • Shared declarations of the S7 program that are explicitly marked as OS-relevant.
  • Tags derived from the STEP 7 symbol table when their symbol is flagged for Operator Control and Monitoring (German: Bedienen und Beobachten, attribute S7_m_c = true).

An M bit declared without that attribute is treated as an internal scratch flag. It is compiled into the AS, downloaded to the CPU, and freely usable inside the S7 user program, but it is not exported to the OS. The WinCC tag manager therefore never sees it, and the text-list selection dialog in the Graphics Designer filters it out.

The same logic is documented in the SIMATIC PCS 7 Process Control System; Configuration Manual in the section "Creating and Managing the Tag Connection Between AS and OS".

4. Step-by-Step: Marking the M Bit as Operator-Visible

  1. Open the SIMATIC Manager (or the TIA Portal view of the S7 program if you use PCS 7 V10) and navigate to the AS program container.
  2. Open the Symbol Table of the S7 program. The default container is S7 Program(1) > Symbols.
  3. Add a new entry. Use a descriptive symbol name, for example PUMP_DUTY_SEL:
Symbol Address Data Type Comment
PUMP_DUTY_SEL M 10.0 BOOL Pump duty/standby selector driven from HMI
PUMP1_RUN M 10.1 BOOL Run feedback for pump 1
PUMP2_RUN M 10.2 BOOL Run feedback for pump 2
  1. Right-click the row PUMP_DUTY_SEL and choose Special Object Properties > Operator Control and Monitoring. The dialog also exposes this flag under the column "Operator C&M" when the symbol table is in the detailed view.
  2. Confirm with OK. The symbol now carries the attribute S7_m_c = 'true' in the symbol export file (*.seq).
  3. Repeat the flag for every additional M bit you want to expose (the run feedbacks in the example table).
  4. Save the symbol table (Ctrl+S). SIMATIC Manager asks whether the change should also be propagated to the OS; click Yes.
Important. If the OS is open on a different station, the propagation only updates the local project. Use OS Project Editor > Server-Data > Update on the OS to pull the change.

5. Step-by-Step: Compiling the CFC and the OS

Marking the symbol is necessary but not sufficient. The tag only lands in the WinCC database after a clean OS compile. The recommended sequence is:

  1. In the component view of the AS, right-click the chart folder that contains the CFC and choose Charts > Compile and Download Objects > Compile (only). The CFC compiler rebuilds the chart-internal wiring and updates the block-icon structure that the OS uses to generate the picture tree.
  2. Switch to the OS in the plant view. Right-click the OS server or the OS client (the entity that owns the picture in question) and choose OS > Compile.
  3. In the OS compile dialog, set the scope to Complete compilation with picture tree. The compile generates a new *.ldf (link data file) and pushes the new tag into the WinCC internal database.
  4. After the compile, perform a Delta Download to the OS runtime. For a single tag, a full download is not required, but it is acceptable for first-time commissioning.

You can also use the PCS 7 CFC/SFC Library command line on the ES to script the OS compile:

cmd /c "C:\Program Files\Siemens\Automation\PCS7\s7wb53a\s7wb53a.exe" -compile -os=OS01 -scope=full

6. Step-by-Step: Building the Text List in WinCC

  1. Open the WinCC Explorer on the ES (or directly on the OS for local editing).
  2. Navigate to Graphics Designer > your picture > open. Double-click the text list object (or insert Smart Objects > Text List).
  3. In the configuration dialog, set the List type to Range or Bit depending on the application. For a single bit driving two states, use the Bit type with one bit position.
  4. Click the Selection button next to the Tag field. The tag-selection dialog now lists the M bit because the previous OS compile published it.
  5. Pick PUMP_DUTY_SEL. The dialog confirms the address M10.0 and the data type BOOL.
  6. Define the two text entries:
Value (Bit Pattern) Text Description
0 Pump 1 (Duty) Pump 1 is the running lead pump
1 Pump 2 (Standby) Pump 2 is the running lead pump
  1. Close the dialog and save the picture. The text list now toggles between the two strings every time the M bit flips.
  2. To make the HMI operator able to change the bit, attach a Button with the action SetTagBit("PUMP_DUTY_SEL",1) / SetTagBit("PUMP_DUTY_SEL",0) or use the C-script variant SetTagBit("PUMP_DUTY_SEL",!GetTagBit("PUMP_DUTY_SEL"));.

7. Pump Duty/Standby Example Wiring

The pump duty/standby logic is one of the canonical PCS 7 templates. The M bit is typically the latched selector that the operator flips from the HMI; the CFC then supervises the running feedback bits and raises a fault if the running pump does not start within a configurable time.

AS Symbol Address Direction Function
PUMP_DUTY_SEL M 10.0 OS → AS Operator duty/standby select
PUMP1_RUN M 10.1 AS → OS Feedback, pump 1 running
PUMP2_RUN M 10.2 AS → OS Feedback, pump 2 running
PUMP1_FAULT M 11.0 AS → OS Fault, pump 1
PUMP2_FAULT M 11.1 AS → OS Fault, pump 2

The corresponding structured text (ST) snippet for the supervisory block is:


IF NOT PUMP1_RUN AND PUMP_DUTY_SEL = FALSE THEN
   PUMP1_FAULT := TRUE;        // raise pump-1 fault
   PUMP2_CMD := TRUE;          // auto-start pump 2
END_IF;
IF NOT PUMP2_RUN AND PUMP_DUTY_SEL = TRUE THEN
   PUMP2_FAULT := TRUE;        // raise pump-2 fault
   PUMP1_CMD := TRUE;          // auto-start pump 1
END_IF;
Best practice. Keep the M-bit selector latched on the AS side (use a flip-flop block, type FF) and write the HMI button as a momentary action only. That avoids the situation in which a runtime restart on the OS leaves the AS with the wrong duty assignment.

8. Verification

  1. Open WinCC Tag Management in the WinCC Explorer. Navigate to the internal driver and confirm the presence of PUMP_DUTY_SEL with address M10.0.
  2. Open the picture containing the text list. Activate the runtime preview with File > Activate Runtime.
  3. Click the operator button. The text list should switch between Pump 1 (Duty) and Pump 2 (Standby) on every click.
  4. On the AS, use the online view of the symbol table (Monitor/Modify) to confirm that M10.0 toggles in lock-step with the button press.
  5. If the OS is networked, repeat the test from a WinCC client. The tag should be visible on every client that has the picture in its picture cache.

Additional sanity checks:

  • The PLC diagnostic buffer must not contain event ID 0x013A (symbol error) or 0x0094 (operator-station communication abort) after the compile.
  • The WinCC channel diagnostics must not show a "tag status 0x0001" (connection down) for the AS connection.
  • The picture tree must contain the new icon if the text list is embedded in a block icon.

9. Troubleshooting Matrix

Symptom Likely Cause Remediation
M bit not listed in tag-selection dialog Symbol not flagged "Operator C&M" Right-click symbol, enable attribute, save and recompile OS
Tag present in WinCC but value always 0 AS-OS connection not established Check NetPro connection; restart WinCC channel
Text list flickers between two values AS logic overwrites the M bit Review the CFC chart; use a flip-flop and disable writes from AS
OS compile fails with error 0x022E Multiple OS servers share the same S7 program Compile each OS separately; check OS Project Editor > Server-Data
Symbol table change is not saved Project is read-only or write-protected Open project with full write access; re-open the symbol table
M bit is retentive and ignored by HMI Address inside the retentive range Move the bit to a non-retentive area (e.g., M 10.0 instead of M 0.0 if MB0-MB15 are retentive)
Operator button has no effect Button uses wrong tag name with namespace Use the WinCC tag name only, not the AS symbolic name
OS client does not see the new text Picture cache not refreshed Force a delta download; restart the client runtime

10. Memory Management Best Practices

The M (bit memory) area is the lightest form of state storage on the S7 CPU. It is volatile, addressable byte-wise, and shared between OB1, OB35, and any FB/FC that has access to the global area. To keep the OS data set manageable and predictable:

  • Reserve the first 8 bytes (MB0–MB7) for the CFC-internal scratch flags. Keep them off the OS list.
  • Use MB10–MB99 for operator-visible flags. This range is large enough for typical duty/standby, mode, and override scenarios in a unit.
  • Document the bit in the symbol table with a clear comment and a unit prefix (e.g., U01_PUMP_DUTY_SEL).
  • Never expose retentive bits to the HMI. Retentive memory is for power-fail recovery; the OS always reads the current value, so a retentive bit masked as an operator flag can cause undefined behaviour after a CPU restart.
  • If the project will be migrated to TIA Portal, define the M range in the PLC tag table rather than the symbol table. The TIA Portal attribute set is the superset of the SIMATIC Manager attribute set; the same Operator C&M checkbox is still available in the inspector under Properties > Attributes.

11. FAQ

Why does the tag-selection dialog in a WinCC text list show no M memory bits?

The OS only sees symbols that the symbol table marks as "Operator Control and Monitoring". Enable the flag in the symbol table, save, and recompile the OS so the bit is published to the WinCC channel.

Do I have to use the STEP 7 symbol table, or can I declare the M bit inside a CFC?

You can declare it as a CFC shared declaration. The shared declaration is automatically flagged as OS-relevant, so the tag appears in the OS without an extra step. The symbol-table method is preferred when the bit is shared by several charts.

Can I make a retentive M bit visible to the HMI?

Technically yes, but it is not recommended. Retentive bits are intended for power-fail recovery; the OS will display the latched value and can confuse the operator. Use a non-retentive area such as MB10–MB99.

What is the difference between "ES variables" and the "STEP 7 symbol server" tags?

ES variables are the OS tag set generated by the ES during the OS compile; they live in the WinCC database. The STEP 7 symbol server is the side-car process that the OS runtime queries at start-up. Both are populated from the same source: the symbol table with the "Operator C&M" attribute set.

Do I need to recompile the AS program after toggling the attribute?

No. The attribute is a metadata change. Compiling the CFC chart and the OS is sufficient; the AS does not need a new download unless the S7 program itself changed.

Back to blog