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
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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
-
Configure the Color Parameter on the AS Technological Block:
a. Open the target CFC chart (e.g., containingMonDiLorMonAnL).
b. Locate input parameterColor.
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) toColor.
-
Execute AS-OS Compilation:
a. In SIMATIC Manager, select the OS station and runCompile OS.
b. Confirm that structure tags forStatus3are updated in the WinCC Tag Management database. -
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'sStatus3property to the block's.Status3tag.
d. Under the propertyBackColor->Dynamic DialogorC-Action, invoke the standard APL scriptSetColorStatus. -
Customizing Central Color Palettes (Optional):
a. Open@GlobalData.pdlfrom 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.pdland distribute to OS servers and clients.
Verification
- In CFC test mode, change the
Colorinput onMonDiLfrom0to2. - Verify in CFC that
Status3reflects the updated bit pattern in bits 16–18. - Open the corresponding WinCC graphic picture in OS Runtime.
- Confirm that the graphic object immediately transitions from default gray to yellow.
- Test inputs
3(red),4(blue), and5(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
- SIMATIC PCS 7 Advanced Process Library (APL) Function Manual
- SIMATIC PCS 7 OS Process Control System Manual (V9.0/V9.1)
- WinCC V7.5 Scripting: VBS, ANSI-C, VBA Programming Manual
Related Articles
- Customizing APL Block Icon EMF+ Colors and MonDiL Background Appearance
- Interconnecting APL Channel Drivers (Pcs7AnIn, Pcs7DiIn, Pcs7AnOu) with Monitoring Blocks
- Configuring Plant Hierarchy AS-OS Assignments and Reference Stations
Related Tags
- APL
- SetColorStatus
- Status3
- Color Management
- WinCC Graphics
- MonDiL