LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Popup window with .net control slow to close, affecting main window

Solved!
Go to solution

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?

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 21 of 27
(680 Views)

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.

0 Kudos
Message 22 of 27
(671 Views)

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.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 23 of 27
(653 Views)

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.

0 Kudos
Message 24 of 27
(646 Views)
Solution
Accepted by topic author RogerSaele

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.

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 25 of 27
(627 Views)

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

0 Kudos
Message 26 of 27
(621 Views)

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.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 27 of 27
(618 Views)