Animating Generator Vibration in WinCC HMI: Step-by-Step Guide

David Krause12 min read
HMI / SCADASiemensTutorial / 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

1. Overview: Visualizing Generator Vibration in WinCC HMI

Industrial HMI screens that depict rotating equipment — generators, dynamo sets, motor-generator groups, diesel gensets — often need to communicate mechanical state to operators beyond a single colored status icon. A running synchronous machine is audible, it is hot, and it physically vibrates because of residual unbalance, magnetic pull, and bearing clearance. Reproducing that vibration optically on a SCADA graphic is a common requirement for power-plant, marine, and process-plant mimic displays built in Siemens WinCC (classic V7.x) or TIA Portal WinCC (Comfort/Advanced panels and WinCC Professional).

This reference covers three techniques engineers have used to produce a "running dynamo" animation in WinCC:

  1. An animated GIF played through an ActiveX / WPF container on the picture.
  2. A dual-rectangle flashing trick using built-in flashing and visibility properties.
  3. A geometry property bound to a dynamic dialog or a C / VBS action that offsets the picture every cycle.

2. Background: Mechanical Vibration of Electric Generators

Before touching the HMI, anchor the animation to physics so the picture update rate matches what the eye actually expects. An electric generator converts mechanical energy into electrical energy by relative motion between a magnetic field and a conductor. In a synchronous machine the rotor turns at the synchronous speed:

n_sync = (120 × f_grid) / p [RPM]

where f_grid is the grid frequency (50 Hz or 60 Hz) and p is the number of pole pairs. Common values:

p (pole pairs) f_grid = 50 Hz f_grid = 60 Hz
1 3 000 RPM 3 600 RPM
2 1 500 RPM 1 800 RPM
3 1 000 RPM 1 200 RPM
4 750 RPM 900 RPM

The dominant mechanical excitation frequency observed by the casing is therefore:

f_mech = n_sync / 60 [Hz]

For a 4-pole, 50 Hz machine the casing vibrates at 25 Hz; for a 2-pole machine at 50 Hz. To render that on screen without visible stepping, the HMI graphic must refresh at least at 2 × f_mech (Nyquist) and ideally at 4–8 × f_mech for smooth motion. That translates to 100–200 picture updates per second for a 2-pole 50 Hz generator — a number the WinCC runtime simply cannot sustain, which is exactly why a pre-rendered GIF or a hardware-accelerated ActiveX is preferred over per-cycle geometry scripting.

3. Prerequisites and Supported Environments

  • Engineering station: WinCC V7.5 SP2 or later, or TIA Portal V17 / V18 with WinCC Professional/Comfort. See the TIA Portal WinCC system manual.
  • Runtime target: WinCC RT Professional, SIMATIC Comfort Panel (MTP/Comfort), IPC with WinCC Runtime, or WinCC WebUX client.
  • Tag of type BOOL that represents the running state, e.g. Gen1_Running. The animation is bound to this tag's rising edge.
  • Optional: Apple Motion, Adobe After Effects, or any GIF authoring tool to produce the animated picture (Method 1).
  • Permission to install ActiveX controls (Method 1). On locked-down TIA Comfort Panels the GIF path uses the "Graphics > Animated GIF" property; on WinCC RT you may need a Microsoft WebBrowser or WPF MediaElement container.
Note: Comfort Panels (TP/Comfort, MTP700–MTP2200) only support the built-in "Animated GIF" picture property; they do not host arbitrary ActiveX controls. Use Method 1 with the "Graphics" graphic selection or embed the GIF as a native picture object.

4. Method 1 — Animated GIF via ActiveX / Native GIF Object

This is the field-recommended approach because the frame timing of the GIF is locked to the OS media timer, independent of the WinCC picture-update cycle. The GIF itself is the only object that needs to switch on when the generator tag becomes TRUE.

4.1 Building the GIF

  1. Draw the generator silhouette in any vector editor at the screen resolution you intend to use (e.g. 200 × 200 px).
  2. Export a sequence of PNG frames, each frame offset by ±1, ±2, ±3 px on X and Y. For a vibration that "feels right", use a 5-frame cycle at 100 ms per frame:
Frame # X offset (px) Y offset (px) Hold (ms)
0 0 0 100
1 +2 -1 100
2 0 +2 100
3 -2 -1 100
4 0 0 100
  1. Open Apple Motion (or After Effects) and use the project's Generator template workflow: File > New from Project Browser > Final Cut Generator, drag in the PNG sequence, apply a small Position keyframe wiggle, then export as gen_vibrate.gif with infinite loop and 10 fps (100 ms per frame).
  2. Save the file into the WinCC project under \GraCS\ (classic WinCC) or under HMI > Graphics in the TIA project tree.

4.2 Wiring the GIF into WinCC (Classic V7)

  1. Open the Graphics Designer and place a Picture Window or a Status Display (Graphic) on the process picture.
  2. Set the property Picture to gen_vibrate.gif.
  3. Bind the property Display (visibility) to the tag Gen1_Running via a dynamic dialog: value = 1 → visible; value = 0 → invisible. When the tag is FALSE the GIF stays hidden; when TRUE the GIF plays automatically because the file format drives the loop.
  4. If you want a still static picture while the generator is stopped, overlay a second Status Display with the same generator silhouette as a non-animated PNG and invert its visibility to the same tag.

4.3 Wiring the GIF into WinCC Professional / TIA Portal

  1. In the HMI screen, insert an Animated GIF object (Comfort/MTP) or a Graphic IO field referencing the imported GIF (WinCC Professional).
  2. Configure the Animation > Visibility property with a tag connection to Gen1_Running, using the formula (Gen1_Running == 1).
  3. Set the Picture property to the imported gen_vibrate.gif.
  4. Compile and download. The GIF begins playback immediately on tag rising edge.
Performance: A 10 fps GIF loaded once and held in the picture cache costs under 1 % CPU on a Comfort Panel and under 0.5 % on a WinCC Professional IPC. Geometry-bound alternatives are 5–10× more expensive because every property change re-evaluates a script per cycle.

5. Method 2 — Dual-Rectangle Flashing Technique

This is the zero-script workaround that works in any WinCC version without ActiveX. The visual illusion of vibration is created by two identical silhouettes offset by a few pixels, flashing in counter-phase so the eye reads the alternation as jitter.

5.1 Construction

  1. Draw the generator silhouette as a rectangle / polygon group (call it Rect_A) at its nominal position.
  2. Copy and paste Rect_A as Rect_B, then move Rect_B by +2 px X and +2 px Y (use the Geometry > Position X/Y properties, not the mouse, so the offset is exact).
  3. For both rectangles, enable the Flash property. Set Flash frequency to Medium (~2 Hz). The flashing bitmap is toggled between the foreground and background color at this rate.
  4. Configure the Flash property:
    • Rect_A — "Flash ON" color = generator color (e.g. blue); "Flash OFF" color = background (e.g. white).
    • Rect_B — opposite: "Flash ON" color = background; "Flash OFF" color = generator color.
  5. Bind the Visibility of both rectangles to tag Gen1_Running. When the tag is FALSE both rectangles are hidden; when TRUE they appear, flashing in counter-phase. The eye perceives the alternation as a 2 Hz jitter.

5.2 Tuning the Look

The trick feels mechanical only if the offset matches the flash phase. A workable rule:

Flash frequency Recommended X offset (px) Recommended Y offset (px)
Slow (0.5 Hz) 1 1
Medium (2 Hz) 2 2
Fast (5 Hz) 3 3

At flash frequencies above 5 Hz the human eye fuses the alternations into a steady blur, so going higher buys nothing. Stay at Medium (2 Hz) — it matches the visual signature of a 1500 RPM / 4-pole 50 Hz machine casing well enough for operator recognition.

6. Method 3 — Geometry Property with C / VBS Script

6.1 How the Update Cycle Limits Vibration

WinCC picture updates are throttled by:

  • The configured Update cycle of the tag connection (default 1 s in TIA Portal; 250 ms in classic WinCC).
  • The runtime's Picture cycle (typically 100 ms on IPC, 250 ms on Comfort Panels).
  • The minimum trigger interval of a scheduled C action (50 ms).

A naive script that re-reads the system clock every cycle still only gets redrawn at the picture-cycle rate. To render 25 Hz vibration you must shrink both.

6.2 C Action (ANSI-C, WinCC V7)

/* Vibrate generator picture while Gen1_Running == TRUE
   Place as a "Global Script > C Action" attached to the
   "Position X" property of the picture object "Gen_Picture".  */
#define BASE_X     400
#define BASE_Y     300
#define AMPL_X     3          /* pixels */
#define AMPL_Y     2          /* pixels */
#define FREQ_HZ    25.0       /* match the machine casing */
#define TWO_PI     6.283185307179586

static DWORD dwStart = 0;
if (dwStart == 0) dwStart = GetTickCount();

if (GetTagByte("Gen1_Running") == 1) {
    double t  = (GetTickCount() - dwStart) / 1000.0;
    double dx = AMPL_X * sin(TWO_PI * FREQ_HZ * t);
    double dy = AMPL_Y * sin(TWO_PI * FREQ_HZ * 1.3 * t);
    return BASE_X + (int)dx;
}
else {
    dwStart = GetTickCount();
    return BASE_X;
}

The same action with (int)dy + BASE_Y must be attached to Position Y. Note the secondary harmonic (×1.3) on Y so the motion looks elliptical rather than perfectly straight.

6.3 VBS Action (WinCC Professional / TIA)

' VBS action attached to the Position X property
Dim dt, t, dx
Const BASE_X = 400, AMPL_X = 3, FREQ_HZ = 25, TWO_PI = 6.283185307
If SmartTag("Gen1_Running") Then
    t = (Timer)                              ' seconds since midnight
    dx = AMPL_X * Sin(TWO_PI * FREQ_HZ * t)
    HmiRuntime.Screens("Overview").ScreenItems("Gen_Picture").Left = BASE_X + dx
Else
    HmiRuntime.Screens("Overview").ScreenItems("Gen_Picture").Left = BASE_X
End If
Field observation: This is the exact script path the field report called "not efficient — vibrates too slowly because the simulator can't change the value at the speed I need." The fix is to set the property trigger to a 50 ms cyclic trigger and to lower the picture update cycle to 100 ms in the runtime settings. See WinCC V7 manual, chapter "Picture update and cycle times".

6.4 Tuning Parameters for Method 3

Runtime setting Where Recommended value
Picture cycle Computer > Properties > Graphics Runtime 100 ms
Tag trigger Property > Update > Trigger 50 ms cyclic
C action trigger Action properties > Trigger 50 ms cyclic
Screen refresh Display > Screen refresh rate 60 Hz (monitor dependent)

7. Performance Comparison

Criterion Method 1 — Animated GIF Method 2 — Dual-Rectangle Method 3 — Geometry Script
Scripting required None None ANSI-C or VBS
Visual fidelity Excellent (pre-rendered frames) Low (2 Hz counter-phase) Medium (depends on cycle)
CPU cost on IPC runtime < 0.5 % ~0.1 % 1–3 % at 50 ms trigger
Comfort Panel supported Yes (native GIF) Yes Limited (no VBS on Comfort)
WebUX supported Yes (HTML5 GIF) Yes No (no scripting in client)
Trigger tag needed 1 (visibility) 1 (visibility) 1 (running state) + 50 ms timer
Maintenance when generator model changes Re-render GIF Re-draw two rectangles Update amplitudes only

For most operator screens, pick Method 1. For legacy TIA Comfort projects where the GIF cannot be imported at the required resolution, fall back to Method 2. Reserve Method 3 for screens where the vibration amplitude must follow a real measurement (e.g. Gen1_Vib_RMS from a vibration monitor).

8. Step-by-Step Implementation of Method 1 (Recommended)

  1. Author the GIF using the Apple Motion Generator template or After Effects. 10 fps, 5-frame elliptical loop, transparent background.
  2. Import the GIF into the WinCC project: in classic WinCC copy it to \GraCS\; in TIA Portal use HMI > Graphics > Add.
  3. Insert the picture object on the process screen. For TIA Comfort Panels use Animated GIF; for WinCC Professional use Graphic IO field or a WPF container.
  4. Wire visibility to Gen1_Running via the Animations > Appearance > Visibility property: value = 1 → visible.
  5. Add the static silhouette as a second object below the GIF, with visibility bound to NOT Gen1_Running so a still picture shows when the unit is stopped.
  6. Compile and download. On the runtime, force a tag transition on Gen1_Running from 0 → 1 and confirm the GIF begins playback and the static silhouette disappears.
  7. Verify the cycle rate: stop the GIF externally (e.g. Task Manager > Performance) and confirm the visible state is frozen at the static silhouette. Restart the runtime and re-check.

9. Verification and Acceptance Test

Acceptance is judged on three observable properties:

  • Trigger correctness: When the Boolean tag Gen1_Running transitions FALSE → TRUE, the vibration must begin within one picture cycle (≤ 250 ms on Comfort, ≤ 100 ms on IPC).
  • Trigger correctness (release): When the tag transitions TRUE → FALSE, the animation must stop and the static silhouette must appear within one picture cycle.
  • CPU footprint: On the runtime, log CPU under the picture's normal workload for 5 minutes. Expected < 5 % for one animated generator; if multiple generators are on the same screen, total < 15 %.

Use the WinCC diagnostics window (Tools > Diagnostics > Performance) and the TIA Portal WinCC Performance Assistant to verify the picture-update cycle and tag-trigger intervals.

10. Troubleshooting Matrix

Symptom Likely cause Resolution
Static picture instead of vibration GIF not imported; path wrong Verify file is in \GraCS\ and project re-compiled
GIF visible but not animating GIF is single-frame; loop count = 1 Re-export with infinite loop
Vibration looks "slow / stuttering" Method 3 used; trigger cycle too long Reduce picture cycle to 100 ms and trigger to 50 ms; or switch to Method 1
High CPU on Comfort Panel Method 3 used with 50 ms trigger on multiple generators Reduce trigger to 250 ms or migrate to Method 1
Flashing is visible only at low frequency Method 2 flash frequency = Slow Set Flash frequency to Medium (2 Hz)
Two rectangles overlap visibly Offset too large for object size Reduce offset to 2 px or less
GIF plays during stop, stops during run Visibility logic inverted Swap 0/1 in the dynamic dialog or script
Tag updates do not switch the animation Tag connection type set to "On change" with low acquisition rate Change acquisition to 100 ms or add a cyclic trigger

11. Frequently Asked Questions

Does WinCC Comfort Panel support the dual-rectangle flashing method directly?

Yes. The Flash and Visibility properties are available on every object on a TP/Comfort panel and on MTP devices; no scripting is required, only tag binding for visibility.

What vibration frequency should I target for a 1500 RPM 50 Hz generator?

The dominant mechanical excitation is 25 Hz. Render at 10 fps (100 ms per frame) — enough for the eye to read the motion as vibration while keeping the GIF well under any runtime CPU budget.

Can I bind the vibration amplitude to a real vibration-sensor tag instead of a constant?

Yes, but only with Method 3. Map the sensor's RMS value (typically in mm/s) to the AMPL_X / AMPL_Y constants of the C action. Keep a 50 ms trigger and a 100 ms picture cycle for smooth motion.

Will an animated GIF in WebUX render the same way as on the engineering station?

Modern WebUX clients render GIFs natively in HTML5; older WebNavigator clients require the GIF to be re-uploaded to the WebUX graphics folder and may need a cache refresh after tag transitions.

Why does Method 3 feel slow even with a 50 ms trigger?

Because the picture-update cycle is independent of the trigger: if the runtime is configured for a 250 ms cycle, the script can run every 50 ms but the new position only paints every 250 ms. Tune the picture cycle in the runtime settings, not just the trigger.

Back to blog