Troubleshooting
Why a WinCC VBScript table screen takes 20 seconds to open
Short answer
The opening is slow because each scripted field reads its characters one tag at a time: 18 rows × 10 fields × about 8 reads = 1,440 individual tag operations. Group the reads into one call where the runtime offers grouped access, or compose the strings in the PLC; rescheduling the same loops never fixes it.
On this page
- Why does the table screen take about 20 seconds to open?
- How many tag reads does one screen opening actually fire?
- Why is reading tags one at a time in VBScript so slow?
- Why didn't splitting the reads across scheduled tasks fix it?
- Should the PLC compose the strings instead of the HMI script?
- How do you fix and verify the screen opening time?
- What keeps the screen fast after the fix?
- Questions asked
Your screen is slow because of how many tag operations it fires when it opens, not because the VBScript loop is written badly. Eighteen prefixed screen windows, ten scripted I/O fields each, and a loop that fetches characters one tag at a time add up to a queue of well over a thousand individual tag reads that the runtime must service before the last row fills in. Cut the operation count and the opening collapses with it: group the reads into one call where your runtime version offers grouped access, or have the controller compose each column into a string tag the HMI reads directly. Rescheduling the same loops into smaller timed batches did not fix the behavior in testing, because scheduling changes when the work runs, never how much of it there is.
Why does the table screen take about 20 seconds to open? #
Because every scripted field fetches its characters one tag at a time, opening the screen queues more than a thousand individual reads behind one another, and on the panel PC that showed this behavior the whole table needed about 20 seconds to load.
The observed pattern is the signature of that burst. The screen behind these numbers ran WinCC Professional Runtime from TIA V13 SP1 Up4, and each row appeared a second or two after the previous one; once every row had initialized, values updated in a blink, because the cyclic refresh is a tiny workload next to the opening queue. A slow computer would show slow updates all the time — this one only struggled while the queue drained, so the machine was never the constraint. Delayed population at activation also appears in faceplates for a different reason; that separate mechanism is covered in why WinCC Runtime faceplates load slowly on screen activation, so confirm your fields run scripts before borrowing its fixes.
How many tag reads does one screen opening actually fire? #
Multiply fields by reads per field: 18 rows × 10 I/O fields = 180 fields, and at the planning figure of 8 character reads per field one opening fires about 1,440 individual tag reads — the database of over 10,000 character tags never enters the arithmetic.
Only the reads fired at opening matter. The planning figure of 8 exists because the fields are not uniform: most concatenate around 8 characters, some only 2 and a few up to 12, which brackets the true burst between 360 and 2,160 reads. Whatever your field mix, the count lands in four digits, and every one of them is a full tag operation.
| Line | Count |
|---|---|
| Screen windows, one per table row, each with its own prefix | 18 |
| Scripted I/O fields per window | 10 |
| Fields on the screen | 18 × 10 = 180 |
| Character reads per field (planning figure; real fields run 2 to 12) | 8 |
| Individual tag reads per opening | 180 × 8 = 1,440 |
If your table differs, recount with your own numbers. Rows × fields × reads per field is the whole calculation, and it is the only input the opening time responds to.
Why is reading tags one at a time in VBScript so slow? #
Because each single-character read is a complete runtime tag operation with its own access and bookkeeping, 8 reads in one field loop are 8 full operations, and the loop syntax was never the expensive part.
Scripted tag access is charged per call. Every call resolves the tag, transfers the value and updates the quality and timestamp bookkeeping, so the total cost scales with the number of calls, not with the number of characters. A loop of 2 reads is cheap and a loop of 12 is worse in exact proportion.
The direct correction is grouped access. In classic WinCC V7/V8 scripting the grouped object is TagSet, which reads or writes many tags in one step; a reported WinCC V7.5 project replaced a repeated-write loop over a small tag group — more than 20 seconds of execution — with one grouped write per pass, and the same work dropped to 3-4 seconds. Treat that as evidence for the access pattern from another project, not as a timing promise for your target. Check the scripting documentation of your exact runtime version for its grouped-read facility before you build on it; the direction of every recent generation is fewer, larger operations, down to WinCC Unified's documented Read method on a tag object, which returns value, quality code and timestamp in one call.
Why didn't splitting the reads across scheduled tasks fix it? #
Because scheduling only moves the work, it never shrinks it: in a stripped-down project whose data task read just 28 character tags every 500 ms, a separate lamp task meant to blink once a second stopped blinking evenly the moment the read task ran.
That reduced test isolates the mechanism. The project was cut to two screens and two scheduled tasks: one flips a bit every 1 s to prove the runtime still responds, the other reads 28 character tags and writes them into one string. With only the bit flip running, the lamp is perfectly regular; enable the read task and the lamp visibly stutters. Nothing else runs in that project, so the disturbance comes from the per-tag operations themselves — 28 of them every 500 ms are enough to derate other cyclic activity on this class of panel PC.
Two documented facts bound the scheduling side. The fastest trigger available for WinCC Runtime Professional is 250 ms, which is the screen cycle this project used, so a script that consumes more than one cycle collides with the next before it finishes. And an earlier attempt on this screen scheduled 520 character tags — 10 vehicles × 52 character fields per vehicle = 520 — into one pass each interval, which is the same trap scaled up: one giant burst per interval instead of a small one.
Segmenting reads can cap what a single trigger launches, and pacing is genuinely useful once the operation count is right; the mechanics of pacing script-driven tag updates are covered in HMI periodic tag updates by script and scheduled task. As a fix for this symptom it failed in test and will fail for you: halve the batch and the queue simply returns twice as often. Reduce the operation count first, then schedule.
Should the PLC compose the strings instead of the HMI script? #
Yes — the controller already owns the characters, so let it assemble each column into its string type and expose one string tag per displayed field; the opening then needs 1,440 character reads replaced by 180 string reads, one operation per displayed value.
Composition moves the loop to where the data lives. The controller holds the vehicle data as individual character tags — Vehicle[number].color_1 and its siblings — so a short routine there writes each field string once when the data changes, and the HMI field binds straight to that string tag with no script at all. The database of over 10,000 character tags stays in the controller, and the HMI sees only the display values.
Size the strings deliberately. Give each string tag the exact maximum length of its column and match the HMI output field to it, so a short value carries no trailing spaces and a long one is not truncated. If you remain on classic WinCC V7/V8 scripting, the raw data type is the bulk route for large data blocks in one operation; how much data one transfer can carry depends on the PLC type, so check that limit for your controller before sizing columns around it.
This option also deletes the scheduled-task traffic: the controller holds finished strings, the panel pulls one string per field, and no HMI loop over characters exists anywhere in the project.
How do you fix and verify the screen opening time? #
Replace the per-character loops, then measure the same opening twice: record the current opening as your baseline, apply grouped reads or controller-built strings, and confirm the row-by-row loading burst collapses instead of merely shifting later.
- Time the current screen from runtime start to the last populated row, and note how long each row takes to appear. That pair of numbers is the baseline every later measurement compares against.
- Start the responsiveness probe: the bit-flip lamp task from the reduced test. Watch it while the table opens. Even blinking means the runtime keeps up; stuttering means a script is overrunning its cycle.
- Replace the read pattern: grouped access in one call where your runtime version's scripting offers it, or one string tag per field composed in the controller. Leave the triggers alone.
- Reopen the screen and time it again. A successful fix moves the opening from tens of seconds to a few; if the seconds did not move, recount reads, because a per-character loop survived somewhere.
- Let every scheduled script run for several cycles with the lamp probe on, and confirm each script finishes before its next trigger fires, so no batch ever stacks on itself.
What keeps the screen fast after the fix? #
Hold the design rule that created the speed: one runtime tag operation per displayed value, scripts that finish inside their trigger intervals, and no HMI loop over characters anywhere in the project.
- Bind each display field to the coarsest tag that carries its meaning: a string for text, a value for a number. Characters are controller-internal detail, never an HMI interface.
- Group related reads into one call whenever the scripting interface of your exact runtime version provides it, and verify that facility in the version documentation, because grouped access differs between WinCC generations.
- Give every scheduled script a work budget it can finish inside its interval; the 250 ms screen cycle is the drum everything else has to beat.
- Keep the bit-flip lamp task in the project as a permanent regression probe; stutter in that lamp is the earliest sign that scripting load is creeping back.
- When a column or a row is added, recount fields × reads per field and re-time the opening. The count, not the layout, sets the opening time.
The decision, then: use grouped access as the immediate relief if your runtime version provides it, move every column to a controller-built string tag as the durable fix, and treat any scheduled character loop in this project as debt to be paid off.
Questions asked
Does grouped access help tag writes the same way it helps reads?
Yes, and the strongest reported case was on the write side: a WinCC V7.5 project wrote to an 18-tag group 30 times per pass and needed more than 20 seconds; combining the 18 tags into one group brought the same work down to 3-4 seconds. Writes pay the same per-operation cost as reads, so any loop that writes tag after tag should be collapsed the same way. The object to reach for in classic WinCC V7/V8 scripting is the same grouped TagSet the reads use.
Why do the rows appear one after another instead of all at once?
Each row is its own prefixed screen window, and each window runs its own field scripts when the table opens it. The windows therefore share the same runtime capacity while it is busy with the opening burst, so they complete in sequence rather than together. After the burst ends there is nothing left to queue, which is why updates then land almost immediately — the delay is initialization traffic, not display refresh.
Does it matter which panel PC model the runtime runs on?
Far less than the script does. The same screen that needed tens of seconds to open updated in a blink once loaded, so the machine was never short of processing power; the cost is per tag operation, and cutting operations fixes it on the same hardware. Still confirm the exact model designation and runtime version against the manufacturer documentation before you rely on any grouped-read facility, because scripting features differ between runtime versions.
Is one big screen better than many prefixed screen windows?
Not on its own. The window layout is not what costs the time; the read count is. Rebuilding the table as a single screen with the same scripted fields fires the same operations and stays slow. Merge windows only if it simplifies engineering, and bind each field directly to a string tag so the opening needs one read per field with no script in the loop.
How small should a scheduled script's workload be?
Plan the workload so the script finishes well inside its trigger interval, and verify it by watching a task you know is fast. In the reduced test, 28 character tags each 500 ms was already enough to make a one-second lamp blink unevenly, so treat scheduled character loops as suspect from the first dozen reads; grouped or PLC-side access removes the question instead of tuning it.