Exposing Active Step Numbers and States from SFC Charts and Types to WinCC in PCS 7

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)

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:

SFC Architectural ModelParameter NameData TypeDefault S7_m_c StatusBehavior During Step InsertionSFC Type InterfaceQSTEPINTfalse (Disabled for OS)Reports current step integer; requires S7_m_c = true for WinCC tagSFC Type InterfaceCUSTEPRTSTRUCTfalseContains step number, running time, and state flagsSFC Chart InternalSTEPNOINTInternal onlyCompiler-generated handle; non-sequential when steps are addedSFC Runtime Engine@<Chart>_CurrentStepSTRINGAutomatically generatedExposes step name (text) to the WinCC SFC Control ActiveX/.NETUser Engineering PatternUser_Step_NoDINT / INTtrue (User tag in CFC)Explicitly written in Step Init actions; 100% sequential and persistent

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:

  1. Open SFC Type in SFC Editor:
    * In SIMATIC Manager, navigate to the master data library or component view.
    * Open the target SFC Type.
  2. Modify Interface Parameter Attributes:
    * Open the interface editor (View > Inputs/Outputs).
    * In the navigation tree, select Outputs.
    * Locate the output parameter QSTEP (or CUSTEPRT).
    * In the parameter properties grid, locate the column OCM (Operator Control and Monitoring / S7_m_c).
    * Check the box to set S7_m_c = true.
  3. 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.
  4. Compile OS:
    * Run Compile OS (Scope: Changes only).
    * The OS Compiler generates the WinCC tag <HierarchyPath>/<SfcInstance>.QSTEP in the WinCC tag management database.

Implementing Explicit Step Numbering in SFC Charts

For individual SFC Charts (where modifying FB300 is unviable):

  1. 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., OpDi01 or internal variable Step_Number).
    * Enable S7_m_c = true on the tag.
  2. 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
  3. 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 FB300 in 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

Related Articles

Related Tags

  • SFC
  • QSTEP
  • STEPNO
  • S7_m_c
  • WinCC Tag
  • SFC Type
  • SFC Chart
  • PCS 7 OS
6 respuestas