06-24-2014 01:56 PM
Hi,
I am trying to open a pop up vi from an event. I have been struggling with this for a while now. When i open a pop up vi and close it, the main vi stops running properly.
I have narrowed it down to the fact that the event which calls the subvi never finishes when the subvi is closed.
The attached image is an example of what I am currently doing. When I run this, i never see the dialog box that says 'here'
maybe useful as a hint to the problem...
This does work properly if I run the vi, click to open the subvi, close the subvi, (here the main vi is not working properly, cant click anything) then stop the main vi, run the main vi again, open and close the subvi, and then i see the 'here' dialog, and my main vi functions properly.
thanks
J
Solved! Go to Solution.
06-24-2014 02:08 PM
06-24-2014 02:29 PM
What is actually happening is you hit the Ok button and your panel closes and you set the Stop 2 to True. Ok, that is fine except for the fact that the Stop 2 terminal has already been read during that iteration of the loop. So the loop will go again. This time is has read the Stop 2 at a TRUE, but the event structure needs an event before the loop can complete. But the front panel has been closed already and you are stuck.
As Dennis said, get rid of the Stop 2 and just wire the TRUE constant straight out of the event case. Wire a FALSE for all of the other event cases.
06-24-2014 02:41 PM
Thank you for the reply. The method you have mentioned led me to needing to use the fp.close.
If i stop the vi using an event, the vi still runs and never closes. Here is what i have tried.
06-24-2014 02:48 PM
crossrulz,
Thanks for your help, that makes sense and it works now.