07-03-2014 02:26 AM
Hello Roger,
I have something in mind that we could try, but I don't know if it will resolve the issue. (I haven't been able to test it yet)
Does closing the reference block all VIs or only the one from which you are closing the reference?
It might be useful might try to (open and) close the VI from a thread/VI that runs in parallel of the main VI (kind of like a "deamon" thread/VI)".
I don't know if I will be able to test this at my side before tuesday (customer visits+short holiday), but would this be an optional work-around for you?
07-03-2014 05:45 AM - edited 07-03-2014 05:58 AM
Good suggestion, but it unfortunately does not seem to work. The closing hangs not only the calling VI, but the entire application it seems. But I may have misunderstood how the "deamon" VI should be run though.
07-08-2014 02:54 AM
Hello Roger,
Can you share what you have tried?
It could be due to the fact that the VIs are using the same execution system.
07-08-2014 03:36 AM
I just used a top-level VI to run my main VI and a "launcher" VI (responsible to launching popups). The main VI would use a named notifier to tell the "launcher" VI to create a new popup.
07-09-2014 06:47 AM
Hello Roger Saele,
I have been able to do more tests based on some narrowed down code.
These test showed me that:
- Any VI that contains this specific .NET control and is dynamically loaded (in the 0x08 way) will have a long load and unload time. (independent of Execution System)
During this load and unload time of the .NET Control the User Interface Execution System (ES) will be used by the called VI (independent of the set ES in the Execution category in the properties of the called VI).
- Since the User Interface Execution System is single threaded and the dynamic (un)loading of this .NET Control in the called VI blocks this thread, the Front Panel of the main/caller VI will also block.
This is because the main VI also needs to use the same User Interface Execution System to handle it's Front Panel Interactions.
If you want to keep the main VI always (fastly) responsive, then I would suggest that you keep the "thing" that contains the .NET Control always in memory until you no longer need it.
This way you will load it only once (in the beginning of your application) and unload it only once (when closing your application).
This "thing" could be a VI, but other approaches you might take could involve keeping in memory subpanels, XControls,...
PS: I went also to the point were I only had the .NET Control in my called VI (and the functionality to close it) and even this gave me similar (un)load times that block the caller/main VI's Front Panel.
This "blocking time" seemed to be independent of the usage of the Dispose function and the closing of the open references in the called VI.
07-09-2014 07:45 AM
Hi Thierry,
This is what I ended up doing, i.e. reusing the popup VIs and unloading only on application close. This seems to work fine and also has the added benefit of no load time second time you "open" the popup.
Thanks a lot for your help 🙂
Roger
07-09-2014 07:53 AM
Sorry it took me so long. 🙂
For some reason it took me too long to just do a fully stripped down test of the VI.