How to Automate Block Icon Positioning Across Replicated Process Pictures in PCS 7

How to Automate Block Icon Positioning Across Replicated Process Pictures in PCS 7

In SIMATIC PCS 7, replicating identical plant units (e.g., copying Line 1 to Lines 2 and 3) causes newly generated block icons to stack in the top-left corner (0,0) of the process picture during an OS compile. To automate block icon positioning without manually dragging hundreds of icons, use the WinCC Dynamic Wizard 'Export picture objects' on the completed Line 1 picture with configuration file TemplateControlAPL.cfg. In Excel, copy the X-Pos and Y-Pos coordinates from Line 1 to the Line 2 export file matching object names, and run the Dynamic Wizard 'Import picture objects' on Line 2 with @PCS7TypicalsAPLV8.pdl.

Table of Contents

Block Icon Generation and Coordinate Stacking Mechanics

In greenfield and plant expansion projects engineered with SIMATIC PCS 7, facilities frequently incorporate multiple identical production streams (e.g., Line 1, Line 2, and Line 3) controlled by separate Automation Stations.

When an engineer completes the technological layout and graphic mimic for Line 1:
1. Plant Hierarchy folders for Lines 2 and 3 are created by duplicating Line 1.
2. Symbol tables, CFC charts, and block instances are updated with corresponding line prefixes (e.g., 03XV102 on Line 1 becomes 03XV202 on Line 2).
3. CFC and OS compilations complete successfully.

The Coordinate Reset Phenomenon

When SIMATIC Manager generates block icons on a newly created process picture for Line 2, the compiler treats all blocks as brand-new instances without spatial history. Consequently, the block icon wizard inserts all newly generated icons stacked sequentially in the top-left corner (X=0, Y=0) of the picture canvas. Manually moving, aligning, and positioning hundreds of valves, motors, and analog indicators across multiple replicated lines is labor-intensive and prone to human alignment errors.

Limitations of Manual Layout in Replicated Plant Lines

Engineers often attempt to copy and paste the finished Line 1 picture file (Line1.pdl -> Line2.pdl) and run 'Update of the picture objects'. However:
* The existing block icons on the copied picture still link to Line 1 tag structures.
* While the Dynamic Wizard 'Link Tag Connections' can rename tag prefixes (e.g., search Line1 replace with Line2), any subsequent run of the OS Compiler's 'Create/Update block icons' may delete un-linked icons or re-stack them if block type versions change.
* A robust, repeatable methodology requires programmatically transferring spatial coordinate metadata (X-Pos, Y-Pos) into the new picture's block icon database.

Step-by-Step Automated Positioning Using Dynamic Wizard and Excel

Follow this proven engineering procedure to automate coordinate alignment using standard WinCC Dynamic Wizards:

Step 1: Export Object Coordinates from Completed Line 1

  1. In Graphics Designer, open the completed reference picture for Line 1 (Line1.pdl).
  2. Open the Dynamic Wizard pane (docked on the right side).
  3. Under Picture Functions, double-click 'Export picture objects'.
  4. In the wizard:
    * Select 'Only export the active picture'.
    * In the second dialog, select the configuration file: TemplateControlAPL.cfg (located in C:\Program Files (x86)\Siemens\WinCC\Options\WScripts).
    * Specify an export destination file: e.g., Export_Line1.txt.
  5. Finish the wizard.

Step 2: Export Default Coordinates from Newly Generated Line 2

  1. In Graphics Designer, open the target picture for Line 2 (Line2.pdl) where icons are currently stacked at the top-left corner.
  2. Run the Dynamic Wizard 'Export picture objects' using TemplateControlAPL.cfg.
  3. Save as: Export_Line2.txt.

Step 3: Synchronize Coordinates in Microsoft Excel

  1. Open both Export_Line1.txt and Export_Line2.txt in Excel (use Tab or Semicolon delimited import).
  2. Note the columns: Object Name, Tag Name, X-Pos, Y-Pos, Width, Height.
  3. Sort both spreadsheets by the relative technological block name (e.g., stripping the line prefix so 03XV102 aligns with 03XV202).
  4. Copy the entire X-Pos and Y-Pos columns from Line 1 and paste them into the corresponding rows of Line 2.
  5. Save Export_Line2.txt as a tab-delimited text file.

Step 4: Import Positioned Objects into Line 2

  1. In Graphics Designer, return to Line2.pdl.
  2. In Dynamic Wizard -> Picture Functions, double-click 'Import picture objects'.
  3. Select Export_Line2.txt as the data source file.
  4. Select the typical picture file: @PCS7TypicalsAPLV8.pdl (or matching project typicals).
  5. Finish the wizard. Every block icon on Line 2 will immediately move to its exact intended coordinates!
  6. If multiple typicals files are used (e.g., custom or SFC typicals), repeat the import for each respective typicals file.

Dynamic Wizard Export and Template Configuration Reference Matrix

The following table outlines the tools and configuration files utilized in automated block icon positioning:

Tool / Configuration FileFile System PathRole in Positioning WorkflowKey Parameters ControlledExport picture objectsDynamic Wizard -> Picture FunctionsExtracts graphic coordinatesDumps X, Y, Width, Height to textImport picture objectsDynamic Wizard -> Picture FunctionsIngests modified coordinatesSnaps icons to target positionsTemplateControlAPL.cfgWinCC\Options\WScriptsDefinition schema for APL iconsMaps block icon attributes@PCS7TypicalsAPLV8.pdlOS Project GraCS DirectoryMaster template for block iconsGraphic symbols instantiatedExcel Text EditorExternal SpreadsheetData mapping & coordinate transferMass column copy-paste

This workflow reduces hours of manual alignment to minutes of deterministic data manipulation.

Verification

To verify that automated positioning succeeded:
1. Open Line2.pdl in Graphics Designer; confirm that all block icons are distributed across the mimic diagram in positions identical to Line 1.
2. In SIMATIC Manager Plant View, run Plant Hierarchy -> Create/Update Block Icons... for Line 2.
3. Open Line2.pdl again: confirm that the icons remain in their imported positions and do NOT jump back to (0,0).
4. Activate WinCC Runtime; verify that all block icons on Line 2 connect to live Line 2 process tags and open the correct faceplates upon clicking.

Limitations and Operational Precautions

  • Ensure object names in the export files are sorted identically before copying coordinate columns in Excel; mismatched sorting will transpose coordinates across unrelated blocks.
  • If a project uses more than 10 @PCS7Typicals*.pdl files, merge them or run the import sequentially for each typicals file.
  • Always back up the target process picture (.pdl) before executing the Dynamic Wizard import.
  • Verify that total picture canvas dimensions match the OS Project Editor layout (e.g., 1920x824) to avoid edge clipping.

Engineer FAQ

Why did the compiler keep moving my block icons back to the top left?

If an icon's tag connection is broken or its block type index changes, the compiler deletes the orphaned icon and generates a new one at default position (0,0).

Can this method be used for non-APL graphic objects?

Yes. The Dynamic Wizard 'Export picture objects' can export coordinates for any standard WinCC graphic object, including static pipes, text labels, and customized symbols.

Where is TemplateControlAPL.cfg stored?

It is located on the Engineering Station under C:\Program Files (x86)\Siemens\WinCC\Options\WScripts.

Technical References

Related Articles

Related Tags

  • Block_Icons
  • Dynamic_Wizard
  • Graphics_Designer
  • Replication
  • TemplateControlAPL
6 respuestas