Preventing Value[X]BackColor Resets and Customizing APL Block Icon Colors in PCS 7
In SIMATIC PCS 7 WinCC, customized background colors defined on an APL block icon (such as Value[X]BackColor) revert to default white and green states after compiling the OS or running 'Create/Update Block Icons' because the wizard regenerates internal dynamic scripts from the master typical template. Direct edits to internal shape properties are overwritten during synchronization. To permanently enforce custom color behavior, extend the block icon Customized Object using the internal DataSet1 object to expose a custom UserStatus interface property, bind this property to the instance .UserStatus tag via dot-syntax, and attach an event script or dynamic dialog to property Status1 to evaluate UserStatus and assign custom background colors dynamically.
Table of Contents
- APL Block Icon Internal Graphic Structure and DataSet Mechanism
- Why OS Compilation Overwrites Value[X]BackColor Properties
- Customized Object Property Configuration and Dynamic Scripting Matrix
- Step-by-Step Procedure to Bind UserStatus and Persist Custom Colors
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
APL Block Icon Internal Graphic Structure and DataSet Mechanism
In the SIMATIC PCS 7 Advanced Process Library (APL), block icons placed on process graphics are constructed as WinCC Customized Objects (Anwenderobjekte). A customized object encapsulates multiple underlying WinCC shapes—such as rectangles, text fields, and static icons—into a unified technological entity with a defined external interface.
To store instance-specific configurations that do not directly correspond to standard graphic properties (such as custom operating states, multi-color modes, or user-defined statuses), Siemens embeds an invisible helper object named DataSet1 inside every APL block icon. DataSet1 provides internal integer, string, and floating-point registers (Int1 through Int50). When an engineer edits the customized object, these internal registers can be promoted to the external interface and linked to WinCC process tags.
When the block icon is instantiated on a process picture, the WinCC OS compilation wizard scans the interface, replaces relative tag bindings (e.g., .Status1, .UserStatus) with the fully qualified tag path (Plant/Area/Chart/Block.UserStatus), and binds runtime updates to the icon.
Why OS Compilation Overwrites Value[X]BackColor Properties
Engineers frequently attempt to customize block icon states by opening the process graphic, selecting the block icon, and directly modifying static colors on properties like Value[X]BackColor (or changing colors inside dynamic dialogs). However, upon executing Create/Update Block Icons (or compiling the OS with block icon generation enabled), all custom colors instantly vanish, reverting to default white (stopped/off) and green (running/on).
This behavior occurs because of the PCS 7 typical synchronization mechanism:
-
Template-Driven Overwrite: The block icon wizard treats
@PCS7TypicalsAPLV8.pdl(or project typicals) as the absolute source of truth. During updating, the wizard copies the property definitions and internal dynamic scripts from the typical template, overwriting any local modifications made to individual instances. -
Dynamic Dialog Variable Prefix Limitations: In WinCC faceplates, scripts and dynamic dialogs use tag prefixing (
TagPrefix). However, block icons do not use tag prefixing at runtime; the wizard must physically write the full tag name into the dynamic connection during generation. If an engineer enters~.userstatus~directly inside an internal dynamic dialog, the compiler fails to resolve the tag, prompts that the tag does not exist, and resets the expression. -
Static Initialization Overwrite: APL icons utilize internal C-scripts that force default color values upon picture opening (
PicOpen). Unless the color logic is tied to an evaluated status tag, the script restores the factory palette.
Customized Object Property Configuration and Dynamic Scripting Matrix
The following table summarizes the property mapping, DataSet allocation, and event triggers required for custom color control:
DataSet1 -> Int46Int)Links -> UserStatusUserStatus on Customized Object interface.UserStatusStatus1 -> On ChangeBackColor / Color999Step-by-Step Procedure to Bind UserStatus and Persist Custom Colors
To customize block icon background colors and ensure they persist across OS compiles:
-
Add an Internal Property Register to
DataSet1:
- In Graphics Designer, open your project template file (e.g.,@PCS7Typicals_Project.pdl).
- Right-click the target APL block icon and select Customized Object -> Edit (Anwenderobjekt bearbeiten).
- In the Object list, select the object namedDataSet1.
- Right-clickDataSet1and select Configuration Dialog.
- Click Add to create a new register; set the data type to Int (note the assigned register name, e.g.,Int46). Click OK.
- Select all parts of the block icon with the mouse lasso, right-click, and select Customized Object -> Finish Editing. -
Expose
UserStatuson the External Interface:
- Right-click the assembled block icon and select Configuration Dialog.
- In the center list, selectDataSet1; in the right pane, locate your new register (e.g.,Int46).
- DragInt46to the left pane and drop it under property theme Links.
- Right-click the newly added property, select Properties, and enterUserStatusfor both Attribute Name and Property Name.
- Click OK to close the configuration dialog. -
Configure Dynamic Connection and Event Scripting:
- In the block icon properties, navigate to Links -> UserStatus.
- In the Dynamic column, enter.UserStatus(dot-prefixed tag). This ensures the OS wizard automatically binds<Chart/Block>.UserStatusduring generation.
- Switch to the Events tab on the Customized Object.
- Select property Status1 (which is statically initialized to999to guarantee an event trigger upon screen load), and add a change event action (VBScript or C-Action):
c // C-Action attached to Status1 Change Event long userStat = GetPropDouble(lpszPictureName, lpszObjectName, "UserStatus"); if (userStat == 1) { SetPropDouble(lpszPictureName, "Rectangle1", "BackColor", 0x0000FFFF); // Custom Yellow } else if (userStat == 2) { SetPropDouble(lpszPictureName, "Rectangle1", "BackColor", 0x00FF00FF); // Custom Magenta } else { SetPropDouble(lpszPictureName, "Rectangle1", "BackColor", 0x0000FF00); // Standard Green }
- Save@PCS7Typicals_Project.pdl. -
Re-generate Block Icons via SIMATIC Manager:
- In SIMATIC Manager, select the plant hierarchy folder and execute Options -> Plant Hierarchy -> Create/Update Block Icons.
- Open the target process graphic; confirm that the block icon now features the new interface property and custom script without reverting.
Verification
Verify persistent color behavior:
1. Open the CFC chart containing the block; enter a test value (e.g., 1 or 2) into block input UserStatus and download changes.
2. Launch WinCC Runtime; open the process graphic and verify that the block icon displays your custom color immediately upon picture opening.
3. In SIMATIC Manager, perform a full OS Compile and re-run Create/Update Block Icons.
4. Re-open WinCC Runtime; confirm that the customized background color remains intact and did not revert to white/green.
Limitations and Operational Precautions
- Never Edit Master Typical Directly: Do not apply changes to
@PCS7TypicalsAPLV8.pdl. Always use project typical files (@PCS7Typicals_Project.pdl) to prevent loss during PCS 7 updates. - Tag Name Dot-Prefix Rule: Only properties exposed on the Customized Object interface containing a dot prefix (
.TagName) are completed by the block icon generator wizard. - Ergonomic Alarm Hierarchy: Ensure custom background colors do not conflict with standardized APL alarm and warning colors (Red = Alarm, Yellow = Warning) to prevent operator confusion.
Engineer FAQ
Why does the OS compilation wizard reset my block icon colors?
The wizard replaces local block icon instances with clean templates from the typical file, wiping any direct color edits made on individual process screens.
What is the DataSet1 object inside APL block icons?
DataSet1 is an internal invisible object containing integer and string registers used to store custom properties that are not natively part of standard WinCC graphic shapes.
Can I use a Dynamic Dialog instead of a script to change colors?
Yes, but you must bind the Dynamic Dialog to the exposed UserStatus interface property of the customized object rather than directly typing a relative tag name.
Why attach the color update script to Status1 instead of UserStatus?
Status1 is pre-loaded with static value 999, which guarantees that a change event fires upon picture opening, forcing the color to render immediately.
Technical References
- SIMATIC PCS 7 APL Style Guide Engineering Manual (A5E03598762-01)
- SIMATIC HMI WinCC V7.4 Graphics Designer Manual (A5E37536408-AA)
- Siemens Industry Online Support: Customizing APL Block Icons and Typicals (Entry ID: 109780813)
Related Articles
- Customizing APL Block Icons Without Breaking Automatic Wizard Interconnections in PCS 7
- Disabling OK Confirmation Buttons on APL Faceplates in SIMATIC PCS 7
- Developing Custom APL Block Icons and Faceplates Linked to SCL Function Blocks in PCS 7
Related Tags
- Block Icons
- APL
- ValueBackColor
- DataSet1
- UserStatus
- Graphics Designer
- Customized Objects