Creating Custom Block Icons and Automating OS Picture Placement from CFC in PCS 7
To automatically generate custom WinCC block icons for proprietary CFC function blocks (FBs) during OS compilation, configure three structural components: (1) In the FB source code (SCL), assign the system attributes S7_m_c := 'true' to the block and its exposed I/Os, and configure the block icon type identifier (e.g., @CustomAnalog/1); (2) In the CFC Editor, check the 'Create block icon' option in chart/block properties; and (3) In WinCC Graphic Designer, create the custom block icon inside @PCS7Typicals.pdl (or a project typical file) with matching type property and dynamic prefix tags. During OS compilation (Create/Update Block Icons), PCS 7 places the icon into the WinCC PDL assigned to the CFC's Plant Hierarchy folder.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
A defining strength of the SIMATIC PCS 7 engineering environment is the automated compilation pipeline that translates technological controller logic into operator visualization screens without manual graphic linking. While standard Advanced Process Library (APL) blocks automatically instantiate standardized block icons (e.g., @MotL/1, @VlvL/1), system integrators developing proprietary SCL blocks (such as specialized chemical dosing modules or custom drive controllers) often struggle to enable automatic block icon generation. When OS compilation fails to place icons into specific process pictures (e.g., Production2.pdl), the cause is typically missing SCL block attributes, mismatched typical template identifiers, or improper Plant Hierarchy picture assignments. This article details the exact configuration rules required for seamless custom icon integration.
Architecture and Fundamental Mechanics
The automated block icon creation mechanism in PCS 7 operates through a multi-tier engineering link:
-
SCL Block Attributes and OCM: For WinCC to recognize a function block as an Operator Control and Monitoring (OCM) entity, the SCL source must declare system attributes:
-{ S7_m_c := 'true' }on the block header enables WinCC tag generation.
-{ S7_blockview := 'big' }dictates CFC graphical presentation.
-{ S7_tag := 'true' }on internal structures flags variables for WinCC logging.
-{ S7_m_c := 'true' }on individual inputs/outputs exposes specific parameters to the WinCC tag management table. -
Block Icon Type Identifier: In the block properties or SCL attribute header, the
typeattribute defines which template object to instantiate (e.g.,@CustomMotor/1). The prefix@denotes a standard system typical, while/1indicates variant 1. -
The Typicals Template Catalog: When
Plant Hierarchy -> Create/Update Block Iconsexecutes, the WinCC OS compiler scans template pictures in the OS project directory, prioritized in order:
-@PCS7Typicals_Custom.pdl(Project-specific custom library)
-@PCS7Typicals.pdl(APL default typicals)
-@template.pdl(Legacy typicals)
The compiler finds the graphic object whose user propertytypeexactly matches the block's configured type string. -
Plant Hierarchy Routing: The target WinCC graphic picture (
Production2.pdl) is determined by the Plant Hierarchy. The CFC chart containing the custom FB must reside in the exact hierarchy folder whereProduction2.pdlis created. If the folder has 'OS assignment' enabled, the compiler instantiates the block icon directly into that picture and establishes dynamic tag prefix connections.
Step-by-Step Implementation Procedure
Follow these configuration steps to implement custom block icons and automate picture placement:
-
Define SCL Attributes in Custom Function Block:
- In the SCL source file for the custom FB (e.g.,FB2050), define the required system attributes:
scl { S7_m_c := 'true'; S7_blockview := 'big'; S7_xm_c := 'Value,true;'; S7_dynamic := 'true' } FUNCTION_BLOCK FB_CustomAnalog TITLE = 'Custom Analog Monitoring Block'
- Ensure all process values intended for SCADA display (e.g.,PV_Out,ER_Alarm,Status) have{ S7_m_c := 'true' }.
- Compile the SCL source into the block container. -
Configure Block Properties in CFC:
- Drag the custom FB into the target CFC chart.
- Right-click the block, selectObject Properties, and verify thatOperator Control and Monitoring (OCM)is checked.
- In theBlock Iconfield, enter the custom identifier:@CustomAnalog/1.
- Check the checkbox labeledCreate block icon. -
Design the Custom Block Icon in WinCC:
- In WinCC Explorer on the ES, openGraphics Designer.
- Open@PCS7Typicals.pdlor save a copy as@PCS7Typicals_Custom.pdl.
- Duplicate an existing APL block icon (e.g.,@MonAnL/1) to preserve standard scripts, tooltip behavior, and click actions.
- Select the duplicated object, openProperties -> General, and change thetypeproperty to@CustomAnalog/1.
- Adjust internal static text, bar graphs, and status bit connections to match your FB structure.
- Save and close@PCS7Typicals_Custom.pdl. -
Assign Target Picture in Plant Hierarchy:
- Switch to Plant View in SIMATIC Manager.
- Ensure the CFC chart resides within the hierarchy folder assigned toProduction2.pdl.
- Right-click the hierarchy folder, selectObject Properties -> OS Assignment, and verify the target OS. -
Compile OS and Generate Block Icons:
- Right-click the Plant Hierarchy root (or target folder) and selectPlant Hierarchy -> Create/Update Block Icons.
- Select the target WinCC OS and clickOK.
- OpenProduction2.pdlin Graphics Designer. Confirm that the custom block icon is automatically instantiated with tag links.
Verification
Verify automatic generation and runtime dynamics:
-
Graphic Placement Check: Open
Production2.pdl. Confirm that the block icon@CustomAnalog/1is positioned neatly in the top-left quadrant of the picture canvas. -
Dynamic Tag Binding: Right-click the created block icon, open
Properties -> Event -> Click Mouse, and inspect tag bindings. Confirm that the dynamic prefix is mapped to the full technological path of the CFC block (e.g.,Plant/Unit/CFC_Analog/CustomFB). -
Runtime Functional Test: Start WinCC Runtime. Change process values in the AS. Confirm that the custom block icon updates colors, numerical values, and alarm badges dynamically, and opens the associated faceplate when clicked.
Limitations and Operational Precautions
Never modify the factory-delivered @PCS7Typicals.pdl directly without maintaining a project backup, as official Siemens library updates or Service Packs will overwrite @PCS7Typicals.pdl. Always implement custom icons in @PCS7Typicals_Custom.pdl or project-specific typical files. Furthermore, ensure that custom block icon type strings do not conflict with existing APL types.
Engineer FAQ
Why was my custom block icon not generated during OS compilation?
Common causes include: (1) The FB header lacks S7_m_c := 'true'; (2) The 'Create block icon' box was unchecked in CFC; (3) The type string in CFC does not match the type property in @PCS7Typicals.pdl character-for-character; or (4) No picture exists in the Plant Hierarchy folder.
Can I create multiple graphic variants for the same custom block?
Yes. By appending variant suffixes (e.g., @CustomAnalog/1, @CustomAnalog/2), you can design horizontal, vertical, or compact graphic variants in the typicals file and select the desired variant per CFC block instance.
What is the advantage of using @PCS7Typicals_Custom.pdl?
Files named @PCS7Typicals_Custom.pdl are evaluated with higher priority by the block icon generator and are protected against overwriting during PCS 7 software upgrades.
Does the custom block icon open faceplates automatically?
If you duplicate an APL typical icon, it inherits the C-script call OpenFaceplate(). You must also create the corresponding faceplate file (@PG_CustomAnalog.pdl) or configure the icon script to open a custom graphic popup.
Does generating block icons overwrite manual position adjustments?
No. The PCS 7 block icon generator detects previously positioned icons and preserves their XY coordinates on subsequent compilations.
Technical References
- SIMATIC PCS 7 APL Style Guide Application Manual
- SIMATIC PCS 7 Operator Station Engineering Manual V9.0
- Creating Custom Block Icons and Faceplates in SIMATIC PCS 7
Related Articles
- Diagnosing Faceplate Button Freezing and Focus Locks in Custom WinCC Scripts
- Establishing Cross-CFC Block Interconnections and Parameter Assignments in Process Object View
- Excluding Individual Field Devices from Diagnostic Screen Generation in PCS 7 Maintenance Station
Related Tags
- Block Icons
- CFC
- WinCC
- OCM
- SCL Attributes
- Graphics Designer