IMDTouchKnowledge BaseShop main store

Troubleshooting

Fix a Vijeo Designer Popup Blocked by a Script Busy Wait

HMI and touchscreens Published 6 min read

Short answer

The popup is queued, not broken: while the script's do...while loop counts to 100000, the runtime paints nothing, and the close and navigation that follow overtake the open request. Delete the loop, run the save in stages that each return control, and call close(), open(x, y) and show(true) only after changePanel(panelID) returns true.

On this page
  1. Symptoms that point to a blocked runtime
  2. Why the busy-wait loop hides the popup
  3. Remove the loop and stage the save
  4. Open the popup in the order the runtime uses
  5. Read the generated simulation code
  6. The decision for each symptom
  7. Questions asked

The popup is not broken; your script never hands control back. A Vijeo Designer script runs on the execution path that also paints screens and services events, so the popup request queues behind the do...while counting loop and is overtaken by the close() and the navigation that follow it. The 100000 in that loop counts iterations, not milliseconds. Delete the loop, split the save into stages that each end the script, and open the popup in the order the runtime itself applies: close(), open(x, y), then show(true) only when changePanel(panelID) returns true.

Symptoms that point to a blocked runtime #

The reported case: Vijeo Designer 6.2.5.36, a Magelis HMIGTO 6310 target, a save branch in case 8 that opens a popup named PopUpSauveParam on screen ID 10005, writes 15 parameters, waits, then returns to the home panel.

  • In simulation, a black rectangle the size of the popup window, with no content.
  • On the panel, no popup at all; the display lands on the home panel once the script ends.
  • The popup occasionally renders correctly, which points to a race rather than a damaged panel object.
  • Swapping the progress popup for a different popup reproduces the black window, so the panel object is not the fault.
  • The decisive observation: an on-screen clock stops updating for the whole wait. Everything that refreshes freezes together, which indicts runtime execution, not the popup.

While the script runs, alarm and event display is frozen with that clock, so reproduce the fault on a bench or with the process in a state that does not depend on the screen.

Why the busy-wait loop hides the popup #

The save branch as it ran:

case 8: // parameter save
    PopUpSauveParam.open(200, 275);
    PopUpSauveParam.show(true);
    PopUpSauveParam.changePanel(10005);
    int X = 0, Y = 0;
    for (X = 0; X < 15; X++) {
        Affectations[X].write(Affectations_temp[X].getIntValue());
    }
    do {
        Y++;
    } while (Y < 100000);
    PopUpSauveParam.close();
    Xbt_sauv_param.write(true);   // validation for the server
    _CurPanelID.write(1);         // back to the home panel
    break;

While a script executes, the runtime queues display and event work and processes it only after the script ends — the same starvation that Why an HMI Screen Freezes Until a Script Finishes describes for whole screens. The three popup calls post requests; they do not paint. By the time the runtime could draw anything, the script has already posted close() and written _CurPanelID to 1, so on the panel the window is created and dismissed without ever becoming visible, and in simulation you catch it as an unpainted black rectangle.

What Y < 100000 actually buys: one increment, one compare and one branch, repeated. Illustrative costs, not measurements: at 1 µs per iteration on the simulation PC, 100000 × 1 µs = 0.1 s of frozen display; at 10 µs per iteration on a panel-class processor, 100000 × 10 µs = 1.0 s. The verified fact from the case is the frozen clock, because the cost per iteration depends on the processor. The loop measures nothing about whether the server has consumed the writes, and raising the count to wait longer extends the freeze one for one.

The first attempted fix in this case, a delay loop added at the start of the script, changed nothing — it is more counted iterations ahead of the first return. The only boundary that frees the runtime is the end of the script execution.

Remove the loop and stage the save #

Rebuild the save as a sequence of short executions, each of which does its work and ends. Track position with an integer stage tag, initialized to 0 and held somewhere it survives between executions:

  1. On the confirmation button's Yes: close the confirmation popup, open the progress popup with the order below, set the stage tag to 1, and end the script.
  2. On the next execution, from a periodic script or timer event: run the bounded for loop that writes the 15 parameters — bounded work is not the fault — set the stage tag to 2, and end.
  3. While the stage tag is 2, evaluate elapsed time against a start timestamp on each execution instead of spinning. A runtime-supported wait is acceptable only in this shape: it still ends with the script returning.
  4. When the wait condition is met: write Xbt_sauv_param to validate for the server, close the progress popup, write _CurPanelID to 1, and reset the stage tag to 0.

Between those executions the runtime paints the popup, refreshes the clock and services variables. One long execution is never safe, no matter where inside it the popup opens.

Open the popup in the order the runtime uses #

The Java that the simulation build generates shows the order the runtime applies for a standard open-popup action, and it matches the script syntax the vendor documents for opening a popup window. Generic form, with NomFenetre the popup object and panelID the screen number:

NomFenetre.close();
NomFenetre.open(xPos, yPos);
if (NomFenetre.changePanel(panelID))
    NomFenetre.show(true);
else
    NomFenetre.close();

Applied to this project — popup PopUpSauveParam, screen 10005, position (200, 275):

PopUpSauveParam.close();
PopUpSauveParam.open(200, 275);
if (PopUpSauveParam.changePanel(10005))
    PopUpSauveParam.show(true);
else
    PopUpSauveParam.close();

Read it as four rules:

  • close() first clears any previous instance of the window.
  • open(xPos, yPos) creates the window where you point it — this pair of arguments is also how you pin a popup to an exact position.
  • changePanel(panelID) selects the screen and returns a Boolean. The failing script called it last and ignored the result.
  • show(true) runs only after a successful selection. On failure the window stays closed, and the fault is the screen number or its assignment, not the script order.

The test that proves the fix: run the opening stage alone in simulation and confirm the rectangle, its text and a clock that keeps updating; repeat on the panel. If changePanel(10005) returns false, correct the screen assignment before running the save again.

Read the generated simulation code #

For Vijeo Designer 6.2 on Windows 7 or 10, the simulation build compiles readable Java under C:\Users\Public\Documents\Vijeo-Designer 6.2\_sim\IHM, next to the working folder C:\Users\Public\Documents\Vijeo-Designer 6.2\Vijeo-Manager. The initial class sits in Startup.java; each screen's display code sits in a Panel file whose name carries the screen number; its calculated expressions sit in the matching expressions file; and the screen's script code sits in the corresponding script file. Reading that output settles questions such as method order for any standard operation you want to reproduce in script. Treat it as reference only: editing generated output is the same dead end explained in Why the compiled HMI project view is not for editing.

The decision for each symptom #

What you observed Decision
Black popup rectangle in simulation, clock stopped The runtime is starved: delete the do...while and stage the save.
Nothing on the panel, then the home panel Same cause: the queued open is overtaken by close() and the navigation; staging fixes it.
Popup appears only occasionally A race between the queued open and the close behind it; staging removes the race.
A different popup shows the same black window The panel object is fine; keep the fix on the execution path.
Clock updates, popup content stays empty Not starvation: read the changePanel(panelID) result and verify the screen number.
changePanel returns false The screen ID or its assignment to the popup window is wrong; fix that and retest the opening stage alone.

In every case the loop goes, each stage ends its own script execution, and the Boolean is checked before the window is shown.

Questions asked

Why did a delay at the start of the script not fix the popup?

Because that delay was another counted loop ahead of the first return. The runtime paints only after a script execution ends, so time burned before the open call is as blocking as time burned after it. In the reported case the pre-delay changed nothing, and that failure is itself diagnostic: any fix that keeps the whole save inside one execution keeps the popup queued.

Is the 100000 in the wait loop a time value?

No. It is a count of loop iterations: one increment, one compare and one branch, repeated 100000 times. Even at an optimistic 1 microsecond per iteration that is 0.1 s of frozen display, and the cost per iteration differs between the simulation PC and the panel, so the loop cannot be calibrated into a timer. Elapsed time must come from a timestamp checked on later executions.

changePanel(panelID) returned false. What is wrong?

The screen number you passed does not match a screen assigned to that popup window. Open the panel identification in the project, confirm the ID, 10005 in the case described, and confirm the screen belongs to the popup and not to a standard panel. Retest with the opening stage alone before running the save sequence again.

Where does the simulation put the generated Java?

For Vijeo Designer 6.2 on Windows 7 or 10, under C:\Users\Public\Documents\Vijeo-Designer 6.2\_sim\IHM, next to the Vijeo-Manager working folder. Startup.java holds the initial class, and the screen display code and its calculated expressions sit in Panel files whose names carry the screen number. It is reading material only, and you should confirm the working folder for your installed version.

Does the blocking only affect popups?

No. The same execution path refreshes clocks, variable displays and alarm and event lists, so all of them freeze together while the script runs. A frozen alarm list during the wait is a real operational risk, which is why you verify the staged sequence on a bench with the process in a safe state before returning the panel to service.

Keep reading

  • Troubleshooting

    Why a WinCC connection alarm cannot hand its text to a script

    WinCC Advanced V13 has no documented VBScript interface that hands the resolved text of system event 220006 to a script, and that event reports a restored connection, not a lost one. GMsgFunction, the Horn tag and the AlgView database belong to other editions. Keep system events for the operator, identify the failed Modbus RTU slave from per-device status tags, and trigger the script from those.

    HMI and touchscreens

  • Troubleshooting

    Fix a PanelView Float Display Showing the Wrong Value

    The PLC is right and the display is misreading it: a PanelView numeric display shows 6040 because its tag's Data type is set to unsigned integer while F8:9 holds a 32-bit float. Set the tag to IEEE Float/REAL in the tag form editor, confirm the object uses that tag, and the display reads 1.60072.

    HMI and touchscreens

  • Troubleshooting

    Why WinCC 7.5 Runtime Fails Under a New Windows User

    Runtime failing under a newly created Windows account while Explorer opens is a Windows security-context problem, not a WinCC project problem. Put the account in the SIMATIC HMI group, sign out fully, verify effective access to the project, and after an Admin password change update the logon identities of services and scheduled tasks.

    HMI and touchscreens