How to Automate Placement of High-Volume Block Icons with Predefined Coordinates in PCS 7
To automate the placement of large quantities of block icons (> 800) with predefined screen coordinates in SIMATIC PCS 7, engineers should bypass manual dragging by utilizing VBA automation scripts in WinCC Graphics Designer or structured template duplication. By default, the PCS 7 'Create/Update Block Icons' wizard stacks newly generated icons in the top-left corner (X=0, Y=0) of the .pdl picture. For massive icon deployments, the most efficient method is executing an automated Graphics Designer VBA script that reads an equipment coordinate table (Excel CSV containing Tag Name, Screen Name, Left, and Top) and programmatically instantiates and positions the corresponding block icon template from @PCS7TypicalsAPL.pdl. For replicated production lines, duplicating a master .pdl and running the Dynamic Wizard 'Connect PCS 7 tag to structure' preserves coordinates while retargeting tag bindings.
Table of Contents
- The Operational Bottleneck of Stacking Block Icons
- Method 1: VBA Automation Script for Coordinate-Based Icon Placement
- Method 2: Template Duplication and 'Connect Tag to Structure' Wizard
- Configuration File Mechanics: TemplateControlAPL.cfg
- Block Icon Bulk Deployment Strategy Comparison Matrix
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
The Operational Bottleneck of Stacking Block Icons
In SIMATIC PCS 7, the standard workflow for generating graphic block icons involves:
1. Enabling 'Create block icon' on the CFC chart or Technological Hierarchy folder.
2. In SIMATIC Manager, selecting Plant Hierarchy -> Create/Update Block Icons.
When executed for a complex plant picture containing hundreds of motors, valves, and transmitters:
* The wizard generates every block icon specified in CFC.
* Because the compiler cannot know the physical layout of plant vessels and piping, it places all newly generated icons at coordinates (0, 0) in the upper-left corner of the .pdl picture.
* Manually unstacking, identifying, and moving 800+ block icons onto their respective P&ID equipment symbols requires days of tedious drafting and introduces placement errors.
Method 1: VBA Automation Script for Coordinate-Based Icon Placement
For greenfield projects or extensive P&ID overhauls, writing a Visual Basic for Applications (VBA) macro inside WinCC Graphics Designer automates the entire placement pipeline:
1. Structure the Coordinate Input Table (Excel/CSV)
Create an engineering schedule containing four mandatory columns:
* TagName: The full PCS 7 tag name (e.g., Plant/Area1/V101/MotL).
* IconType: The typical icon variant (e.g., @MotL/1).
* PosLeft: Target X-coordinate in pixels (e.g., 640).
* PosTop: Target Y-coordinate in pixels (e.g., 320).
2. Implement the Graphics Designer VBA Script
In Graphics Designer, open the VBA Editor (Alt+F11) and create a macro that:
1. Opens @PCS7TypicalsAPL.pdl in the background.
2. Reads the CSV schedule line-by-line.
3. Clones the requested icon template into the active .pdl picture.
4. Assigns:
* obj.Properties("Left") = PosLeft
* obj.Properties("Top") = PosTop
* obj.Properties("Tag") = TagName
5. Saves the picture. 800+ icons are positioned in seconds with pixel-perfect alignment.
Method 2: Template Duplication and 'Connect Tag to Structure' Wizard
For plants featuring identical, replicated equipment trains (e.g., 8 parallel fermentation tanks or 10 identical packaging lines):
- Build Master Picture: Fully draft and manually arrange all block icons on the first process picture (
Line_01.pdl). - Duplicate Picture: Copy
Line_01.pdltoLine_02.pdl,Line_03.pdl, etc., within the<Project>\GraCSdirectory. - Execute Dynamic Wizard:
* OpenLine_02.pdlin Graphics Designer.
* In the Dynamic Wizard pane, select Picture Functions -> Connect PCS 7 tag to structure instance.
* Specify the source plant hierarchy string (Line_01) and replacement string (Line_02).
* The wizard updates all internal tag connections and structure links across all icons while maintaining their exact screen coordinates.
Configuration File Mechanics: TemplateControlAPL.cfg
The underlying rule engine governing icon creation resides in TemplateControlAPL.cfg (located in WinCC\Options\WScripts):
- This configuration file specifies which typical pictures (
@PCS7TypicalsAPL.pdl,@TemplateAPL.pdl) correspond to specific block types (MotL,VlvL,PIDConL). - It dictates default grid offsets and stacking behaviors.
- While editing
TemplateControlAPL.cfgallows custom icon naming schemas, coordinate offsets within the CFG file only dictate initial relative spacing and cannot perform plant P&ID equipment mapping.
Block Icon Bulk Deployment Strategy Comparison Matrix
The following table compares the efficiency, implementation effort, and optimal scenarios for bulk icon placement:
Selecting automated methods eliminates human drafting fatigue and accelerates commissioning.
Verification
To verify that bulk-placed block icons are correctly positioned and interconnected:
1. Open the target .pdl picture in WinCC Graphics Designer; confirm that all 800+ block icons appear at their intended equipment coordinates without overlap.
2. Select any icon, open Object Properties, and verify that the Tag and TagLowLimit / TagHighLimit dynamic links point to the correct AS block instances.
3. Activate WinCC Runtime; verify that all block icons display live process states (colors, values, alarm borders) without connection errors (broken link icons).
4. Click several icons to verify that faceplates open for the designated equipment tag.
Limitations and Operational Precautions
- When running 'Create/Update Block Icons' in SIMATIC Manager on a picture containing custom-positioned icons, uncheck 'Recreate all block icons' to avoid overwriting custom positions.
- Ensure coordinate values in the CSV table do not exceed the active picture canvas dimensions (e.g.,
1920x824pixels) to prevent off-screen rendering. - Always create a backup copy of the target
.pdlbefore running bulk VBA automation macros. - Do not rename internal block icon property names (
Tag,Type,ServerName), as the APL faceplate engine requires standard property names.
Engineer FAQ
Will re-running 'Create/Update Block Icons' in SIMATIC Manager move my VBA-placed icons back to (0,0)?
No, provided you select 'Update block icons' instead of deleting and recreating. The update function only refreshes tag attributes and preserves existing Left and Top coordinates.
Can I export coordinates of existing icons to create a mapping template?
Yes. A simple VBA script can iterate through all objects in an existing picture where Type Like '@*' and export their ObjectName, Tag, Left, and Top properties to a CSV file.
Where is the @PCS7TypicalsAPL.pdl file located?
@PCS7TypicalsAPL.pdl is stored in the <Project_Dir>\GraCS directory of each WinCC OS project, copied from the global PCS 7 template library during OS Project Editor execution.
Technical References
- SIMATIC WinCC V7.x Graphics Designer VBA Scripting Manual
- SIMATIC Process Control System PCS 7 Advanced Process Library Manual
- SIMATIC PCS 7 Compendium Part A - Configuration Guidelines
Related Articles
- How to Automate Block Icon Positioning Across Replicated Process Pictures in PCS 7
- Customizing @PCS7TypicalsAPL and Block Icon Variants in WinCC
- Using WinCC Dynamic Wizards for Bulk Tag and Structure Interconnections
Related Tags
- Block Icons
- Predefined Coordinates
- WinCC VBA
- Dynamic Wizard
- Graphics Designer