Where HMI internal tag retention survives: power off, download

8 min read · Published November 10, 2026

An HMI internal tag loses its value at one of three events: first run, a power cycle, or a panel program download. Write a start value with a power-up event, set Retentive and keep the panel battery serviceable for power cycles, and keep anything that must survive a download in PLC data registers. A 64-character string needs 32 consecutive 16-bit registers.

An HMI internal tag is panel-local storage. The PLC never sees it, and the value survives only as far as the next event that clears panel memory. A tag with no written start value reads zero on the first run. An unchecked Retentive setting, or a flat panel battery, clears it at power-off. A panel program download clears it every time, retentive or not. So the storage decision is a decision about events: write start values with a power-up event, set Retentive and keep the battery serviceable for power cycles, and keep anything that must survive a download in PLC data registers. Below are the symptoms, the checks in order, the three fixes, the register math for strings and a worked recipe example.

Three events that erase an internal tag value

An internal tag is a symbolic name for data the panel keeps to itself: display housekeeping, status codes, screen counters, values the panel logic uses without involving the PLC. The panel documentation draws the limit plainly: internal tag values are available only while the panel runtime is running, and retention is a property you set per tag, not a default. Three events erase values:

  • First run. A new tag starts at zero or blank, and the tag definition gives you no way to preset it. You write the start value yourself.
  • Power cycle. The panel loses supply. What the tag holds leaves with the power unless the tag is marked retentive and the memory behind it has battery power. One HMI platform states the healthy case in its documentation: a retentive memory tag keeps the last value it held before the panel server shut down.
  • Panel program download. A changed project is sent to the panel. Program storage is replaced and internal tag data goes with it, retentive or not. This is the boundary that surprises people, because retention protects the value right up to the day you improve the screen.

Symptoms and what each points to

  • The field is blank or zero the first time the project runs. Nothing has written a start value. The fix is the startup event below.
  • The value is gone after the panel is switched off and back on. The retention path: the Retentive check box is unchecked in the tag name database, or the panel battery is missing or dead. The fix is the retention setting plus the battery.
  • The value is gone only after a changed panel program was downloaded. The download boundary. No retention setting recovers it; the data needs a home outside the panel.
  • The screens are gone too, not just the values. A panel that loses its whole project after a power cycle is a different fault with its own checklist: HMI panel loses its project after a power cycle.

Check which event ate the value

  1. Enter a known value into the field, for example 1234, and note which tag holds it.
  2. Switch the panel off and back on. Value still there: retention is healthy, go to step 4. Value gone: go to step 3.
  3. Open the tag name database and confirm the Retentive check box is checked for that tag, then confirm the panel battery is present and serviceable. Repeat the power-cycle test with 1234.
  4. Make a small change to the project, download it, and reopen the screen. If 1234 is gone after the download while Retentive is set and the battery is good, the value hit the download boundary and the fix is PLC registers, not another retention setting.
  5. On a fresh project where the field must not open at zero, write the start value with an event, as in the next section.

Write a start value with an event

Use the panel event system. The documented method is an event that checks the tag for its blank or zero state and then writes the required value. Most packages also expose a system bit that is on once the panel is running; one names it SYS BIT ON, and an event with the condition SYS BIT ON = 1 and the action MyTag = 1 writes a start value of 1 on startup.

Pick the condition deliberately. If zero or blank can be a legitimate operator entry, trigger the event from a separate first-run flag so it fires once per startup and never rewrites a value the operator has already set. List the tags that need a defined start value before you write the events; initializing every internal tag in the project is how a stored setting gets overwritten the next morning.

Survive a power cycle: Retentive and the panel battery

Open the tag name database and check Retentive on every tag that must ride out a power cycle. The documented fix for power-cycle loss is the pair: Retentive checked and a battery in the panel. The check box marks the tag; the battery keeps the memory behind it alive while the panel is switched off.

The battery is a consumable. The panel hardware documentation gives the type and the change interval, and after any change you repeat the test from the checklist: enter 1234, power-cycle, confirm it is still on the screen.

Before you set Retentive on a screen that mixes input and output registers, it is worth knowing which is which: what input and output retentive mean on an HMI panel covers the distinction. If the value that vanishes is an operator-entered setpoint, the same battery question applies, and why an HMI setpoint resets to zero after a power loss walks through it.

Survive a download: PLC data registers

Retention ends at the download, so values that must outlive the panel program need a home outside the panel. Put them in PLC data registers, called V-memory on some PLC families, in a range the PLC program never writes:

  • Bind the panel object to a tag mapped into the reserved range. The panel writes and reads the PLC memory, and the PLC logic can ignore the data completely; the storage still works.
  • Reserve one contiguous block and record its start and end in the PLC project, so a future PLC edit does not hand the range to a timer or a batch counter.
  • For text, bind the Text Entry object to an ASCII string tag sized for the longest entry you allow. A register is 16 bits, an ASCII character is 8 bits, so each register holds 16 ÷ 8 = 2 characters. A 64-character string occupies 64 ÷ 2 = 32 consecutive registers.

Keep the mapped data width matched to the registers you reserve; when the width disagrees, the panel and the PLC disagree about where one value ends and the next begins. IEC 61131-3 programmers have a name for the rule: address width must match the mapped data type. Packing the characters into the words is its own job, and pack an ASCII string into V-memory words for an HMI tag shows it step by step.

Check it worked: enter the text, download a changed project, reopen the screen. The text is still there because it never lived in the panel.

What a flash drive or archive buys

The next question is usually removable storage. Some HMI platforms provide it as an archive feature: user archives, or tag logging that writes tag values into an archive. Read that manual section closely before designing around one, because the documented workflow has a second step that is easy to miss: saving the values into the archive is only the first step, and a script reads them back to where the project needs them. Until that read-back exists and has been tested, a flash drive on the panel port is storage, not persistence.

For values you need as history, the archive is the right tool: archive HMI trend data externally covers that case. For values the operator must see again on the screen after a download, PLC registers stay the shortest documented path.

One boundary worth stating here: the HMI is part of the machine control loop. A standalone notice board or andon screen that shows shift targets or queue counts is a different screen that plays its own content, and that second kind of screen is what we build. Our shop-floor signage is the place to look.

Example: size the register block for a recipe screen

A packaging line runs six product families. On the panel, operators enter two strings: a product name up to 64 characters and a part number up to 32 characters. Both must still be on the screen after the panel program is updated for a label change.

The arithmetic, step by step:

  • One register is 16 bits, one ASCII character is 8 bits, so one register holds 16 ÷ 8 = 2 characters.
  • Product name: 64 characters ÷ 2 characters per register = 32 consecutive registers.
  • Part number: 32 ÷ 2 = 16 consecutive registers.
  • Reserved block: 32 + 16 = 48 consecutive data registers, recorded in the PLC project with a start and an end.

The panel recipe operation reads the operator's two entries into those 48 registers, and the PLC program never writes the block, so the block simply holds the data. When the label-change project is downloaded, the new project maps the same two string tags to the same 48 registers and both strings reappear; the text never lived in the panel, so the download could not touch it. Two internal tags holding the same text would come back empty, and the operator would retype all 96 characters on every download.

Recommendation

Recommendation: Sort every internal tag into one of three classes before the panel project is finished. Panel housekeeping values get a start value from an event, triggered so it writes only when the tag sits at its blank or zero state. Operator settings that must ride out a power cycle get Retentive checked in the tag name database and a serviceable panel battery behind them. Recipe names, part numbers and any entry that must survive a panel program download go into one reserved block of PLC data registers, sized at one register per two characters and recorded with a start and an end in the PLC project. Do the sort before the first download, and where a value survives stops being a recovery job.

Questions

How many registers does a 100-character string need?

Use the same ratio: one 16-bit register holds two 8-bit ASCII characters, so 100 ÷ 2 = 50 consecutive registers. For an odd limit such as 81 characters, round up to 41 registers; the two-characters-per-register mapping sets the count, not the exact string length. Size the tag for the longest entry you allow, not the average one.

Retentive is checked and the battery is good, so why does the value still reset each morning?

Check the event list. A startup event that writes the tag on every power-up overwrites whatever was retained, so the retained value only lives until the next boot. Gate the write so it fires only when the tag sits at its blank or zero state, or trigger it from a separate first-run flag, and the retained value survives the boot it was kept for.

Where should a value live if the PLC logic actually uses it?

In the PLC, from the start. Map the panel object straight to the PLC register as an external tag, so the operator entry and the PLC read point at one storage location. An internal tag copy always drifts, because nothing writes the copy back. Once the value lives in the PLC, the PLC retention settings decide how it behaves across a PLC power cycle or a PLC program download; those are separate settings from the panel's.

Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.

Keep reading

Build your signAsk for a quote