05-06-2015 02:17 PM
1.) The static VI is perfectly fine. I did the test of removing the open and close references, calling the VI inline with the test. There was no error using this method. Sadly this will not work in my application, since the contents of that VI will change depending on the test I am running.
2.) I did the test of open VI reference, with the calling VI disabled, and then closing the reference. This is shown above with the calling VI in a disable structure. The hidden enable case only sets a boolean constant for the output. So basically the process is just open and close the dynamic VI. The issue with my front panel is still present.
It's not the VI itself, its the act of opening the VI that is causing me to loose control of my front panel.
The way I test this is I have a Tree control with a scroll bar. When I scroll up and down I will loose control of the scroll bar when this function executes.
This is a strange issue. I have had several strange bugs pop up since I updated to 2014, I wonder if that's all it is.
05-06-2015 03:34 PM
It makes no sense to me why you'd lose control of your front panel. I believe the act of opening a VI could cause a delay, in your VI, but I don't think it should affect your UI.
If did something like run a 20 second while loop in the subVI (with a wait statement in there so it isn't a greedy loop), do you lose control of the front panel during the whole 20 seconds? Trying to figure out if it is the act of opening causing the problems, or if you have problems the entire time it is open.
Have you tried opening it without the hex10 setting?
If it is just the act of opening the VI that is causing the problem, then I would suggest opening the reference to the VI before you need it and store it in a shift register or functional global variable. Where is the VI you are opening located? Is it on a network and the network communication is slow? Is your dynamic VI saved and compiled in your version of LV? (Looks like it was saved in LV14, but if it was opening an older VI, then the version recompile might be slowing it down.)
05-06-2015 04:17 PM
Ah, I think your right. That seems to fix it.
What I did was I created a temporary dummy reference and loaded it into memory at the very beginning of my program. I then opened the reference there. The I simply use that reference every time my while loop executes. I had no loss of my front panel.
I also tried the other suggesstions. I added a 10 second delay in my called VI. There was only a brief hiccup due to openning the VI.
I removed the 0x10 option, with no change.
I plan to re-work my code to use the above method. I think that will work fine, and would probably be much more efficient anyway.
Thank you for the help.
05-07-2015 04:18 AM
Oh, the reason it causes a delay in the UI is because you are opening the reference by path instead of 'by name'. This blocks the UI thread.
You can read about it here: http://www.labviewcraftsmen.com/blog/the-root-loop
You can avoid this problem by using static VI references (if you're calling it multiple times but statically) or opening and holding the reference to the VI on first call (so you take the hit on the first time the VI is called dynamically but subsequent calls are from memory).