IMDTouchKnowledge BaseShop main store

How-to

Update a WinCC Unified tag on demand with Update Tag

HMI and touchscreens Published 5 min read By IMDTouch engineering team

Short answer

From TIA Portal V17 you can stop cyclic reads of a WinCC Unified tag: set its acquisition mode to On demand, assign it a numeric Update ID under Properties > Settings > Updates, and call the Update Tag system function with that ID from an event. Tags sharing one Update ID refresh together in a single call.

On this page
  1. What On demand changes about the read
  2. Configure the tag and the trigger
  3. Worked example: one button refreshes five recipe tags
  4. Verify it on the bench
  5. Pitfalls that stop the update
  6. The decision
  7. Questions asked

A WinCC Unified tag does not have to be read cyclically. From TIA Portal V17 you can set its acquisition mode to On demand, give it a numeric Update ID, and call the Update Tag system function from a button or other event; the runtime then reads the current value from the PLC only when that call runs. Tags that share one Update ID refresh together in one call. Below are the configuration steps, a worked example that shows what one shared ID does for a screen of recipe parameters, the bench checks that prove it, and the decision for each case.

What On demand changes about the read #

Acquisition mode decides when WinCC Unified runtime reads an external tag from the PLC. In a cyclic mode the runtime schedules the reads itself and the screen shows whatever the last cycle delivered. In the On demand mode the runtime schedules nothing: the tag keeps the value from its last read until the Update Tag system function runs with that tag's Update ID, and only then does runtime read the current value from the controller. The Update ID is a number you pick yourself — a grouping key inside the HMI project, not a PLC address and not something the controller knows about. The system function reads the current value of every tag carrying the ID it is given, and one ID may serve several tags.

If you only want a slower refresh rather than a read gated behind an operator action, the periodic-update techniques in HMI periodic tag updates by script and scheduled task do that without touching acquisition mode.

Configure the tag and the trigger #

  1. Create the external HMI tag as usual, with its connection and PLC tag reference.
  2. In the tag's properties, open Settings > Settings > Acquisition mode and set it to On demand. From this moment the runtime performs no cyclic read for the tag.
  3. Under Properties > Settings > Updates, enter a number in the Update ID field. Any number works; the worked example below groups five tags under one ID.
  4. Give every tag that must refresh together the same Update ID.
  5. Select the trigger object — a button, for example — open its click or press event, and add the system function Update Tag, entering the ID from step 3 as its parameter.
  6. If you drive the event from JavaScript instead, call the method HMIRuntime.Tags.SysFct.UpdateTag with that same ID as its argument; the worked example shows the call.
  7. Compile the HMI device and download it, or start a runtime simulation, and run the bench checks below before deploying.

Worked example: one button refreshes five recipe tags #

Illustrative inputs: a parameter screen shows five PLC recipe values, and cyclically each tag carries a 1 s acquisition cycle. Over one minute the panel therefore performs 5 values × 60 cycles = 300 tag acquisitions, and adjacent fields can show values up to 1 s apart from one another.

Switch those five tags to On demand and give all of them the same Update ID (10 in this example). One button press calls Update Tag with ID 10 once; the runtime reads all five values in that single call, which is 5 acquisitions for that press instead of 300 scheduled ones every minute — a 60-fold drop (300 ÷ 5 = 60). Every field on the screen now shows one consistent read instant, and nothing is transmitted until the operator asks for it. If the operator presses every 30 s instead, the load rises to 10 acquisitions per minute, still 30 times fewer than the cyclic setup, so the saving scales with how often the screen is actually used.

Verify it on the bench #

  • Reopen the tag: Acquisition mode shows On demand and the Update ID field holds the number you entered, both after compile.
  • Stale-value proof: change the value in the PLC while runtime runs, without pressing the button. The HMI field must keep its old value; that confirms no cyclic read remains.
  • Refresh proof: press the button once. The field now shows the current PLC value from that instant.
  • Group proof: change two tags that share the ID in the PLC, press once, and both fields update from the one call.
  • Isolation proof: change a tag with a different Update ID and press the button; that tag must not move.
  • Script path: with the JavaScript call, check the argument matches the configured number exactly; runtime diagnostics shows no script error and the same refresh happens.

Pitfalls that stop the update #

  • ID mismatch. An Update Tag call whose parameter differs by one digit from the tag's property refreshes nothing, and the configuration tools do not cross-check the two numbers against each other.
  • Mixed groups. One ID spread over unrelated tags makes each press read data the screen never shows. Group by screen or by function block of data.
  • Snapshot that looks live. An on-demand field is visually identical to a cyclic one. Label it or add a timestamp so operators know they are looking at the moment of the last press.
  • Alarms and trends. Logging, alarm limits and change detection only see values between calls. Keep those tags on a cyclic mode.
  • Structured tags. Changing the acquisition mode of a structured tag applies it to all subordinate elements and can overwrite the settings you gave them, so recheck each element after the change.

For classic WinCC projects, a script read through SmartTags follows the tag's acquisition mode rather than this function, and how SmartTags returns the cached value in a Comfort panel script explains that behavior on Comfort panels. On the scripting side of classic WinCC, the WinCC VBScript screen call and SmartTags programming guide covers how screen calls and SmartTags reads interact in a script.

The decision #

  • A tag read only at an operator action, or one that changes rarely: set On demand, use one Update ID per screen or per function block of data, and call Update Tag from the button.
  • A whole screen refreshed at once: give every tag on it the same Update ID and trigger one call on screen entry plus a manual refresh button.
  • Alarms, trends, change detection, or any value a machine stop depends on: keep the cyclic acquisition cycle — an on-demand snapshot can hide a change that happened after the last press, and a stop decision must never rest on one.
  • A slower refresh is the actual goal: leave the acquisition mode cyclic and use scheduled periodic updates instead.

Questions asked

Does a WinCC Unified tag set to On demand ever update by itself?

No. The value in runtime stays at whatever the last Update Tag call read, and no cycle or screen change refreshes it. To show fresh data the moment a screen opens, bind the same call to the screen's loaded event as well as to a refresh button; otherwise the operator is looking at the snapshot left behind by the previous call.

Can the update be triggered from a script instead of a button event?

Yes. In the WinCC Unified JavaScript object model the method HMIRuntime.Tags.SysFct.UpdateTag performs the same read as the system function: pass it the tags' update ID as its argument, so with Update ID 10 the call is HMIRuntime.Tags.SysFct.UpdateTag(10);. It reads the current PLC value of every tag carrying that ID.

What happens to the elements when I change the acquisition mode of a structured tag?

The change is applied to all subordinate elements of the structured tag, and it can overwrite the acquisition settings you assigned to those elements individually. Set the mode before you build up the structure, or go back over every element afterwards and confirm each one still has the setting you intended.

Does the same on-demand option exist in WinCC Advanced or on Comfort panels?

The Update Tag function and the Update ID property described here belong to WinCC Unified runtime and are available from TIA Portal V17. Comfort panels behave differently: a script there reads the cached value that matches the tag's acquisition mode. In another WinCC editor, open the tag's acquisition settings and confirm what that editor offers before designing around on-demand reads.

Keep reading

  • Troubleshooting

    Why WinCC Unified V19 buttons do not write tags to the PLC

    In WinCC Unified V19, a button that uses SetTagValue or a script writes nothing when the logged-in user holds the HMI Monitor Client role, which is read-only and shows an orange frame around the root screen. Run the IO field test to separate a role fault from a connection or script fault, then fix the role assignment in Users and roles.

    HMI and touchscreens

  • Troubleshooting

    Why the Modbus Server Device Is Missing in EasyBuilder Pro

    Modbus Server disappears from the EasyBuilder Pro device list because the installed build is older than the driver: a project on build V6.07.02.320 showed no entry on any selected model, and installing EasyBuilder Pro 6.08 restored it. Update the software from the vendor's download before concluding that a panel model cannot run a Modbus server.

    HMI and touchscreens

  • Troubleshooting

    Why Weintek HMI Tags Fail to Update With an Omron CJ1M

    A clean download and system traffic in EasyDiagnoser prove the transfer path, not tag exchange. With a CJ1M-CPU12 and an ETN11, fix the link in order: the documented CJ/CS/CP FINS driver and its destination fields, one known D-word read, then request and reply diagnostics that name which of four stages fails.

    HMI and touchscreens

Why a USB Joystick Cannot Drive PanelView Tags