Exposing Block Inputs in WinCC Tag Management When Compiling CFC Charts as Blocks
When compiling a CFC chart as a Function Block (FB), assigning S7_m_c = 'true' to Chart I/Os is necessary but insufficient on its own for the parameters to appear in WinCC Tag Management. After compiling the chart as a block and placing the resulting FB instance into a destination CFC chart, the engineer must open the block properties, check the option 'OCM possible' (Bedienen und Beobachten möglich), and confirm that the target parameters are checked under the 'WinCC Attributes' tab via the OCM button. Finally, performing an OS compilation generates the runtime tags in WinCC under the named S7 connection.
Table of Contents
- Compiling CFC Charts as Function Blocks (FB)
- The Three Mandatory Prerequisites for WinCC OCM Visibility
- CFC Block Creation and OCM Parameter Matrix
- Step-by-Step Procedure to Expose Chart I-Os to WinCC
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Compiling CFC Charts as Function Blocks (FB)
In SIMATIC PCS 7 CFC, engineers frequently build modular automation algorithms by interconnecting elementary logic gates (AND, OR, timers, comparators) in a CFC chart, defining external Chart I/Os, and executing Chart -> Compile -> Chart as Block Type. This encapsulates the internal logic into a reusable Function Block (e.g., FB501) stored in the S7 Program's block folder.
To make inputs, outputs, and internal parameters accessible to supervisory HMI systems like WinCC, STEP 7 uses Operator Control and Monitoring (OCM) attributes (S7_m_c = 'true'). However, because a Function Block type is merely an abstract template, WinCC Tag Management cannot instantiate tags until an actual instance of the block is placed in a chart and explicitly authorized for OCM compilation.
The Three Mandatory Prerequisites for WinCC OCM Visibility
For parameters inside a compiled CFC chart block to populate WinCC Tag Management, three sequential conditions must be fulfilled:
-
Attribute Declaration (
S7_m_c = 'true'): In the original Chart I/O definition table, each parameter intended for WinCC visibility must have system attributeS7_m_cset totrue. -
Instance-Level OCM Authorization ('OCM possible'): When the compiled block is inserted into a destination CFC chart, the instance properties default to unmonitored. The engineer must double-click the block in CFC, open Object Properties, and check the OCM possible checkbox.
-
OS Compilation Execution: Tags in WinCC Tag Management are created exclusively by the Compile OS wizard. If the OS is not compiled after inserting the block, WinCC remains unaware of the new instance.
CFC Block Creation and OCM Parameter Matrix
The following table summarizes the configuration steps and verification points for OCM tag generation:
S7_m_c = 'true'Chart as Block TypeChart -> CompileOCM possibleOCM... dialogOCM...Compile OSStep-by-Step Procedure to Expose Chart I-Os to WinCC
To correctly expose custom block parameters to WinCC Tag Management:
-
Define Chart I/Os and Set S7_m_c:
- In your logic chart, open View -> Chart I/Os.
- Drag internal block pins to theIN,OUT, orIN_OUTinterfaces.
- Right-click each exposed pin, select Properties, and in the Attributes table setS7_m_c = 'true'. -
Compile Chart as Block Type:
- Select Chart -> Compile -> Chart as Block Type.
- Assign a unique FB number (e.g.,FB501), Symbolic Name (e.g.,CustomInterlock), and Family.
- Click OK to compile the block into the S7 Program. -
Instantiate Block and Enable OCM:
- Open the target technological CFC chart where the block will run.
- Drag your newly created FB from the CFC catalog into the chart.
- Double-click the block header to open Block Properties.
- Check the checkbox OCM possible (Bedienen und Beobachten möglich).
- Click the OCM... button below the checkbox. In the dialog, verify that your parameters withS7_m_c = 'true'appear checked under the WinCC Attributes tab.
- Click OK to apply. -
Compile AS and OS:
- Compile the CFC chart folder (Scope: Changes Only).
- In SIMATIC Manager, right-click the OS project and select Compile OS (Scope: Changes Only).
- Open WinCC Explorer Tag Management; your block tags now appear under the corresponding AS named connection.
Verification
Verify tag creation in WinCC:
1. Open WinCC Explorer on the Engineering Station or Server.
2. Open Tag Management.
3. Expand SIMATIC S7 PROTOCOL SUITE -> Named Connections.
4. Locate the tag group matching your Plant Hierarchy folder and chart name.
5. Confirm that all Chart I/Os marked with S7_m_c = 'true' are visible with correct data types and addresses.
6. Create an I/O field in Graphics Designer and verify it can bind to the tag with live runtime updates.
Limitations and Operational Precautions
- FB Number Collisions: When assigning an FB number during 'Chart as Block Type', ensure the selected number does not conflict with existing Siemens library FBs (e.g., APL blocks reserve FB1800 to FB1999).
- Block Interface Modifications: If you modify Chart I/Os after block compilation, you must recompile the block type, update block types across all charts, and perform a full AS/OS compile.
- Process Object License Consumption: Technological blocks with OCM attributes consume OS Runtime Process Object (OS RT PO) licenses in WinCC.
Engineer FAQ
Why can't I see tags in WinCC even though S7_m_c is set to true?
Because 'OCM possible' was not checked in the block instance properties in the destination CFC chart, or an OS compilation has not yet been executed.
Can I add S7_m_c to elementary blocks like AND/OR gates directly?
Standard elementary blocks (AND, OR) in the CFC library do not have S7_m_c enabled by default. Encapsulating them into a custom FB allows you to assign S7_m_c to the custom interface.
What is the difference between S7_m_c on Chart I/Os vs on internal blocks?
When compiling a chart as a block, only Chart I/Os form the external interface of the resulting FB. S7_m_c attributes on internal blocks are ignored during block compilation.
Does compiling a chart as a block consume a Process Object (PO)?
The block definition itself does not consume a PO. When instantiated in CFC with 'OCM possible' enabled, the instance will consume an OS RT PO if interconnected to WinCC.
Technical References
- SIMATIC Process Control System PCS 7 CFC for S7 (V9.0 SP1) Programming Manual (A5E39221520-AB)
- SIMATIC Process Control System PCS 7 Engineering System (V9.0) Configuration Manual
- Siemens Industry Online Support: Creating Custom Blocks with OCM in PCS 7 (Entry ID: 22258908)
Related Articles
- Configuring S7_m_c and S7_xm_c Attributes for Custom Structured Blocks in PCS 7
- Developing Custom APL Faceplates for Blocks Compiled from CFC Charts in PCS 7
- Resolving 'Cannot Read OCM Attributes' Error When Deleting CFC Chart Folders in PCS 7
Related Tags
- CFC Block Creation
- S7_m_c
- OCM
- Tag Management
- OS Compile