Initialize scripts are stopped during execution when user changes screens fast

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
3 posts • Page 1 of 1
flindecke
Posts:69
Joined: Wed Jun 24, 2015 1:54 pm

Initialize scripts are stopped during execution when user changes screens fast

Post by flindecke »

Consider the following situation:
- We have 4 Panels with init scripts. In this scripts we have to modify (at the very last step) a global variable
- When the users changes faster than normal between the Panels, WinCC OA logs an error message, that the thread is stopped while executing an init script
- In this situation the System gets instable (e.g. garbaged screen layouts, Panel references are not displayed anymore, etc …)
- After further navigation between the screens, the ui process crashed without any further log message

The panels are all loaded into a module (using the swipe gesture).
The log message is

Code: Select all

WCCOAui      (1), 2018.11.07 11:57:02.325, CTRL, SEVERE,    176, Uncaught exception in thread started at main: 
WCCOAui      (1), 2018.11.07 11:57:02.324, CTRL, WARNING,    26/ctrl, 
    Module: Vision_21
    Panel: ...
    Script: Initialize
    In panel scope library: ...\\index.xml []
    Line: 240, Der Thread wurde gestoppt, bevor die aufgerufene Funktion fertig war
We are using WinCC OA 3.16 Patch 3.

Question:
- Is there any possiblity to to prevent this situation, i.e. we can handle it by code? E.g. using a try / catch block
- Is it possible to configure the system not to stop execution?

With best regards
Frank Lindecke

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Initialize scripts are stopped during execution when user changes screens fast

Post by leoknipp »

If a panel is closed all running scripts will be stopped/teminated. There is no option in the panel/UI to execute the scripts to the end even if the panel is already closed.
Maybe you can deactivate the possibility to change the panels while the Initialize scripts are running.

A stop of the UI should not occur. If you have a simple example where the problem can be seen easily please get in contact with your common WinCC OA support.

Best Regards
Leopold Knipp
Senior Support Specialist

flindecke
Posts:69
Joined: Wed Jun 24, 2015 1:54 pm

Re: Initialize scripts are stopped during execution when user changes screens fast

Post by flindecke »

Thanks for the clarification. The problem is, that the panel holds some local data and tries to connect itself to another "functional block". This "function block" uses global variables and when the WinCC OA Runtime stops execution of the panel init code, any global variable modification will be in an undefined state.
There is no possibility to solve this behavior and this works only when we do not call any functions which never ever change global state (or state which do not belong to the panel instance itself).

But we are using something like a "publish subscribe component" which uses global variables (to hold the subscribers for each publish event). We MUST call these function in the init script and as i understand we cannot defer it to the latest point in the code, because there could be also the problem of stopping the thread as well. If we move this code to the front of the initialize script the possibility of stopping the thread is lower, because the user has to change the panels faster, but we cannot guarentee that there might be a function call which modifies a global variable (even when we call something of the WinCC OA runtime library as well).

So the question for our customer support is, how to handle this situation in a proper way. We are in touch with our support.

With regards
Frank Lindecke

3 posts • Page 1 of 1