Customizing WinCC Picture Tree Selection Colors and Preventing OS Compile Overwriting of @PTN0 and @logo
To customize the active selection color of picture tree navigation buttons in SIMATIC PCS 7, edit the Split Screen Manager (SSM) C-script SSMGetButtonColor.fct (or SSMSetButtonColor.fct) located under WinCC\aplib\Split Screen Manager, modify the RGB return value for the selected state, and regenerate script headers (Options -> Regenerate Header). To prevent OS compilation from overwriting @PTN0.pdl and @logo.pdl: (1) For @PTN0.pdl, modify the template in the installation Base_Data_Pool or uncheck 'Picture Tree' during OS compile; and (2) For @logo.pdl, configure your custom graphic in OS Project Editor or uncheck @logo.pdl in the OS Project Editor Basic Data tab.
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
In SIMATIC PCS 7 Operator Stations, the multi-tier navigation hierarchy—comprising top-level plant area buttons and sublevel picture hierarchy buttons—is automatically generated and managed by the Split Screen Manager (SSM) and Picture Tree Manager (PTM). Plant operators and graphic designers frequently seek to customize the default blue highlight color that illuminates the active selected picture button, aligning it with corporate design standards. However, engineers encounter two major technical hurdles: modifications made to the main area buttons in @AreaButtons.pdl do not propagate to sublevel hierarchy buttons in @PTN0.pdl, and subsequent OS compilations or OS Project Editor runs unexpectedly overwrite manual edits made to @PTN0.pdl and @logo.pdl. This article provides the script architecture and template management rules needed for permanent HMI styling.
Architecture and Fundamental Mechanics
The navigation and graphics generation framework in PCS 7 relies on automated compilation and runtime script coordination:
-
Picture Tree Architecture (@AreaButtons vs. @PTN*.pdl):
- Main Area Buttons (@AreaButtons.pdl): Renders the top-level Plant Hierarchy areas across the upper navigation bar. It is statically structured by OS Project Editor based on configured screen layouts.
- Sublevel Hierarchy Containers (@PTN0.pdlto@PTN4.pdl): Render nested graphic pictures beneath the main areas. These pictures are dynamically generated machine code produced by the Picture Tree Manager during OS compilation. They do not maintain static button properties; instead, Picture Tree Manager wipes and regenerates them from internal templates upon every compile. -
The Color Determination Engine (
SSMGetButtonColor.fct):
- Navigation button colors are not configured via static WinCC object background properties. Instead, Split Screen Manager cyclically executes the global C-scriptSSMGetButtonColor.fct.
- The function evaluates whether a button is unselected, selected (active on a screen monitor), or in an alarm state:
c // Selected state for active monitor giButtonIndex[nMonitor] = nObjIndex; return (RGB(0, 255, 0)); // Custom green active color
- Modifying this script centrally alters selection colors across both main area buttons and sublevel picture tree buttons, provided script headers are regenerated. -
OS Compilation Overwrite Mechanics:
- During OS compilation from SIMATIC Manager, checking the option Picture Tree instructs the compiler to invoke the Picture Tree Manager, which overwrites@PTN*.pdlin the localGraCSdirectory with freshly compiled picture trees derived from the Plant Hierarchy.
-@logo.pdlis controlled by the OS Project Editor (OSPE). If OSPE runs or basic data is refreshed, OSPE restores@logo.pdlfrom the template pool (Siemens\WinCC\Options\PDL\Base_Data_Pool).
Step-by-Step Implementation Procedure
Implement permanent color customization and protect custom pictures using the following procedure:
Part 1: Central Navigation Button Color Customization via C-Script
- In WinCC Explorer, open
Global Script -> C-Editor. - Navigate to
Standard Functions -> Split Screen Manager. - Locate and open
SSMGetButtonColor.fct. - Locate the section handling the active button index (
giButtonIndex[nMonitor] == nObjIndex). - Replace the default cyan/blue RGB code (
RGB(0, 255, 255)) with your desired custom color (e.g.,RGB(0, 200, 0)for green). - Save the function (
File -> Save). - In the C-Editor menu, select
Options -> Regenerate Headerto compile the script change into the runtime header cache.
Part 2: Protecting @logo.pdl from OSPE Overwrites
- In Graphics Designer, customize
@logo.pdlwith your company logo and required fonts. - Save
@logo.pdlin the projectGraCSfolder. - Open
OS Project Editor. - Go to the
Basic Datatab. - Scroll through the file replacement list to locate
@logo.pdl. - UNCHECK the checkbox next to
@logo.pdl. This instructs OSPE to preserve your local project copy during future runs. - Click
OK.
Part 3: Managing @PTN*.pdl Compilation
- Do NOT attempt to customize colors or fonts by manually editing
@PTN0.pdldirectly in Graphics Designer, as Picture Tree Manager will overwrite it. - Rely on the script changes in
SSMGetButtonColor.fctto control button colors dynamically across all@PTN*.pdlsublevels. - When compiling the OS from SIMATIC Manager, if the Plant Hierarchy structure has not changed, uncheck the
Picture Treeoption in the OS compile wizard to avoid unnecessary picture tree regeneration.
Verification
Verify color persistence and compilation protection:
-
Runtime Navigation Test: Launch WinCC Runtime. Click through top-level area buttons and nested sublevel hierarchy buttons. Confirm that when a picture is selected, its navigation button highlights in the configured custom green color across all hierarchy tiers.
-
OS Compile Resistance: In SIMATIC Manager, perform an OS Changes-Only compilation. Open WinCC Runtime again. Confirm that the custom selection color remains intact and did not revert.
-
Logo Protection Test: Run OS Project Editor. Inspect
@logo.pdlin Graphics Designer. Confirm that your company logo and font styling were preserved without reverting to factory defaults.
Limitations and Operational Precautions
Never modify scripts inside the global installation directory without creating a backup of the original SSMGetButtonColor.fct. Software updates or PCS 7 Service Packs will replace global scripts; store project-specific C-scripts inside the local OS project library folder to ensure portability. Furthermore, avoid setting active button colors to red or yellow, as these colors are reserved by PCS 7 for unacknowledged alarm and warning states.
Engineer FAQ
Why did my changes to @PTN0.pdl disappear after compiling the OS?
@PTN0.pdl is a dynamically generated file recreated from scratch by Picture Tree Manager during OS compilation. Direct edits to the PDL file will always be overwritten upon compilation.
Where is the active button selection color evaluated in C-scripts?
It is evaluated in the global C-script SSMGetButtonColor.fct under Split Screen Manager, which returns an RGB color value based on button selection and alarm status.
Why must I select 'Regenerate Header' after editing a C-script?
WinCC caches compiled function headers in .h files. Selecting 'Regenerate Header' recompiles all global script signatures so the runtime graphics engine executes the updated code.
How do I prevent OS Project Editor from replacing @logo.pdl?
In OS Project Editor -> Basic Data tab, find @logo.pdl in the table and uncheck its replacement box.
Can I change the font style of sublevel buttons permanently?
Font styles across all picture tree buttons are governed by Split Screen Manager templates in Base_Data_Pool. Modifying the template typical in the pool applies standard fonts across all generated @PTN*.pdl screens.
Technical References
- SIMATIC PCS 7 Operator Station Engineering Manual V9.0
- WinCC V7.5 Scripting: ANSI-C Function Reference Manual
- SIMATIC PCS 7 OS Project Editor Configuration Guide
Related Articles
- Updating Faceplates and OS Project Editor Basic Data Following PCS 7 Migration
- Creating Custom Block Icons and Automating OS Picture Placement from CFC in PCS 7
- Diagnosing Faceplate Button Freezing and Focus Locks in Custom WinCC Scripts
Related Tags
- Picture Tree
- Split Screen Manager
- SSMGetButtonColor
- @PTN0
- @logo
- OS Project Editor