WinCC RT Advanced V14 Implementing Persistent Hoist Movement

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

Overview

Horizontal movement animations in WinCC RT Advanced V14 under TIA Portal V14 are driven entirely by a numeric tag value. If the tag is not updated by the PLC while a movement is requested, the animation collapses back toward the configured start position the next time the screen is refreshed, which produces the classic "hoist jumps home on stop" symptom. The cure is to never let the HMI panel own the position: the PLC owns a persistent integer (or real) position variable, and the HMI screen simply mirrors that variable through the animation interface. This reference covers the complete pattern, including the toggle-button logic, boundary clamping, debounce considerations, and the runtime tag properties that determine how the HMI interprets the value.

The architecture mirrors standard Siemens motion-control philosophy: the controller is the single source of truth for state, the HMI is a pure visualization layer. Once that boundary is enforced, the animation behaves like the requested video reference — the hoist holds its last commanded position, resumes from that point on the next press, and respects physical minimum and maximum limits.

Prerequisites

  • TIA Portal V14 SP1 or later (V14.0.0.0 base, V14.0.1.x updates) with installed WinCC RT Advanced V14 runtime license and the matching HMI device image (refer to the Siemens Industry Online Support portal for the exact image catalog number for your panel — for example 6AV2 100-0AA02-0AA0 for the basic TP1500 image bundle).
  • A Siemens S7-1200 (CPU 1211C/1212C/1214C/1215C/1217C) or S7-1500 PLC projectable from TIA Portal V14.
  • Configured HMI connection between the PLC and the Comfort/Advanced Panel in Devices & Networks.
  • A hoist or horizontal-axis object drawn on the HMI screen (e.g., a rectangle representing the hoist carriage).
  • Familiarity with tag configuration (PLC tags vs. HMI tags) and screen object properties in TIA Portal. Review the TIA Portal V14 WinCC Engineering manual for tag handling specifics.
Critical architectural rule: WinCC RT Advanced panels do not expose cyclic clocks or TON timers usable by the animation engine. The "Horizontal Movement" animation only consumes a value; it cannot increment that value itself. Any cyclic increment/decrement must be executed in the PLC and written to a tag that the panel polls. Do not connect the animation to an HMI-local tag and try to drive it with a script — the animation value will not survive a screen change or stop event.

Understanding the Animation Behavior

The Animations > Movement > Horizontal dialog (or Properties > Animations > Horizontal Movement in TIA Portal) exposes four key fields:

Field Meaning Typical Value
Tag The numeric tag whose value drives X-offset of the object DB_Hoist.Position_mm (INT, 0..1000)
Start position Screen pixel X coordinate when the tag equals the configured start value 120 px
End position Screen pixel X coordinate when the tag equals the configured end value 920 px
Start value / End value Engineering-unit values mapped to the two pixel positions 0 mm / 1000 mm

Every screen cycle, the runtime reads the current tag value, linearly interpolates between the start/end value pair, and applies the result as the object's horizontal offset. If no PLC logic writes the tag, the value reflects whatever the PLC last stored — which is precisely why "Stop" must not reset the tag.

PLC Tag Strategy

Declare a single persistent position tag in the PLC that the PLC owns exclusively. Use a data block with Set retain so the hoist remembers its position across power cycles.

Tag Type Direction Retain Description
DB_Hoist.Position INT PLC → HMI Yes Current horizontal position in engineering units
DB_Hoist.CmdLeft BOOL HMI → PLC No Toggle: 1 = move left, 0 = stop/hold
DB_Hoist.CmdRight BOOL HMI → PLC No Toggle: 1 = move right, 0 = stop/hold
DB_Hoist.MinPos INT Constant — Lower limit (e.g., 0)
DB_Hoist.MaxPos INT Constant — Upper limit (e.g., 1000)
DB_Hoist.StepSize INT Constant — Increment per OB1 cycle (e.g., 5)

The PLC OB1 (or a cyclic task OB35 at 100 ms on S7-1500) reads CmdLeft/CmdRight, updates Position, clamps to MinPos/MaxPos, and writes the result back. The HMI only needs to toggle the command bit; it never touches the position directly.

Step-by-Step Implementation

  1. Create the PLC data block. In the S7-1200/1500 project tree, right-click Program blocks > Add new block > Data block. Name it DB_Hoist. Enable Optimized block access (S7-1500) or Standard access (S7-1200) depending on firmware; declare the tags from the table above.
  2. Implement the cyclic motion logic. Drop the following code into OB1 (SCL is shown; an equivalent ladder example follows). Use OB35 if you want a deterministic 100 ms cycle independent of OB1 scan time.
// SCL — OB1 (or OB35) on S7-1200/1500
IF "DB_Hoist".CmdLeft AND NOT "DB_Hoist".CmdRight THEN
    "DB_Hoist".Position := "DB_Hoist".Position - "DB_Hoist".StepSize;
ELSIF "DB_Hoist".CmdRight AND NOT "DB_Hoist".CmdLeft THEN
    "DB_Hoist".Position := "DB_Hoist".Position + "DB_Hoist".StepSize;
END_IF;

// Clamp to physical limits
IF "DB_Hoist".Position < "DB_Hoist".MinPos THEN
    "DB_Hoist".Position := "DB_Hoist".MinPos;
END_IF;
IF "DB_Hoist".Position > "DB_Hoist".MaxPos THEN
    "DB_Hoist".Position := "DB_Hoist".MaxPos;
END_IF;
  1. Add a TON-based speed governor (optional but recommended). Raw OB1 increments can be too fast for the human eye or for the simulated mechanical system. Insert a 100 ms timer whose Q output gates the increment:
// Ladder equivalent — 100 ms pace using clock memory or TON
// On S7-1200/1500, enable Clock_100ms in PLC properties > System & Clock Memory
// Use M10.5 (100 ms pulse) as the increment gate
A   M10.5
A   "DB_Hoist".CmdLeft
AN  "DB_Hoist".CmdRight
JCN noLeft
L   "DB_Hoist".Position
L   "DB_Hoist".StepSize
-I
T   "DB_Hoist".Position
noLeft: NOP 0
  1. Configure the HMI buttons as toggles, not momentary actions. On the WinCC screen, select the Left button. In Properties > Events > Press, add a SetBit action on DB_Hoist.CmdLeft. In Release, add a ResetBit on the same tag. The tag is therefore TRUE for the entire duration of the press — no edge events required, no script needed.
Toggle vs. edge: If you wire the button to InvertBit on Press instead, the hoist will hold position when you release the button and resume on the next press — the textbook "push once to start, push again to stop" behavior. The discussion in the source refers to this exact behavior; the InvertBit pattern is the cleanest realization. Use a Set/Reset pair with Press for true momentary (button-held) movement.
  1. Bind the animation to the PLC-owned tag. On the hoist rectangle, open Properties > Animations > Horizontal movement. Configure:
    • Variable: DB_Hoist.Position (INT)
    • Start position: leftmost pixel where the hoist should rest, e.g. 120
    • End position: rightmost pixel, e.g. 920
    • Start value: 0
    • End value: 1000
    • Direction: Left to right (or Right to left depending on which command you wired to which button)
  2. Disable any reset-to-zero on Stop. Ensure that no HMI event, screen change, or "Reset" button writes to DB_Hoist.Position. Search the project for any cross-references to DB_Hoist.Position and confirm only the motion logic and the animation tag read it.
  3. Build and download. Compile the PLC first (so the DB exists), then compile the HMI and download both to the targets.

Why "Stop" No Longer Resets the Hoist

The field report explicitly notes: "the hoist turns to initial position, and I don't want this." That symptom appears when the animation tag is bound to an HMI-local tag whose value is reset to its initial value when the panel event handling restarts, or when a script inadvertently writes zero on the Stop event. Because the PLC now owns the position variable and the variable is declared retain in the data block, the runtime simply displays whatever value the PLC last computed. Pressing Stop releases CmdLeft and CmdRight; the increment stops; the position tag freezes at the last valid value; the animation freezes at the corresponding pixel. Press Start again and the position resumes from exactly that point.

HMI Button Event Mapping

Button Event Action Tag affected
Left Press InvertBit (or SetBit for held) DB_Hoist.CmdLeft
Left Release — (only if SetBit was used) DB_Hoist.CmdLeft
Right Press InvertBit (or SetBit for held) DB_Hoist.CmdRight
Right Release — (only if SetBit was used) DB_Hoist.CmdRight
Stop Press ResetBit (or no action if buttons are toggle) CmdLeft, CmdRight
Home Press SetBit of one-shot trigger DB_Hoist.CmdHome

Adding a Smooth Approach (Optional)

Constant-velocity stepping produces visible discrete jumps at low clock rates. To smooth the motion, use a real (LREAL) position with an exponential filter on the PLC side:

// Exponential smoothing in SCL
#filtered := #filtered + 0.2 * ("DB_Hoist".Position - #filtered);
"DB_Hoist".SmoothedPosition := LREAL_TO_INT(#filtered);

Bind the HMI animation to SmoothedPosition instead of the raw Position. The hoist now glides rather than steps. With smoothing, also increase the acquisition cycle of the HMI tag to 200 ms to keep CPU load low on Comfort Panels.

Verification Procedure

  1. Online → Monitor & Force in TIA Portal. Force DB_Hoist.CmdLeft = 1 and observe Position decrementing in real time. Force CmdLeft = 0; the position tag must freeze.
  2. In the HMI runtime, press Left. The hoist must travel left and stop on release (held) or on second press (toggle). It must NOT snap back to start.
  3. Power-cycle the PLC. After restart, the hoist must be at the last position because Position is retained.
  4. Force Position = MaxPos + 50 and confirm the next OB1 cycle clamps it back to MaxPos.
  5. Click Right while the hoist is at the left limit. The hoist must remain stationary (clamped) and the position tag must not change.

Troubleshooting Matrix

Symptom Likely Root Cause Correction
Hoist jumps home on Stop Animation tag is HMI-local and a script writes zero on Stop Move tag to PLC data block with retain
Hoist never moves at all Button event action is missing or wired to wrong tag Verify Press → SetBit/InvertBit on CmdLeft
Hoist moves one pixel then stops OB1 scan time shorter than expected; no clock gating Gate increments with M10.5 (100 ms) or move logic into OB35
Hoost passes through limits Clamp logic not executed (tag optimized access causing symbolic address error) Verify block is optimized, addresses compile cleanly, download again
Animation shows only 0 or max — never in between Tag is BOOL instead of INT Change tag type to INT or DINT in DB
Animation is jerky on Comfort Panel Acquisition cycle of tag too long Reduce tag acquisition to 100-200 ms in HMI tag properties
Position lost on power cycle DB not set to retain Open DB properties → Retain; mark Position as retentive
HMI shows "Address not available" PLC DB not compiled/downloaded before HMI compile Compile PLC project first, then HMI, then download in order

Edge Cases and Field Caveats

  • Simultaneous press of both buttons. The SCL above uses an exclusive-or (XOR) via the two ELSIF branches. If you want a hard interlock, add an alarm bit CmdLeft AND CmdRight and display it on the HMI.
  • Watchdog on S7-1200. The S7-1200 OB1 cycle can stretch under heavy communication load. If motion appears irregular, move the increment logic into a 100 ms cyclic interrupt (OB200 on S7-1200, OB35 on S7-1500) and disable it in OB1.
  • Animation across multiple screens. The hoist tag survives screen changes only if the screen window is part of the same template and the tag is a global HMI tag. Always mirror the PLC tag to a global HMI tag, never a local one.
  • Touch jitter on resistive panels. If the panel is a resistive TP1500 (6AV2 124-1MC01-0AX0), a brief touch release can produce a false rising edge. Add a 50 ms debounce in the PLC with an IEC_Timer instance, or use the panel's built-in debounce setting in Control Panel > Input > Touch.
  • Direction inversion. Some engineers find the coordinate system of WinCC counter-intuitive. If the hoist moves right when you press Left, either swap the Start position/End position pixel values in the animation dialog or swap the increment/decrement branch.

Extending to Multi-Axis Hoists (X/Y)

The same pattern scales to vertical (Y) motion by adding a second Vertical Movement animation bound to DB_Hoist.PositionY, a second pair of CmdUp/CmdDown tags, and an additional clamp pair MinY/MaxY. The PLC owns both axes. To animate a diagonal path, drive both axes from the same command and use separate step sizes for X and Y so the visual ratio matches the engineering ratio (mm-per-pixel).

Related Siemens Documentation

Why does my WinCC RT Advanced V14 hoist animation return to the start position when I press Stop?

The animation is bound to an HMI-local tag or to a tag that another event is resetting to zero. Move the position variable into a PLC data block, mark it as retentive, and only let the PLC write to it. The HMI mirrors the value but never writes it.

Can the WinCC panel drive the animation without a PLC?

No. WinCC RT Advanced panels do not expose cyclic clocks or timers usable by the animation engine. The animation only consumes a value. Any cyclic increment or decrement must come from the PLC's OB1 or a cyclic interrupt OB. If you must run without a PLC, schedule-triggered VBS scripts on the HMI can write to the tag, but those scripts are not deterministic and will not survive a screen change cleanly.

How do I make the hoist move with a single click and stop with the next click?

Use the InvertBit action on the button's Press event instead of SetBit/ResetBit. The tag toggles between 0 and 1 on every press, so the PLC keeps moving while the tag is high and stops the next time the tag is forced low by the toggle.

How can I keep the hoist's position after a power cycle?

In the S7-1200/1500 data block properties, enable Retain for the position tag. On restart, the PLC reads the last retained value and the animation resumes exactly where it left off. Without retain, the position initializes to zero on every power-up and the hoist snaps to the start pixel.

What tag acquisition cycle should I use for the animation tag?

On Comfort Panels (TP1500, TP1900, TP2200), 100-200 ms is a good balance between visual smoothness and CPU load. On Mobile Panels and Basic Panels (KTP series), 200-500 ms is recommended because their slower processors struggle with sub-100 ms polling of animation tags. Set the cycle in the HMI tag properties under Acquisition mode > Cyclic continuous.

Back to blog