Exposing Active Step Numbers and States from SFC Charts and Types to WinCC in PCS 7
In SIMATIC PCS 7, the active step number of an SFC cannot be read from internal step IDs because the STEPNO attribute is statically assigned during compilation and cannot be sequenced manually. In SFC Types, the current step number is available on parameter QSTEP, which can be transferred to WinCC by enabling operator control and monitoring (S7_m_c = true). In SFC Charts, the recommended approach is assigning an explicit integer step number to a custom chart variable within each step's initialization action.
Table of Contents
- Architecture of Step Identification in PCS 7 SFC (SFC Type vs. SFC Chart)
- Step Identification and State Output Parameter Matrix
- Configuring QSTEP Operator Control and Monitoring (S7_m_c) in SFC Types
- Implementing Explicit Step Numbering in SFC Charts
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of Step Identification in PCS 7 SFC (SFC Type vs. SFC Chart)
In SIMATIC PCS 7 sequential control applications, operators and supervisory SCADA screens in WinCC frequently require visualization of the currently executing phase step (e.g., displaying Step 10: Filling, Step 20: Heating, Step 30: Agitating).
When engineers attempt to capture this information from Sequential Function Charts, they encounter a critical structural distinction between SFC Types and SFC Charts:
1. Internal Step Identifier (STEPNO): In both SFC Types and SFC Charts, every step object is assigned an internal integer STEPNO by the compiler. However, STEPNO is an immutable, non-contiguous system handle. If an engineer inserts a new intermediate step between Step 1 and Step 2, the compiler assigns the next available unique handle (e.g., Step 23), breaking any sequential numeric logic.
2. SFC Types (FB based): Standard parameters like QSTEP (Number of active step) and CUSTEPRT are defined in the interface. However, unless the attribute S7_m_c := 'true' is explicitly configured, these variables are not exported as WinCC tags during OS compilation.
3. SFC Charts (@SFC_RTS / FB300 based): Individual SFC charts compile into a shared runtime framework block (FB300). Modifying FB300 in the STEP 7 block folder to expose internal variables is strictly prohibited, as running Compile SFC or performing a software upgrade overwrites FB300 and reverts modifications.
Step Identification and State Output Parameter Matrix
Understand how step variables are handled across SFC architectural models:
S7_m_c StatusQSTEPINTfalse (Disabled for OS)S7_m_c = true for WinCC tagCUSTEPRTSTRUCTfalseSTEPNOINT@<Chart>_CurrentStepSTRINGUser_Step_NoDINT / INTtrue (User tag in CFC)Engineering guideline: For custom displays and external historian logging, explicit user step numbering is the most reliable industry practice.
Configuring QSTEP Operator Control and Monitoring (S7_m_c) in SFC Types
To expose the native step number in standardized SFC Types:
- Open SFC Type in SFC Editor:
* In SIMATIC Manager, navigate to the master data library or component view.
* Open the target SFC Type. - Modify Interface Parameter Attributes:
* Open the interface editor (View > Inputs/Outputs).
* In the navigation tree, select Outputs.
* Locate the output parameterQSTEP(orCUSTEPRT).
* In the parameter properties grid, locate the column OCM (Operator Control and Monitoring /S7_m_c).
* Check the box to setS7_m_c = true. - Compile and Update Instances:
* Save and compile the SFC Type.
* In SIMATIC Manager, select Options > Plant Hierarchy > Update Block Types.
* Update all instances in the project. - Compile OS:
* Run Compile OS (Scope: Changes only).
* The OS Compiler generates the WinCC tag<HierarchyPath>/<SfcInstance>.QSTEPin the WinCC tag management database.
Implementing Explicit Step Numbering in SFC Charts
For individual SFC Charts (where modifying FB300 is unviable):
- Create an Explicit Step Number Tag:
* In the technological CFC chart associated with the SFC, insert a standard integer memory tag or an analog value block (e.g.,OpDi01or internal variableStep_Number).
* EnableS7_m_c = trueon the tag. - Assign Values in SFC Step Initialization Actions:
* Open the SFC Chart in SFC Editor.
* Double-click Step 1 (e.g.,Idle):- In the Initialization tab, add an action:
CFC_Chart/Step_Number.Value = 10 - Double-click Step 2 (e.g.,
Fill_Tank): - In the Initialization tab, add an action:
CFC_Chart/Step_Number.Value = 20 - Double-click Step 3 (e.g.,
Heat_Mixture): - In the Initialization tab, add an action:
CFC_Chart/Step_Number.Value = 30
- In the Initialization tab, add an action:
- Advantages of Explicit Numbering:
* Numbers follow logical plant standards (10, 20, 30) leaving space for future steps (e.g., 25).
* Renaming, inserting, or deleting steps does not alter numbering integrity.
* Tag values are instantly accessible to WinCC Alarm Logging, trends, and third-party MES/historian systems.
Verification
Verify step tracking in WinCC:
1. Open the WinCC Graphics Designer and bind an I/O field to the newly exposed step number tag.
2. Activate WinCC Runtime.
3. Start the SFC sequence from the OS faceplate.
4. Confirm that as the sequence progresses from Step 1 to Step 2, the WinCC I/O field dynamically updates from 10 to 20.
5. Open the standard PCS 7 SFC Control window: Confirm that the active step highlighted in the graphic matches the numeric display.
Limitations and Operational Precautions
- Never attempt to open
FB300in the STEP 7 block folder to manually modify its attributes; doing so invalidates the SFC compiler delta log and will be wiped during subsequent chart compilations. - In SFC Types, changing interface parameters requires an offline update and compilation of all instances, which can require a CPU download in STOP if interface footprints are altered.
- Ensure step number writing is executed strictly in the Initialization tab of the step, not the cyclic Processing tab, to minimize CPU scan time overhead.
Engineer FAQ
Can WinCC display the text name of the step instead of a number?
Yes. The standard PCS 7 SFC Control component automatically retrieves step names. To display step text in custom WinCC graphics, link a text list object to the integer step tag or query the '@_CurrentStep' string tag.
Why did my changes to FB300 disappear after upgrading PCS 7?
FB300 (@SFC_RTS) is a system library block owned by the PCS 7 SFC runtime system. Compiling SFC charts or upgrading libraries automatically overwrites system blocks with catalog defaults.
What is the maximum step number that can be assigned?
Using standard S7 INT data types, step numbers can range from -32,768 to +32,767 (typically 1 to 9999 for plant sequences).
Technical References
- SIMATIC PCS 7 SFC for S7 Manual (A5E32106050)
- SIMATIC PCS 7 Compendium Part C - Technical Functions with SFC Types (A5E32106055)
- Siemens Support Entry 109780813: Displaying SFC Step Numbers in WinCC
Related Articles
- Implementing Post-Condition Transition Delays and Step Wait Times in SIMATIC PCS 7 SFC
- Configuring Operator Authorizations and Access Levels for SFC Faceplates in SIMATIC PCS 7
- Managing SFC Types and Instance Synchronization in SIMATIC PCS 7
Related Tags
- SFC
- QSTEP
- STEPNO
- S7_m_c
- WinCC Tag
- SFC Type
- SFC Chart
- PCS 7 OS