Configuring APL Central Color Management and Dynamic Status Color Mapping via SetColorStatus

Configuring APL Central Color Management and Dynamic Status Color Mapping via SetColorStatus

In SIMATIC PCS 7 Advanced Process Library (APL) and WinCC, dynamic object coloring without hardcoded tag addresses is achieved using the central APL color management architecture and the C-script function SetColorStatus. Technological blocks such as MonDiL (FB1848) and MonAnL (FB1845) transmit state information packed inside double-word status tags (such as Status3). Setting the Color parameter in CFC (values 0 to 6) updates specific bit positions within Status3. In WinCC, the standard C-script SetColorStatus reads these status bits and maps them dynamically to central palette colors defined in @GlobalData.pdl or the WinCC Project Property Palettes: 0=Default Gray, 1=White, 2=Yellow, 3=Red, 4=Blue, 5=Green, and 6=Violet.

Table of Contents

Executive Summary

PCS 7 system integrators frequently require dynamic visual feedback on HMI graphic displays—such as changing vessel colors, pipe segment fills, or indicator borders based on process conditions—without manually binding hardcoded PLC tag addresses to every graphic property. In the PCS 7 Advanced Process Library, Siemens provides a standardized central color scheme driven by block status words and WinCC global C functions like SetColorStatus. This architecture ensures consistent corporate styling, simplifies plant-wide color modifications, and eliminates point-to-point HMI script maintenance. This guide explains the internal status bit encoding, the role of SetColorStatus, and how to leverage central palettes for dynamic HMI objects.

Architecture and Fundamental Mechanics

The APL central color management workflow operates across three synchronized system layers:
1. AS Technological Layer (Status Packing in CFC):
APL monitoring blocks (MonDiL, MonAnL, MotL, etc.) incorporate an input parameter named Color (INT, default 0). When an engineer or logic sets Color = 2, the block packs this integer into defined bits of the double-word output Status3 (bits 16 to 18):
- 000 (0): Default / Gray
- 001 (1): White
- 010 (2): Yellow
- 011 (3): Red
- 100 (4): Blue
- 101 (5): Green
- 110 (6): Violet
2. AS-OS Compilation and Tag Connection:
During AS-OS compilation, WinCC creates structure tags containing .Status3. In the WinCC Graphics Designer, the block icon or custom faceplate dynamically binds its Status3 property to the AS tag.
3. WinCC Visualization Layer (SetColorStatus Script):
APL graphic objects utilize internal C actions triggering SetColorStatus(lpszPictureName, lpszObjectName, dwStatus). The function masks bits 16–18 of Status3, queries the global central color palette defined in @GlobalData.pdl or WinCC Design Settings, and applies the corresponding RGB value to the object's BackColor or ForeColor. This decoupling means changing a palette entry in @GlobalData.pdl updates the entire plant's color scheme instantly.

Step-by-Step Implementation Procedure

  1. Configure the Color Parameter on the AS Technological Block:
    a. Open the target CFC chart (e.g., containing MonDiL or MonAnL).
    b. Locate input parameter Color.
    c. Assign the desired integer code (0 to 6) based on technological state:

    • 0: Normal / Base State (Gray)
    • 1: White
    • 2: Warning / Caution (Yellow)
    • 3: Alarm / Fault (Red)
    • 4: Informational / Operator Interaction (Blue)
    • 5: Operational / Running (Green)
    • 6: Special Mode (Violet)
      d. If dynamic color switching is needed, connect technological logic (e.g., recipe selector) to Color.
  2. Execute AS-OS Compilation:
    a. In SIMATIC Manager, select the OS station and run Compile OS.
    b. Confirm that structure tags for Status3 are updated in the WinCC Tag Management database.

  3. Assigning SetColorStatus in WinCC Graphics Designer:
    a. Open the process picture (.pdl) in WinCC Graphics Designer.
    b. Insert the desired graphic object (e.g., customized block icon or dynamic polygon).
    c. In the Object Properties window, link the object's Status3 property to the block's .Status3 tag.
    d. Under the property BackColor -> Dynamic Dialog or C-Action, invoke the standard APL script SetColorStatus.

  4. Customizing Central Color Palettes (Optional):
    a. Open @GlobalData.pdl from the WinCC project directory.
    b. Locate the central color palette definitions and edit the RGB values for indices 0 through 6 if site-specific color standardization is mandated.
    c. Save @GlobalData.pdl and distribute to OS servers and clients.

Verification

  1. In CFC test mode, change the Color input on MonDiL from 0 to 2.
  2. Verify in CFC that Status3 reflects the updated bit pattern in bits 16–18.
  3. Open the corresponding WinCC graphic picture in OS Runtime.
  4. Confirm that the graphic object immediately transitions from default gray to yellow.
  5. Test inputs 3 (red), 4 (blue), and 5 (green) to verify comprehensive palette response.

Limitations and Operational Precautions

Directly modifying system @ pictures (like @GlobalData.pdl) risks having custom palette settings overwritten during future PCS 7 software updates or OS Migrations; always maintain project backup copies of modified @ templates in the GraCS directory.

Engineer FAQ

Where is the SetColorStatus function located in WinCC?

SetColorStatus is a standard APL C-function stored under the Global Script C library (aplib) within the PCS 7 OS project.

What are the standard integer values for the APL Color parameter?

0 = Default/Gray, 1 = White, 2 = Yellow, 3 = Red, 4 = Blue, 5 = Green, and 6 = Violet.

Which status double-word carries the Color code in APL blocks?

In most APL monitoring and control blocks, the Color integer is encoded into bits 16 to 18 of the Status3 output tag.

Can I create custom color codes beyond 0 to 6?

Standard SetColorStatus decodes a 3-bit mask (0–7). Defining additional colors beyond index 6 requires creating custom script extensions or using WinCC Dynamic Dialogs.

Does changing the Color parameter in CFC affect technological interlocks?

No. The Color parameter is strictly a visualization attribute used for operator guidance and has no impact on safety or interlocking logic.

Technical References

Related Articles

Related Tags

  • APL
  • SetColorStatus
  • Status3
  • Color Management
  • WinCC Graphics
  • MonDiL
20 respuestas