Customizing WinCC Picture Tree Selection Colors and Preventing OS Compile Overwriting of @PTN0 and @logo

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

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:

  1. 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.pdl to @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.

  2. 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-script SSMGetButtonColor.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.

  3. 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*.pdl in the local GraCS directory with freshly compiled picture trees derived from the Plant Hierarchy.
    - @logo.pdl is controlled by the OS Project Editor (OSPE). If OSPE runs or basic data is refreshed, OSPE restores @logo.pdl from 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

  1. In WinCC Explorer, open Global Script -> C-Editor.
  2. Navigate to Standard Functions -> Split Screen Manager.
  3. Locate and open SSMGetButtonColor.fct.
  4. Locate the section handling the active button index (giButtonIndex[nMonitor] == nObjIndex).
  5. Replace the default cyan/blue RGB code (RGB(0, 255, 255)) with your desired custom color (e.g., RGB(0, 200, 0) for green).
  6. Save the function (File -> Save).
  7. In the C-Editor menu, select Options -> Regenerate Header to compile the script change into the runtime header cache.

Part 2: Protecting @logo.pdl from OSPE Overwrites

  1. In Graphics Designer, customize @logo.pdl with your company logo and required fonts.
  2. Save @logo.pdl in the project GraCS folder.
  3. Open OS Project Editor.
  4. Go to the Basic Data tab.
  5. Scroll through the file replacement list to locate @logo.pdl.
  6. UNCHECK the checkbox next to @logo.pdl. This instructs OSPE to preserve your local project copy during future runs.
  7. Click OK.

Part 3: Managing @PTN*.pdl Compilation

  1. Do NOT attempt to customize colors or fonts by manually editing @PTN0.pdl directly in Graphics Designer, as Picture Tree Manager will overwrite it.
  2. Rely on the script changes in SSMGetButtonColor.fct to control button colors dynamically across all @PTN*.pdl sublevels.
  3. When compiling the OS from SIMATIC Manager, if the Plant Hierarchy structure has not changed, uncheck the Picture Tree option in the OS compile wizard to avoid unnecessary picture tree regeneration.

Verification

Verify color persistence and compilation protection:

  1. 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.

  2. 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.

  3. Logo Protection Test: Run OS Project Editor. Inspect @logo.pdl in 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

Related Articles

Related Tags

  • Picture Tree
  • Split Screen Manager
  • SSMGetButtonColor
  • @PTN0
  • @logo
  • OS Project Editor
20 respuestas