Resolving AxRulerControl Sizing and Width Limit Clamping in WinCC Trend Displays

Resolving AxRulerControl Sizing and Width Limit Clamping in WinCC Trend Displays

When customizing the WinCC AxRulerControl in SIMATIC PCS 7 or WinCC V7.5, ruler window dimensions fail to expand when internal C-scripts enforce hard-coded width limits. In standard WinCC trend screen layouts, template scripts (such as the @1001 script) clamp ruler window dimensions to a maximum width of 150 pixels. To expand the ruler display to accommodate longer tag names, high-precision timestamps, or multi-variable values, engineers must modify the clamping threshold within the screen action script and recompile the Graphics Designer picture.

Table of Contents

Architecture of the WinCC AxRulerControl in Process Trend Displays

In SIMATIC PCS 7 and standalone WinCC V7.4 / V7.5, process trends are visualized using an integrated suite of ActiveX controls:

  • WinCC FunctionTrendControl / OnlineTrendControl: Renders the graphical analog curves across user-defined time axes.
  • WinCC AxRulerControl: A companion coordinate measuring control that links dynamically to the trend display. When an operator clicks on a trend curve, the ruler displays an interactive vertical hairline, displaying exact numerical values, timestamps, and curve coordinates in a floating or docked ruler table.
  • Layout Scripting Framework: Standard PCS 7 trend layouts (such as @TRC_Trend.pdl or customized popup screens) use background ANSI-C or VBScript routines to automatically resize controls when the parent window is maximized or resized.

Root Cause of Dimension Clamping in Template Scripts

Engineers attempting to increase the width or height of the ruler display in Graphics Designer frequently discover that changes revert or fail to render in runtime:

  • The Hard-Coded Clamping Trap: Within the internal C-action scripts driving the ruler display (specifically scripts associated with event @1001 or layout resizing triggers), Siemens templates implement safety bounds to prevent the ruler from covering the entire trend window.
  • The Threshold: A standard conditional check in the script enforces:
    c if (nRulerWidth > 150) { nRulerWidth = 150; }
  • Consequence: Regardless of properties configured in the ActiveX dialog, the script dynamically overwrites the dimension property at runtime, truncating tag descriptors or forcing horizontal scrollbars.

Step-by-Step Procedure to Modify Script Clamping Limits

To permanently increase ruler dimensions to accommodate complex telemetry:

Step 1: Open the Target Trend Picture in Graphics Designer

  1. In WinCC Explorer, open Graphics Designer.
  2. Open the specific process picture or template hosting the trend control (e.g., @TRC_Trend.pdl or custom user window).
  3. Select the AxRulerControl object in the workspace.

Step 2: Locate the Resizing C-Action Script

  1. Open the Object Properties window for the ruler or picture root.
  2. Select the Event tab.
  3. Check the Property Topics -> Geometry or inspect the Picture Tree -> Open Picture / Size Change events.
  4. Locate the C-script or VBScript triggered on event @1001 or window resize.

Step 3: Modify the Width / Height Threshold

  1. Open the script editor.
  2. Search for the limit assignment:
    c // Original Template Code: if (lWidth > 150) { lWidth = 150; }
  3. Update the maximum allowable limit to the desired width (e.g., 200, 250, or 300 pixels):
    c // Modified Code: if (lWidth > 250) { lWidth = 250; }
  4. Click Compile to verify syntax with 0 errors.
  5. Save the C-script and close the editor.

Adjusting Control Geometry in Graphics Designer

Once the script limit is updated, adjust the static control properties:

  1. In Graphics Designer, double-click the AxRulerControl to open its ActiveX configuration dialog.
  2. Select the Columns tab.
  3. Increase column widths for Tag Name, Value, and Time Stamp so text strings do not wrap or truncate.
  4. Set the default control Width property under Geometry to match the new target size (e.g., 250 pixels).
  5. Save the .pdl picture.

Verification

Confirm proper ruler sizing in runtime:

  1. Launch WinCC Runtime:
    * Open the modified trend screen.
  2. Interactive Ruler Operation:
    * Click on a trend curve to activate the ruler hairline.
    * Verify that the ruler window displays with the expanded width (e.g., 250 pixels).
    * Confirm that long technological tag descriptors (e.g., Plant_Area/Sub_Area/FIC_101/PV_Out) fit completely without truncation.
  3. Window Resizing Check:
    * Resize the trend window; confirm that the script executes cleanly without snapping the ruler back to 150 pixels.

Limitations and Operational Precautions

  • OS Project Editor Overwrite: If the modified script is located within an @ system picture (e.g., @TRC_Trend.pdl), executing the OS Project Editor with picture update options enabled will overwrite custom modifications. Always maintain backups of modified @ screens or save custom templates under unique filenames.
  • Monitor Resolution Considerations: Expanding ruler widths reduces the visible horizontal area for trend curves on smaller operator screens (e.g., 1280x1024). Ensure layouts remain balanced across all target client resolutions.

Engineer FAQ

  • What is the WinCC AxRulerControl used for?
    It is an ActiveX companion control that displays precise numerical values, coordinates, and timestamps for data points selected on a WinCC trend curve.
  • Why does AxRulerControl snap back to a 150-pixel width in runtime?
    Background C-action scripts (such as those tied to event @1001 or window resize) contain hard-coded conditional checks that clamp ruler width to a maximum of 150 pixels.
  • How do I expand the ruler width to fit longer tag names?
    Edit the C-action script driving the ruler, increase the clamping threshold (e.g., from 150 to 250), and save the picture.
  • Does modifying AxRulerControl require stopping WinCC Runtime?
    No, picture modifications in Graphics Designer can be saved and reloaded in runtime immediately without deactivating the project.
  • Can AxRulerControl be used with WinCC OnlineTrendControl?
    Yes, AxRulerControl is designed specifically to interface with WinCC OnlineTrendControl and FunctionTrendControl.
  • What happens to custom picture scripts when OS Project Editor is run?
    If 'Update system pictures' is selected in OS Project Editor, standard Siemens @ pictures are overwritten with factory defaults.
  • Which script event typically handles ruler layout resizing?
    Event @1001 or the picture window Geometry -> Width/Height change events typically execute dynamic sizing scripts.
  • Can I customize which columns appear in the ruler window?
    Yes, in the AxRulerControl properties dialog under the 'Columns' tab, you can enable or disable Curve Name, Tag Name, Value, Time, and Status columns.
  • Does AxRulerControl support multi-touch gestures?
    In modern WinCC releases (V7.5 SP2+), controls support basic touch manipulation, but detailed hairline positioning is typically optimized for mouse or precision touch.
  • Can the ruler export selected coordinates to CSV?
    Yes, the ruler toolbar contains an export function that allows operators to save selected time coordinates and curve values into a CSV text file.

Technical References

  • Siemens Industry Online Support (SIOS) Portal: WinCC V7.5 SP2 - Working with WinCC (Trend and Ruler Controls).
  • SIMATIC WinCC ActiveX Controls Reference Manual, Siemens AG.
  • ANSI-C Scripting in SIMATIC WinCC Information System.

Related Articles

Related Tags

WinCC, AxRulerControl, TrendControl, Graphics Designer, C-Scripting, Sizing Limits, HMI Customization, PCS 7

20 respuestas