WinCC 7.5 @AlarmOneLine.PDL Column Width Override Fix

David Krause15 min read
SiemensTroubleshootingWinCC
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Problem Overview

When engineers edit the Siemens WinCC 7.5 SP1 Update 4 standard picture @AlarmOneLine.PDL in the Graphics Designer — typically to resize alarm columns, change fonts, adjust colors, or modify the message block layout — those changes are silently reverted the moment the project is started in Runtime mode. The picture appears correct in the development environment, but in Runtime the embedded WinCC AlarmControl snaps back to the default one-line layout regardless of the saved configuration.

This behavior is reproducible across the standard alarm line pictures @AlarmOneLine.PDL, @AlarmOneline.PDL (alternate casing), and related templates. The issue is not project-specific, computer-specific, or related to the alarm logging database. It is built into the standard picture itself, and any modification made through the standard "right-click → Properties" workflow in the Graphics Designer will be overridden at picture load time.

Engineers typically try the following workarounds before discovering the root cause, all of which fail:

  • Deactivating and re-activating WinCC Runtime from the WinCC Explorer
  • Closing and reopening the Runtime window
  • Re-running the "Adapt Size" function from @Overview.PDL
  • Disabling "Apply Project Setting" in the computer properties dialog
  • Re-compiling the OS and reloading the project to the runtime server
  • Deleting the local *.PNL cache and reloading
  • Re-importing the standard picture from the WinCC installation media

None of these resolve the issue because the override happens inside the picture itself, not in the project configuration or runtime cache.

Root Cause Analysis

The @AlarmOneLine.PDL picture is part of the WinCC standard picture set and is automatically copied into every new project. It contains an embedded WinCC AlarmControl configured to display a single line of the most recent or highest-priority active alarm. The AlarmControl is connected to the project's alarm logging archive and reads its message blocks, colors, and column structure from the central alarm configuration.

Inside the AlarmControl, a C-script is attached to the Object Events → Loaded event. This event fires every time the picture is loaded into a picture window. The C-script invokes a project-internal function named SetAlarmControlWidth (sometimes named SetAlarmControlWidthEx or GRA_AlarmOneLine_SetWidth depending on the WinCC version and installed options). The function reads the current picture window dimensions, the runtime screen resolution, and the configured font metrics, then programmatically sets the column widths of the AlarmControl to produce a compact one-line layout.

Because the C-script executes after the static configuration is read from the PDL file, any column width value stored in the PDL is immediately overwritten. The script runs on every picture load, which means the override is applied every time the operator navigates away from and back to the alarm overview, and also on the initial project start.

The C-script is intentionally elaborate. It typically contains several hundred lines of C code, including conditional branches for different alarm classes, font scaling calculations, color table references, and tag reads. This complexity is what causes many engineers to give up trying to modify the script directly and accept the default layout instead.

Identifying the C-Script Override

Before applying the fix, confirm that the SetAlarmControlWidth function is present and active in your project. The function name and exact location have remained stable across WinCC 7.0 through WinCC 7.5 SP1 Update 4, but the parameter list may differ slightly between service packs.

  1. Open the WinCC Explorer and select your project.
  2. Right-click the project name and choose Open in Graphics Designer, or launch the Graphics Designer from the Start menu and open the project.
  3. In the Graphics Designer, select File → Open and navigate to the project root or the GraCS subfolder.
  4. Open @AlarmOneLine.PDL. If the file is not visible, change the file filter to "All files (*.*)".
  5. The picture contains a single WinCC AlarmControl. Click once on the AlarmControl to select it.
  6. Right-click the AlarmControl and choose Properties.
  7. In the Properties dialog, click the Events tab.
  8. Expand the Object Events tree node.
  9. Locate the Loaded event. A C-action should be visible with a function call to SetAlarmControlWidth or a similarly named function.
  10. Double-click the C-action to open the script editor. Read through the script to confirm the function name and parameter list.
Note: In WinCC 7.5 SP1 Update 4, the C-action on the Loaded event typically begins with a comment block describing the function's purpose, followed by the function call. The function may be defined in the same script or in a separate project function under "Project Functions" in the WinCC Explorer.

If no C-action is present on the Loaded event, the override is not the cause of your issue. Check whether the picture is being replaced at runtime by a project-internal dynamic picture call, or whether the AlarmControl is bound to a different alarm configuration source.

Solution: Disabling the SetAlarmControlWidth Override

Three approaches are available, in order of increasing preservation of the original dynamic behavior.

Option A — Comment Out the Function Call

This is the safest approach. It preserves the C-script for future reference but prevents the function from executing.

  1. Open @AlarmOneLine.PDL in the Graphics Designer as described in the previous section.
  2. Navigate to Properties → Events → Object Events → Loaded.
  3. Double-click the C-action to open the script editor.
  4. Locate the call to SetAlarmControlWidth(...). In WinCC 7.5 SP1, the call usually appears near the end of the script, after a series of variable declarations and tag reads.
  5. Add comment markers around the call. In C-syntax used by WinCC, use /* and */ for block comments or // for line comments.

Example structure (do not copy verbatim — adapt to the actual code in your project):

// --- Original C-action on AlarmControl.Loaded ---
// Comment added to disable dynamic column width override
// SetAlarmControlWidth(szPicName, szAlarmControlName, nColumnCount);

/*
  The full C-action body is preserved below for future reference.
  The SetAlarmControlWidth function recalculates AlarmControl column
  widths based on picture window size and font metrics. Disabling
  this call allows static column widths configured in the
  Graphics Designer to take effect at runtime.
*/
  1. Click OK to close the script editor.
  2. Click OK again to close the Properties dialog.
  3. Save the picture (File → Save or Ctrl+S).
  4. Activate WinCC Runtime and verify that the AlarmControl columns now display at the widths you configured.

Option B — Delete the C-Action Entirely

This approach is cleaner and produces a smaller PDL file, but eliminates the dynamic resize behavior permanently.

  1. Open the Loaded event of the AlarmControl as described above.
  2. Select the entire C-action in the script editor.
  3. Delete the contents of the action field, or right-click and select Remove Action if available.
  4. Confirm that the event shows "No action" or is empty.
  5. Save the picture and reload runtime.

This option is appropriate when the runtime screen resolution is fixed (for example, a 1920×1080 control room with a single monitor layout) and the picture will not be displayed in a picture window that is resized at runtime.

Option C — Adjust the Script to Preserve Custom Widths

For projects where dynamic resizing is still desired but with custom defaults, modify the function to skip width assignment under specific conditions. A common pattern is to check a project tag that indicates a custom layout mode:

// Conceptual structure (adapt to the actual SetAlarmControlWidth implementation)
if (GetTagBit("CustomAlarmLayout") == 1) {
    // Custom layout flag is set — skip dynamic width assignment
    return;
}
// Original dynamic width assignment code follows...
SetAlarmControlWidth(szPicName, szAlarmControlName, nColumnCount);

This approach requires deeper familiarity with the C-script and the WinCC C API, and is recommended only for engineers who have already analyzed the full source of the SetAlarmControlWidth function in their project.

Caution: Editing standard PDL pictures modifies the project file @AlarmOneLine.PDL directly. Always back up the original file in <Project>\GraCS\ before saving changes. Upgrading WinCC, installing service packs, or restoring the picture from the installation media will overwrite your modifications. Document the change in your project change log and consider storing a project-specific copy under a different filename (for example, @AlarmOneLine_Custom.PDL) and referencing it from the overview picture instead.

Verification Procedure

After applying the fix, validate the result with the following checks before declaring the issue resolved.

  1. Activate WinCC Runtime from the WinCC Explorer.
  2. Open the alarm line picture from the overview or by direct picture call.
  3. Visually confirm the column widths match the Graphics Designer layout.
  4. Trigger several alarms with varying message text length, alarm class, and priority to verify the columns do not snap back to defaults.
  5. Switch the runtime window between maximized, restored, and resized states. With Option A or B, the columns should remain static. With Option C, the columns should follow the adjusted logic.
  6. Navigate away from the alarm picture and back. The custom widths should persist.
  7. Deactivate and reactivate runtime to confirm the change is persistent across runtime restarts.
  8. Check the WinCC diagnostic files for new errors. The relevant files are WinCC_Sys_<computername>.log in the project's Diagnostics folder and the APLog output in the same location.

If the columns still revert to defaults, re-check the C-action on the Loaded event. A common mistake is commenting out the wrong line — the function may be called from a helper function rather than directly from the Loaded event. Use the WinCC script debugger to step through the Loaded event and identify the actual call site.

Differences from WinCC Unified (TIA Portal)

In WinCC Unified, the alarm line is implemented as a write-protected screen object that displays up to three of the most recent or important active alarms based on configurable criteria. The behavior of standard pictures and C-script overrides is fundamentally different in the Unified architecture. Configuration is handled through the screen object properties in the TIA Portal inspector, not via embedded C-scripts in a PDL file. The TIA Portal V20 update readme documents improvements to the alarm line screen object in WinCC Unified, including better default behavior and additional configuration options for engineers migrating from classic WinCC.

Engineers migrating projects from WinCC 7.x to Unified should not attempt to transplant the SetAlarmControlWidth workaround. Instead, configure the alarm line screen object directly through the TIA Portal interface, setting column widths, fonts, and colors in the screen object properties.

Project Setting: "Apply Project Setting"

The "Apply Project Setting" option is located in the computer properties dialog under WinCC Explorer → Computer → Properties → Graphics Runtime. When enabled, the AlarmControl reads its column configuration from the project's central alarm logging settings (configured in the Alarm Logging editor). When disabled, the AlarmControl uses the column configuration stored in the AlarmControl's own properties.

Disabling "Apply Project Setting" does not bypass the C-script override. The two mechanisms are independent. Even with "Apply Project Setting" disabled, the SetAlarmControlWidth C-script will still execute on the Loaded event and override the AlarmControl's column widths. Engineers who believe disabling this option will fix the issue are misdiagnosing the root cause.

@Overview.PDL "Adapt Size" Action

The @Overview.PDL picture is the standard start picture for WinCC Runtime. It contains a picture window that fills the runtime window and displays the user's main process picture. The "Adapt Size" function, typically attached to a button or hotkey, resizes the picture window to match the current runtime window dimensions. This is useful when the operator resizes the runtime window manually.

"Adapt Size" does not modify column widths inside the AlarmControl. It only resizes the picture window. Re-running "Adapt Size" will not recover custom column widths once the C-script has executed, because the C-script runs independently of the picture window resize event.

Field-Proven Caveats

The following caveats are based on field experience with WinCC 7.0 through 7.5 SP1 Update 4 deployments across multiple industries.

  • Multi-resolution deployments: Always test column width changes at multiple runtime resolutions (1920×1080, 1366×768, 2560×1440, and any operator station resolutions in use) if the picture is displayed in a multi-monitor control room. With Option A or B, the columns will not adapt to resolution changes; with Option C, the adapted script must be validated at each resolution.
  • Redundant WinCC servers: If the project uses redundant WinCC servers, the modified @AlarmOneLine.PDL must be copied to both servers' GraCS folders to maintain consistency during failover. After a failover, the picture will be loaded from the new active server's file system.
  • Hotfix re-introduction: Some WinCC hotfixes (particularly those addressing alarm control column drift or display corruption) re-introduce the C-script override even on previously modified pictures. Verify after any WinCC update or hotfix installation that your modifications are still in place. The Windows Event Log and the WinCC installation log will record the hotfix application.
  • Missing tag errors: The C-script may reference project tags that do not exist in your project, particularly if the script was designed for a project with a larger tag namespace. Comment it out before troubleshooting missing-tag errors in the WinCC diagnostic file WinCC_Sys_<computername>.log. The script will fail silently and the AlarmControl may not display any alarms if a critical tag is missing.
  • Project migration: When migrating a project from an older WinCC version (7.0, 7.3) to 7.5 SP1, the standard pictures may be overwritten by the migration wizard. Re-apply the C-script modification after the migration completes.
  • Web Navigator and WebUX: The @AlarmOneLine.PDL picture is also used by WinCC Web Navigator and WebUX clients. Modifications made to the picture will affect web clients as well. Test in both the full Runtime client and the web client before deploying the change to production.

Diagnostic and Logging Information

When troubleshooting column width issues in @AlarmOneLine.PDL, the following diagnostic sources are useful:

Source Location Content
WinCC Syslog <Project>\Diagnostics\WinCC_Sys_<computername>.log Runtime errors, tag read failures, script errors
WinCC APLog <Project>\Diagnostics\APLog\<computername>_*.log Alarm control specific events and errors
Windows Event Log Event Viewer → Application WinCC service start/stop, hotfix installations
Graphics Designer log <Project>\GraCS\*.log Picture compilation and save events
Script debugger output Graphics Designer → Tools → Script Debugger Step-by-step C-script execution trace

To enable verbose logging for the AlarmControl, add a registry entry under HKEY_LOCAL_MACHINE\SOFTWARE\Siemens\WinCC\Diagnostics with the value name AlarmControlTrace and value data 1. Restart the WinCC Runtime service after applying the registry change.

Troubleshooting Matrix

Symptom Likely Cause Recommended Action
Column widths revert in Runtime SetAlarmControlWidth C-script on Loaded event Comment out or delete the C-action (Option A or B)
AlarmControl shows no alarms Missing alarm logging tag or wrong archive source Verify alarm logging configuration and tag connection
Column widths change when runtime window is resized Dynamic resize script still active Verify the C-action is fully disabled; check for resize event handlers
Modification lost after WinCC update Standard picture overwritten by installation Re-apply modification after update; consider storing custom copy with different filename
Columns correct on one server, wrong on the other Redundant server file mismatch Copy modified PDL to both servers' GraCS folders
Columns correct in full client, wrong in web client Web client uses different picture cache Clear web client cache and re-publish; verify picture name in WebUX configuration
C-script editor disabled (grayed out) Picture opened read-only or from installation media Close and re-open from project GraCS folder, not installation path

Related Standard Pictures

The same C-script override pattern may exist in other WinCC standard pictures. The following pictures have been identified as containing similar dynamic configuration scripts in WinCC 7.5 SP1:

  • @AlarmOneline.PDL — alternate spelling of the alarm line picture
  • @AlarmMultiLine.PDL — multi-line alarm overview
  • @AlarmControl.PDL — generic alarm control picture
  • @TrendOneLine.PDL — single-line trend display
  • @Overview.PDL — standard overview picture (contains "Adapt Size" function)

Engineers who need to customize multiple standard pictures should plan the modifications as a single change package, back up all originals, and document each modification in the project change log.

Performance Considerations

Disabling the SetAlarmControlWidth C-script has a minor positive performance impact: the AlarmControl loads slightly faster because the column width calculation step is skipped. In high-performance control rooms with frequent picture navigation, this may be noticeable on older operator stations. For modern hardware, the difference is negligible.

If Option C is used (modified script with conditional skip), the performance impact is minimal — only a single tag read and conditional branch are added per picture load.

Alternative: Project-Specific Custom Picture

For projects that require extensive AlarmControl customization, consider creating a project-specific picture rather than modifying the standard @AlarmOneLine.PDL. The procedure is:

  1. Create a new PDL file in the project GraCS folder, for example @AlarmOneLine_Custom.PDL.
  2. Insert a new WinCC AlarmControl into the picture.
  3. Configure column widths, fonts, colors, and message blocks as required.
  4. Do not attach any C-script to the Loaded event (or attach a minimal script that performs only the desired custom logic).
  5. Update @Overview.PDL or the relevant navigation logic to reference the custom picture instead of the standard one.

This approach isolates the customization from the standard picture set, making it immune to WinCC updates and hotfixes. The trade-off is that you lose the dynamic resize behavior entirely, and you must maintain the picture as part of your project.

FAQ

Why do my Graphics Designer changes to @AlarmOneLine.PDL not appear in WinCC 7.5 runtime?

The AlarmControl inside @AlarmOneLine.PDL has a C-script on the Object Events → Loaded event that calls SetAlarmControlWidth. This function recalculates column widths at load time and overrides any static configuration. Comment out or delete the function call to retain custom widths.

Will disabling "Apply Project Setting" fix the column width override?

No. "Apply Project Setting" controls whether the AlarmControl reads column defaults from the project's alarm logging configuration. It does not affect the SetAlarmControlWidth C-script, which runs regardless of this setting.

Is it safe to delete the C-script in @AlarmOneLine.PDL?

Yes, but back up the original file first. Deleting the script disables dynamic column resizing, which may cause the alarm line to render incorrectly on monitors with very different resolutions. For most single-resolution control rooms, deletion is the cleanest solution.

Where is the @AlarmOneLine.PDL file located in a WinCC 7.5 project?

The file is stored in the project's GraCS folder, typically at <ProjectPath>\GraCS\@AlarmOneLine.PDL. The same file exists in the WinCC installation directory under WinCC\Templates\GraCS\ and is copied into new projects at creation.

Does this issue apply to WinCC Unified in TIA Portal?

No. WinCC Unified uses a different alarm line screen object whose properties are configured through the TIA Portal interface, not via embedded C-scripts. Engineers migrating from WinCC 7.x should re-implement column customization using the Unified screen object properties. See the TIA Portal V20 update readme for details on the Unified alarm line improvements.

Back to blog