Troubleshooting Automatic Block Icon Generation Failures for Custom SCL Blocks in SIMATIC PCS 7 WinCC

Troubleshooting Automatic Block Icon Generation Failures for Custom SCL Blocks in SIMATIC PCS 7 WinCC

In SIMATIC PCS 7, automatic block icon generation failing during AS-OS compilation for a custom SCL block occurs when mandatory system attributes ({ S7_m_c := 'true' }, { S7_tag := 'true' }, { S7_blockview := 'status' }) are missing from the SCL source code, the block instance lacks 'OCM possible' in CFC, the WinCC picture lacks the 'Derive block icons from the plant hierarchy' property, or the block icon in @template.pdl has an invalid 'type' string. To resolve this, declare the required S7 attributes in SCL, enable OCM on the block instance, configure the template icon with matching type @<BlockType>/<Index>, and execute 'Create/update block icons' from the Plant Hierarchy.

Table of Contents

Automated Block Icon Generation Architecture in PCS 7

In SIMATIC PCS 7, process pictures automatically generate standardized technological block icons (such as valve, motor, and controller icons) via the Plant Hierarchy (PH) engine:
* SCL System Attributes: When compiling an SCL source into a Function Block (FB), system attributes instruct the compiler to expose the block to WinCC Operator Control and Monitoring (OCM).
* CFC Instance Flag: Placing the FB in a CFC chart creates an instance with property OCM possible enabled.
* Template Icon Repository: WinCC searches standard template pictures (@PCS7Typicals.pdl or @template.pdl) for a graphic object whose user-defined attribute type matches the technological block name and index.
* OS Compilation / Icon Creation: Selecting Plant Hierarchy -> Create/update block icons parses the hierarchy and automatically places and binds the block icon into the assigned WinCC picture (*.pdl).

Root Causes of Missing Automatic Block Icons

When custom block icons fail to appear in target process pictures:
1. Missing S7_m_c Attributes in SCL: If the FB header lacks { S7_m_c := 'true' }, or if key status/control variables lack { S7_m_c := 'true'; S7_tag := 'true' }, STEP 7 does not generate the WinCC structure tag.
2. Missing or Mismatched type Property in Template: In @PCS7Typicals.pdl, the custom block icon's attribute type must be formatted strictly as: @<BlockName>/<Index> (e.g. @CustomMotor/1). If formatted as CustomMotor without the leading @ and index, the parser ignores the object.
3. Disabled Plant Hierarchy Picture Setting: In SIMATIC Manager Plant View, the target picture object must have the option Derive block icons from the plant hierarchy checked in its Object Properties.
4. Disabled OCM on CFC Block: If the engineer unchecks 'OCM possible' in the CFC block instance properties, the OS compiler skips the block entirely.

Step-by-Step Configuration for Custom SCL Block Icon Generation

Follow this procedure to enable automated block icon generation:

[Phase 1: Configure S7-SCL Header and Variable Attributes]
   │  • In S7-SCL source editor, define attributes on FB header and variables:
   │      FUNCTION_BLOCK FB1000
   │      { S7_m_c := 'true'; S7_tasklist := 'OB100'; S7_blockview := 'status' }
   │      VAR_INPUT
   │          RunFeedback { S7_m_c := 'true' } : BOOL;
   │          Fault       { S7_m_c := 'true' } : BOOL;
   │      END_VAR
   │  • Compile the S7-SCL source to generate the FB in the Blocks folder
   │
[Phase 2: Create Template Icon in @PCS7Typicals.pdl]
   │  • In WinCC Graphics Designer, open: @PCS7Typicals.pdl (or @template.pdl)
   │  • Design or copy a block icon; group it as a customized object
   │  • In Object Properties -> User-defined Attributes:
   │      - Property: "type"  -> Value: "@CustomMotor/1"
   │      - Property: "servername" -> Value: "PCS7 CustomMotor Control"
   │  • Save and close the template picture
   │
[Phase 3: Enable Plant Hierarchy Inheritance and Generate Icons]
   │  • In SIMATIC Manager Plant View: Right-click target picture -> Object Properties
   │  • Select "Block Icons" tab -> Check: [x] "Derive block icons from the plant hierarchy"
   │  • Right-click the Plant Hierarchy folder (or Process Cell)
   │  • Select: Plant Hierarchy -> "Create/update block icons..."
   │  • Select target OS and execution scope -> Click "OK"
   │  • Open the picture in Graphics Designer -> The custom block icon is placed!

System Attributes and Block Icon Mapping Matrix

Verify the following mandatory attributes for automated icon generation:

Location / ObjectRequired Property / AttributeRequired ValuePurposeSCL Block Header{ S7_m_c := 'true' }'true'Enables WinCC OCM compilation.SCL Structure Attributes{ S7_blockview := 'status' }'status'Signals graphic status generator.CFC Block InstanceOCM possibleEnabled (Checked)Authorizes tag export to WinCC.Template Icon Propertytype@<BlockName>/<Index>Matches AS block name to template icon.WinCC Picture PropertiesDerive block icons...Enabled (Checked)Permits automated icon insertion.

Verification

To confirm that the custom block icon generates properly:
1. In SIMATIC Manager Plant View, execute Plant Hierarchy -> Create/update block icons.
2. Inspect the compilation log; verify that the report states: 1 block icon(s) created for block [ChartName]/[BlockName].
3. In WinCC Graphics Designer, open the target picture; confirm that the custom block icon is positioned inside the sheet.
4. Verify that the icon's tag property is automatically bound to the CFC hierarchical path (e.g. Plant/Unit/CustomMotor).
5. Activate WinCC Runtime; confirm that the icon displays dynamic state changes matching AS controller inputs.

Limitations and Operational Precautions

Never modify @PCS7Typicals.pdl or @template.pdl directly in the global Siemens installation directory (C:\Program Files...). Always modify the template picture located inside the local project's GraCS folder. If a newer PCS 7 service pack is installed, global files can be overwritten, destroying custom template icon definitions. Maintain an offline copy of all custom block icons in a separate project library.

Engineer FAQ

Why does the block icon place itself in the top-left corner of the picture?

When an icon is first generated, the layout algorithm places it at coordinate (0,0) or in an open area. The engineer can move it to the desired position; subsequent compiles will preserve the new coordinates.

What is the difference between @PCS7Typicals.pdl and @template.pdl?

In modern PCS 7, @PCS7Typicals.pdl is the primary template searched by the icon generator. @template.pdl is a legacy fallback. Multiple typicals can be created (e.g. @PCS7Typicals_Custom.pdl).

Can I create multiple icon variations for the same custom block?

Yes. Create multiple icons in @PCS7Typicals.pdl and set property type to @CustomBlock/1, @CustomBlock/2, etc. In CFC block properties, enter 1 or 2 in the 'Block icon' field to select the variant.

Why did 'Create/update block icons' delete my existing manual connections?

If you manually edit internal dynamic links on an automatically generated icon, re-running 'Create/update block icons' will overwrite them unless you configure user properties properly.

Technical References

Related Articles

Related Tags

  • Block Icon Generation
  • S7-SCL Attributes
  • S7_m_c
  • @PCS7Typicals
  • Plant Hierarchy
6 respuestas