Configuring Dynamic Box Width Animation in TIA Portal WinCC V14

David Krause16 min read
HMI ProgrammingSiemensTutorial / How-to
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

Configuring Dynamic Box Width Animation in TIA Portal WinCC V14

When visualizing a continuous production line in TIA Portal WinCC Runtime Advanced or on a Comfort Panel, engineers often need to represent physical parts of varying discrete sizes as graphic rectangles (boxes) on the HMI screen. The box width must track the real length of the part currently occupying a station. The intuitive first approach is a VBScript scheduled by the HMI's tag trigger, but on a Comfort Panel or PC Runtime running TIA Portal V14, this pattern frequently produces the diagnostic event OB request error with the message Cyclic interrupt clock pulse generator 7 / Causing OB: Cyclic interrupt OB (OB 36). The PLC's cyclic interrupt is starved because the HMI is flooding the S7-1500 / S7-1200 tag interface faster than the OB can complete.

This article documents a robust, code-free method using WinCC native Animation with Range (integer) trigger values, scaled to 20 or more boxes tied to an array of integers, with verified cycle-time headroom for OB 35, OB 36, and OB 37 cyclic interrupts. References to official Siemens documentation are linked inline.

Problem Overview

The source requirement is straightforward on the surface: render between 8 and 20 boxes on a WinCC screen, where each box's width is driven by a discrete integer (one of 8 possible values per box, all derived from an array of INTs in the PLC). The boxes represent real pieces entering a layout, so the visualization must track PLC state within one operator-perceptible refresh - typically 100 ms to 200 ms.

The naive implementation is a VBScript that runs on a 100 ms tag trigger and pushes the array values into the rectangle's width property. The problem is twofold:

  1. Script execution on a Comfort Panel is single-threaded with the RT scheduler, so 20 array members processed in 100 ms is borderline even on a TP1200.
  2. Every HMI tag write generates a request to the controller. Twenty writes per script cycle on a 100 ms trigger is 200 PUT/s into the PLC - high enough to contend with the cyclic interrupt for bus time on a shared PROFINET segment, and the first thing to go is OB 36.

WinCC's native Animation subsystem is the correct tool. It runs on the panel's RT scheduler, is read-only toward the PLC, and is designed to scale to hundreds of animated objects on a Comfort Panel without impacting PLC cyclic interrupts.

Prerequisites

  • SIMATIC TIA Portal V14 (V14.0.0.6 or later recommended) with WinCC Advanced V14 SP1 installed. Source: Siemens Support entry ID 109478121 - WinCC V14 installation and communication.
  • SIMATIC S7-1500 (CPU 1511-1 PN or higher recommended) or S7-1200 (CPU 1214C DC/DC/DC FW 4.2 or higher). Source: Siemens S7-1500 product page.
  • WinCC Comfort Panel (TP700, TP900, TP1200, or KP1500) or WinCC Runtime Advanced (PC-based).
  • An array of INT/DINT tags in the PLC sized to the number of visualized boxes - e.g., DB_Conveyor.PieceLength[0..19].
  • A configured HMI connection in TIA Portal between the panel and the PLC. The default S7-1500 / Comfort Panel HMI connection is sufficient.
Compatibility note: The Range (integer) trigger type in WinCC Comfort/Advanced is supported from V13 SP1 onward. TIA Portal V14 introduced the modern Properties Inspector workflow; older V13 SP2 panels running firmware 12.x require the older Animations editor (functionally equivalent). Animation of the Width property is supported on every Comfort Panel target since WinCC Comfort V11.

Root Cause: OB 36 Cyclic Interrupt and the Clock Generator

SIMATIC S7-1500 PLCs expose seven user-configurable cyclic interrupt OBs: OB 30 through OB 38, each with a configurable phase offset and run time. OB 36 is the default 100 ms cyclic interrupt and is commonly used for closed-loop control, fast counting, and time-stamped acquisition. The behavior on S7-1200 is identical except that only OB 30 through OB 38 are available on firmware 4.0 and earlier, and OB 30 was reserved. Source: Siemens Support entry ID 109751833 - S7-1500 organization blocks reference.

Internally, the cyclic-interrupt scheduler is driven by a hardware clock generator. The PLC reports Cyclic interrupt clock pulse generator 7 when the interrupt's call interval has been overrun so severely that the next hardware tick fires before OB 36 has returned to its start address. The PLC raises an OB request error diagnostic buffer entry, sets No relevance for user (Z1) = 0, and increments the OB36_EXECUTION_TIME and OB36_TIME_OF_DAY system tags for the cycle that finally completed.

The error sequence in this application is typically:

  1. VBScript on the HMI fires on a 100 ms tag trigger.
  2. Script calls SmartTags("BoxWidth") = SmartTags("PieceLength") or performs in-script arithmetic on the array element.
  3. Script loops over an array of 20 pieces, performing arithmetic and string conversion in VB.
  4. Each HMI variable write triggers an HMI → PLC tag update, which on a Comfort Panel is a PUT/GET request into the PLC's process image partition.
  5. PLC's process image update blocks OB 36's previous run from completing, tripping clock generator 7.

The HMI script approach is the wrong layer. WinCC has a native, dedicated subsystem for this exact use case: the Animation engine, which is part of the panel's RT scheduler and does not consume PLC cyclic interrupt cycles.

Why VBS Scripts Trip the Clock Generator

WinCC Comfort Panel V14 supports both C-Script (legacy WinCC flexible compatible) and VBScript. Both run in the HMI runtime's user process, not in OB 36. However, every HMI tag write generates a request to the controller. The HMI driver on the panel side performs an S7 PUT for a tag marked with acquisition cyclic on use, which is then processed by the PLC during its process image update window - the same window OB 36 must share.

The PLC cannot preempt OB 36 to handle a single PUT request, but the cumulative load of 20 array tags written by a 100 ms script equals 200 PUT/s, which exceeds the Comfort Panel's acyclic write capacity (typically 100-150 PUT/s sustained) and starts to contend for the same bus time slice as the cyclic interrupt handshake. Source: Siemens Support entry ID 109478121 - WinCC V14 communication diagnostics.

Method HMI runtime load PLC bus load OB 36 safe?
100 ms VBScript writing 20 array tags High ~200 PUT/s + 20 read triggers No - clock generator 7
100 ms C-Script with array index loop Medium-High Same as VBS No - same root cause
Native Animation, Range (integer), Width property Negligible Same as PLC scan, no extra writes Yes
PLC-driven, 100 ms MOV into display DB None Single PUT/s per array member Yes if bus headroom checked
PLC process image update (OB 1) - 1 to 3 ms HMI screen cycle (100 ms default) - 20 tags polled in one acquisition window OB 36 cyclic interrupt (100 ms) - unaffected by HMI animation

Solution: Native Range-Based Animation in WinCC

WinCC's Animation engine evaluates a configured tag once per screen update cycle (default 100 ms on Comfort Panels, configurable down to 50 ms) and applies the resulting value to a graphical property. The Range (integer) trigger type maps discrete integer states to discrete target values - exactly the use case described in the source query: 8 different piece lengths → 8 different box widths.

Key properties of Animation that make it OB-36-safe:

  • Trigger evaluation runs on the panel's RT scheduler, isolated from the PLC's cyclic interrupt system.
  • Read direction only - the panel polls the configured tag at the screen cycle rate, but does not write the trigger tag back to the PLC.
  • For a PLC-driven animation, the HMI simply reads the value; the PLC's OB 1 process image update serves the same data, so no extra HMI → PLC traffic is generated.
  • For 20 boxes, the panel can poll up to 256 tags in a single acquisition cycle (the Comfort Panel tag limit per screen), so the bus load is constant regardless of how many boxes use animation.

Step-by-Step Configuration

  1. Create the PLC-side data block. In TIA Portal, add a new global DB (e.g., DB_Conveyor) with a tag array sized to your visualization count. For 20 boxes: PieceLength : Array[0..19] of INT;. Each value is the discrete integer that drives the box width. The values are updated in your conveyor logic - e.g., L "IPE_PieceLength"; T "DB_Conveyor".PieceLength[i];.
  2. Link the HMI tags to the PLC array. In the HMI tag table, create 20 HMI tags (HMI_PieceLength_00 through HMI_PieceLength_19) with acquisition cycle Cyclic continuous at 1 s (sufficient - animation is triggered at screen cycle, not tag cycle), pointer to DB_Conveyor.PieceLength[0..19]. Source: Siemens TIA Portal V14 tag configuration reference.
  3. Add the rectangle object to the screen. Open your visualization screen. From the Toolbox, drag a Rectangle object to the canvas. Resize once to the median size - this is just the design-time placeholder; runtime width is controlled by animation.
  4. Open the Animation editor. In the Properties pane, switch to the Animations tab. Click Add new animation. Animation 0 is created and the configuration tab opens to the right.
  5. Configure the trigger tag and type. In the Tag field, click the name field and browse to HMI_PieceLength_00. In Setting → Type, select Range (integer). The Range type maps an integer state to a discrete value - perfect for the 8 discrete piece lengths in the source requirement.
  6. Add the Width property to the animation. Click Add Property and select Width from the dropdown.
  7. Define the 8 ranges. For each of the 8 piece lengths, add a range entry: Range Value = 1 → Target Width = 40 px, Range Value = 2 → Target Width = 60 px, through Range Value = 8 → Target Width = 160 px. The width-vs-piece mapping is arbitrary - pick the pixel values that match your screen DPI and zoom level.
  8. Disable design-time width flicker. In the rectangle's Properties → Appearance tab, set the design-time Width to the median target (e.g., 80 px). The animation will override at runtime, but matching the median keeps the Editor preview close to runtime appearance.
  9. Repeat for boxes 1 through 19. Use copy-paste on the rectangle, then change the trigger tag on each clone to HMI_PieceLength_01 through HMI_PieceLength_19. The animation definitions can be cloned with the object.
  10. Compile and download. Compile the HMI project, download to the panel or PC Runtime. Verify in the online view that the boxes resize when the corresponding DB_Conveyor.PieceLength[i] is changed in the PLC's watch table.
Performance tip: Do not set the screen update cycle to a value lower than the PLC's OB 1 cycle time. Comfort Panel default is 100 ms, which is well-suited for S7-1500 with OB 1 cycle of 1-2 ms. The 100 ms screen cycle samples the animation trigger 10 times per second, which is visually indistinguishable from continuous motion for human operators at normal viewing distance.

Scaling to 20+ Boxes: Array Tags and Indirect Addressing

For a line with 20 boxes, defining 20 individual HMI tags is acceptable on a Comfort Panel. For 50+ boxes, use a single HMI tag with a raw array of INTs and an index variable driven by the screen, then a single C-Script - scheduled at the screen cycle, not at OB 36 - that copies the selected element to a single local HMI tag used as the animation trigger. This eliminates the bus load of 50 separate tag pointers and is the recommended pattern on TP700 panels where tag count is limited to 1024 per project.

For the 20-box case described in the source, the direct approach is preferable because it avoids script execution entirely. The animation engine handles all 20 boxes in parallel without scheduling complexity. The 20 tags consume 20 entries of the panel's per-screen polling budget (256 tags per cycle on a TP1200) - well within margin.

Array-to-Width Mapping Reference

For uniform piece length encoding (e.g., lengths in mm stored as INT in the PLC), map the integer ranges:

Range Value Piece length (mm) Width (px) Use case
1 200 40 Shortest SKU
2 300 55 -
3 400 70 -
4 500 85 Median (design-time width)
5 600 100 -
6 800 130 -
7 1000 160 -
8 1200 190 Longest SKU

Indirect Addressing Pattern (50+ boxes)

When 50 or more boxes are needed, the recommended WinCC-side pattern is:

  • Define a single HMI tag array HMI_PieceLength : Array[0..49] of INT pointer-mapped to the PLC array.
  • On a screen-level event (e.g., screen loaded), copy the entire array in one PLC GET burst using the Update function on the HMI tag array.
  • For each rectangle, use a C-Script that runs at the screen update cycle (not 100 ms) and copies HMI_PieceLength[RectangleIndex] into a local HMI tag LocalTrigger used as the animation trigger for that rectangle.

Performance Considerations and Cycle Times

OB 36 clock generator 7 is a hard fault. Once the error is in the diagnostic buffer, the PLC continues to run, but the cyclic interrupt timing is no longer deterministic. In a motion application, this can corrupt position capture or PID sampling. Recovery requires acknowledging the diagnostic event and downloading a configuration that gives OB 36 enough headroom.

Headroom calculation for the box animation case:

  • OB 36 cycle = 100 ms (default).
  • OB 36 execution time at design = ~0.5 ms (empty user program); add 0.2-0.5 ms per PID instance or motion axis that runs in OB 36.
  • Animation-triggered reads on the HMI do not affect OB 36 directly because they are HMI-side polls.
  • The only HMI → PLC traffic is the cyclic tag read, which is served from the PLC's process image. Process image update on S7-1500 is 1-3 ms and runs in OB 1, not OB 36.

Therefore, with native animation, OB 36 should not be disturbed by the HMI at all. The bus load is decoupled from the HMI script trigger rate, and the PLC sees a constant, predictable read pattern.

Field-proven caveat: On S7-1200 with firmware 4.0 and earlier, OB 36 is reserved for Siemens-internal use and is not user-configurable. If you see clock generator 7 on an S7-1200, it typically points to OB 30 (default 100 ms cyclic interrupt on S7-1200 FW 4.0) or to a custom cyclic interrupt you configured. The fix is identical: remove the HMI-side write loop.

Verification Procedure

  1. In the PLC, open a watch table and force DB_Conveyor.PieceLength[0] = 1 through = 8 in sequence.
  2. Switch the HMI to Runtime. Confirm each box steps through the 8 widths defined in the Animation mapping.
  3. Open the PLC's diagnostic buffer (Online → Diagnostics → Diagnostic Buffer). Confirm there is no new OB request error entry during the animation cycle.
  4. Repeat the test with all 20 tags forced to change simultaneously. Confirm the HMI updates without dropping tags and the PLC diagnostic buffer remains clean.
  5. Force a worst-case value outside the configured ranges (e.g., = 0 or = 9). Verify that the box holds its previous width (default behavior) or jumps to a configured fallback range.
  6. On the panel, open the Performance diagnostics (Start Center → Performance). Confirm the HMI user process CPU stays below 60% during the worst-case animation burst.

Troubleshooting Matrix

Symptom Likely cause Resolution
OB 36 clock generator 7 error returns after migration to native animation Old VBScript still scheduled in the project Delete scheduled tasks in the Scheduler editor; remove scripts from event handlers
Boxes do not resize at runtime Animation trigger tag has no value or wrong type Confirm HMI tag is INT/DINT and pointer is valid in the connection diagnostics
Boxes flicker between sizes Screen cycle < PLC OB 1 cycle (rare); animation on an AC-connected tag with poor connection Lower screen update rate to 200 ms; verify the HMI connection in Online → Connections
Only first box animates Tags 1-19 are not linked to the PLC array index Verify the pointer in each tag; recompile HMI and download
Boxes resize but lag visibly behind PLC Acquisition cycle too long or screen update cycle too long Lower acquisition to 500 ms and screen update to 100 ms
Compile error: "Tag type not supported in animation" Animation trigger is a string or BOOL Range (integer) requires INT, DINT, or WORD; convert upstream
Diagnostic buffer still shows OB request error on cold start Pre-existing error not acknowledged Clear diagnostic buffer: Online → Online & Diagnostics → Diagnostic buffer → Clear
Width does not change when the integer is < minimum range Out-of-range behavior is to hold the previous width Add a fallback range entry Range Value = 0 → Width = 0 px or a sentinel range

Best Practices and Field Notes

  • Always prefer native Animation over scripts for property changes driven by PLC state. The Animation engine is the only HMI subsystem that scales linearly to 50+ animated objects on a TP700.
  • Keep the design-time Width property of every animated rectangle set to a sensible median value. This makes the screen look correct in the Editor and during a brief Runtime restart, before the first animation evaluation.
  • Do not chain animations on the same property of the same object. WinCC will use the last-evaluated animation; the previous one is silently discarded. For compound effects, use a single script that reads multiple tags and computes the property directly (or break the screen into two screens).
  • For applications where the same conveyor line is monitored on multiple panels, the same Animation definition can be reused. Store the rectangle in a Faceplate type and instantiate 20 instances with different tag pointers. Source: Siemens TIA Portal faceplate documentation.
  • Validate the OB 36 diagnostic buffer after every PLC program change that adds a new function block called from OB 36. A new function block in OB 36 can push the execution time over the 100 ms cycle and re-trip the clock generator even without HMI involvement.

FAQ

What does "OB request error / cyclic interrupt clock pulse generator 7 / causing OB: cyclic interrupt OB (OB 36)" actually mean?

The PLC's OB 36 was still executing when the next hardware clock tick fired, so the scheduler could not start a new OB 36 call. The PLC records a diagnostic event and continues running, but OB 36 is no longer time-deterministic. The most common cause in HMI-heavy projects is excessive HMI-to-PLC traffic starving the same bus segment that OB 36's process image update uses.

Can I keep using a VBScript for the box resize if I reduce the trigger to 1 s?

Technically yes, but it does not address the root cause. The script still generates a burst of writes on the trigger event, and any other cyclic interrupt contention (motion, fast I/O) will re-trip the clock generator. Native Animation is the recommended approach because it removes the script from the critical path entirely and is read-only toward the PLC.

Does this method work on WinCC Runtime Professional (V14)?

Yes - the Animation tab and Range (integer) trigger type are also available in WinCC Professional. The Performance considerations are even less restrictive on a PC Runtime because the RT scheduler is preemptive, but the same design pattern (avoid scripts for property animation) still applies.

How do I show more than 8 discrete widths?

Increase the number of Range entries in the Animation. WinCC supports up to 32 Range entries per Animation trigger on a Comfort Panel and up to 256 on a PC Runtime. For continuous scaling (not discrete), use the Range (analog) trigger type with a linear or interpolated mapping.

My boxes overlap each other when sized - is there a way to keep them spaced?

Yes - add a second Animation to the same rectangle and animate the Position X property using the same trigger tag. The two animations execute in parallel and the box will move and resize together. For multi-box arrays, compute the leading-edge position in the PLC and animate Position X with that value.

Back to blog