Explainer
Sending Variable Record Counts to an HMI With Predefined Tags
Short answer
An HMI runtime fixes its configured tag set at compile time, so a variable number of records cannot arrive as new tags. Send a variable record count inside a predefined buffer sized to the known maximum, framed by a record count and a validity marker, and route unbounded growth to an external store that exposes a bounded page to the runtime.

On this page
- Why the tag set cannot grow at runtime
- Separate a changing record count from a changing tag set
- Case 1: a known maximum means a predefined buffer
- Case 2: unbounded growth belongs outside the tag set
- What changing the transport does and does not fix
- Commissioning checks that prove the mapping
- The decision, case by case
- Questions asked
You cannot create HMI tags at runtime, so a data feed whose record count is unknown at design time must not be planned as new tags. The tag set of a WinCC Unified project is fixed when the project compiles; the only thing that can change afterwards is the content those tags carry. That turns the question into a sizing decision. If the record count has a known maximum, move the records through a predefined buffer with a count and a validity marker. If it does not, keep the collection in an external store and expose one bounded page to the runtime. This article gives both designs, the arithmetic that sizes the buffer, and the bench checks that prove the mapping end to end.
Why the tag set cannot grow at runtime #
In a WinCC Unified project an HMI tag is a configured object, not a runtime allocation. You create tags in the tag table editor under HMI Tags in the project tree, bind them to screens, faceplates and scripts, and the compiler folds that list into the runtime project. The tag-management documentation treats adding, removing or renaming a tag as a design-time change that ends with a compile, and a script consumes tags in the same way a screen does. The runtime serves values through the compiled set; its tag model has no operation that declares a new tag name or data type while it runs.
A controller behaves the same way, because its variables live in memory the project allocates before the run. A feed planned as one tag per record, with the count discovered at runtime, therefore has no path in this architecture. The record count is a design-time decision, and after compilation only the contents of the predefined tags can change.
Separate a changing record count from a changing tag set #
A record is one logical unit of data, for example the measurement set for one part. A tag is a named, typed data point the project declares before compiling. A changing number of records does not require a changing number of tags: the receiver reads one predefined array and interprets its content as records, using a count to know which slots hold current data. State the requirement precisely before designing the transport. If dynamic means more records, plan a bounded payload. If it means new tag names or types, no transport solves it, because tag identity is fixed at compile time. Plan the feed as data inside predefined tags, never as the tags themselves.
Case 1: a known maximum means a predefined buffer #
When the record count has a real ceiling, size the storage once and let the sender fill only the valid slots. The envelope needs three things: the predefined array sized to the maximum, a count of valid records, and a marker that separates a fresh payload from a stale one — a generation counter or the records' own sequence numbers both work. Decide the overflow behavior before you compile: if the sender ever holds more records than the buffer takes, it blocks, rejects or batches them. Never truncate silently, because a receiver with no dependable loss indication presents old records as current.
Move the array as one block rather than as individual tags. The documented pattern is an array tag transferred with the array as a block, paired with a short handshake so both sides agree when a payload starts and ends. One block tag also keeps the variable-binding count on the page low, which is the lever described in Why HMI pages lag with many PLC variable bindings.
Worked example: sizing a quality-record buffer #
The field sizes below are chosen for clean arithmetic, and the tag names are yours to choose; this is an illustrative design, not a manufacturer specification. A filling line keeps its most recent 500 quality records on the operator's screen. Each record carries a 4-byte sequence number, an 8-byte timestamp, two 4-byte measured values, a 2-byte status word and 2 reserved bytes: 4 + 8 + 4 + 4 + 2 + 2 = 24 bytes per record.
The buffer is therefore 500 × 24 = 12,000 bytes, plus a 4-byte count of valid records and a 4-byte generation counter, so one refresh moves 12,008 bytes. At a one-second refresh that is 12,008 × 8 = 96,064 bits/s, about 0.1 Mbit/s — a thousandth of a 100 Mbit/s industrial Ethernet link, and worth a second look only on a serial line. Confirm the structure's packed size in the controller declaration, because alignment padding can change it, and take the 12,008-byte figure to the interface documentation for your installed runtime version: the per-message payload limit there is a documented number, not one to estimate.
Case 2: unbounded growth belongs outside the tag set #
If no maximum exists, a fixed array is not a store; it is a window. Keep the collection in the Edge App's own storage or a database service, and expose one bounded slice through the same predefined record tags — for example a 100-record page. The two sides agree on which slice is current: a page number, or the oldest and newest sequence numbers the page covers.
The display then has to be honest about partial data. Show whether the visible page is complete and current, and define the failure cases before compile: what the page shows when the store is unreachable, when records arrive faster than the runtime displays them, and when a transfer stops halfway. Sequence numbers or acknowledgements on each page transfer give the runtime a way to detect staleness and loss; do not assume the transport supplies them on its own.
What changing the transport does and does not fix #
A message-oriented interface, a database link or any other route changes how the bytes travel; none of them creates tag identities after compilation. Open Pipe Connection is the documented route between an Edge App and WinCC Unified runtime, and the comparison between paths is about payload limits, supported data types, connection lifecycle and error reporting for the version installed on the machine. Two faults belong to the transport and not to the data model. A container host that cannot open the WinCC Unified PC OpenPipe endpoint is a hosting problem, covered in Why a Linux Docker container cannot open the WinCC Unified PC OpenPipe. A connection that refuses to open at startup has its own causes, covered in Why WinCC Unified PC Runtime fails to open its PLC connection. Fix those at the host and the connection; do not redesign the tag set for them.
If the requirement truly is new tag names or types at runtime, this architecture cannot deliver it. Reshape the requirement into records inside predefined tags, or move the application to a platform whose data model supports runtime declaration, and verify that support in that platform's documentation before committing.
Commissioning checks that prove the mapping #
Test the mapping on a bench with known payloads before the machine sees it:
- Compile the project with the receiving array, count and generation tags present in the tag table, start the runtime, and open the connection through the project's normal startup sequence.
- Send payloads at the minimum, typical and maximum record counts, and compare every field and the count against the sender's values.
- Hold more valid records than the buffer takes and verify the designed overflow behavior — block, reject or batch — appears as a generation change or a sequence gap, never as silent loss.
- Break the connection mid-transfer and restart it. The display must mark the previous payload stale and resynchronize on the next generation.
- Send one message with two fields swapped and confirm the result is visibly wrong. If plausible values survive a swapped mapping, add a format check before the receiver trusts any payload.
None of this mapping is a safety function. Logic that protects a machine or a person belongs in the controller or the certified safety system, not in an HMI display path.
The decision, case by case #
- Known maximum: define the record layout, size a predefined buffer to the ceiling — the example above moves 500 records of 24 bytes each, 12,000 bytes plus count and generation — transfer it as one block, and give overflow an explicit, visible behavior.
- Unknown growth: the external store owns the collection, the runtime tag set holds one bounded page, both sides agree on which page is current, and the display states plainly when data is partial or stale.
- New tag identities at runtime: not available here, because tags are compiled in and no transport changes that. Turn the requirement into records inside predefined tags, or move to a platform with a runtime data model and verify that support there first.
Questions asked
Can I rename an HMI tag without recompiling the whole project?
A rename is a design-time edit, but it does not force a full rebuild. The tag-management documentation for WinCC Unified tells you to run the Compile command with the Software (only changes) option after renaming a tag, so the runtime takes the renamed tag without recompiling everything else. Either way, the tag exists under some name before the runtime starts; a rename edits a predefined tag and never creates one while the runtime runs.
How does the runtime know that a fresh record set has arrived?
Put a short handshake next to the buffer. The tag documentation shows the pattern built from PLC tags of the Bool data type: two tags for read access and one tag for write access. The sender raises its flag together with the record count, the runtime copies the block and acknowledges, and the sender clears the flag only after that acknowledge. Without the exchange, the screen cannot tell a new payload from the previous one, so a stalled sender looks like live data.
Does the data import function on Industrial Edge deliver these records?
No. The import lives under Configuration, in the Export and Import Data area of the WinCC Unified Runtime for Industrial Edge, and it loads a selected backup file into the runtime. That path restores configuration and stored data after a loss or a migration; it is not a channel from a running Edge App. Records still arrive through the configured connection and its predefined tags, and the backup mechanism stays reserved for restore work.
Can a numeric field in a record be given an acceptable range?
Yes, and the place to do it is the tag. WinCC tag configuration lets a numerical tag carry a high limit and a low limit that define its value range, so a field that leaves its range is flagged at the tag instead of passing silently into the display. Set those limits from the producer's real span, and treat a limit flag as a data-quality signal from the tag, separate from any transport error.


