LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI not closing properly

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?

Download All
0 Kudos
Message 1 of 9
(3,475 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(3,464 Views)

^Thank you. That worked like a charm.

0 Kudos
Message 3 of 9
(3,455 Views)

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. 😄

0 Kudos
Message 4 of 9
(3,430 Views)

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?

Download All
0 Kudos
Message 5 of 9
(3,335 Views)

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.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 9
(3,318 Views)

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?

0 Kudos
Message 7 of 9
(3,305 Views)

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.

0 Kudos
Message 8 of 9
(3,297 Views)

Follow the tutorials, ask us lots of questions.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 9
(3,292 Views)