05-22-2015 01:05 PM
Hi,
I'm new to Labview so please bear with me. I'm calling a subvi in my main vi and when I close it using the "X" button the main vi freezes. However, if I hault the exceution of the subvi using the red button (which I know shouldnt be done for standard practice), the main vi completes execution. I'm definitely doing something wrong, I just can't seem to figure it out. I've attached the vi's. Any ideas?
05-22-2015 01:19 PM
Your problem is that the subVI is still actually running. What needs to happen is your event structure in the 2400 swI Linear Stain MeasV - LED.vi needs to handle the <This VI>:Panel Close event. You can just add that event to the event case handling the Quit button's value change event. This way, when you close the panel, the code knows to run the cleanup and finish the state machine.
05-22-2015 01:28 PM
^Thank you. That worked like a charm.
05-22-2015 03:38 PM
Yup, front panel open or not has nothing to do with the subVI running or not.
In fact your typical subVI never shows the front panel while it is running and that's typically a good thing. 😄
05-28-2015 01:49 PM - edited 05-28-2015 02:04 PM
EDIT: I now have the exact same problem with another vi. However this time I tried adding the panel close event and it didn't work. Any ideas?
05-28-2015 02:07 PM
Yes. Please learn how to program LabVIEW before going any further.
Included in this link are some very good links for learning on your own. 🙂
05-28-2015 02:16 PM
Maybe you want to wire a TRUE to the loop condition from within the panel close event. Else the VI will keep running with the panel closed, of course.
But yes, start with some basic LabVIEW tutorials. Your code in the toplevel is just a mess. As a first step eliminate all the unecessary local variables and sequence structures. What good is an error wire if you hide the error indicator?
05-28-2015 02:27 PM
I figured it out, it was essentially the same problem. Sorry, everyone - I'm very new to this and so I'm figuring things out as I go.
05-28-2015 02:31 PM
Follow the tutorials, ask us lots of questions. 🙂