LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubPanel VI not closing correctly

Solved!
Go to solution

I'm using a subpanel in my program which opens in the consumer loop. when the program is stopped the reference to the VI in the subpanel is closed, however when i then go to open the vi which I run in the subPanel I can't open it as it is still in memory or something. this mean i have to close all of labview down just to switch VI's. Does anyone know why my subpanel VI isn't closing correctly? 

 

Labview 14.0

 

Thanks

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 1 of 14
(8,440 Views)

Anyone?

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 2 of 14
(8,419 Views)

Closing the reference to the VI in the subpanel is not enough. You need to tell the VI to stop executing. Typically for this I would use a user event/queue and pass the reference into the VI but you could also have a 'shutdown?' FGV.

 

Edit: Also, your Variant 1, 2, 3 etc. is surplus to requirements. You could have a single 'data' variant and give it a cluster containing the 3 different elements which you then convert using variant to data in the 'process video and data' case of your state machine.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 14
(8,418 Views)

Okay thats sounds great, just to clarify what you mean however as I'm reasonably new to labview. I've now put a stop function in my lower level VI which is in the sub panel so that when i hit 'stop application' it stops the program running. This works, however ideally i would like to stop it also when i press the stop button on the top level VI. Do I do this by passing an input in the to the start asychronous call function which could be a boolean and would then make a 'stop app' case in the subpanel VI. Or does the inputs to the subpanel only get passed once?

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 4 of 14
(8,404 Views)
To stop the dynamically launched VI you need some sort of signalling to tell it to stop. The way I like to do it is to create a user-defined event or UDE that will stop everything when it fires. Here is a post that talks about a nicely encapsulated approach.

http://www.notatamelion.com/2014/10/23/making-udes-easy/

For this technique to work you will need to build your application using event-driven techniques -- other posts on the same site talk about that if you are not familiar with it.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 14
(8,395 Views)

Hi, thanks for replying! I just read most of the post and I don't see how that is relevant to the issue i have. Forive me if it's obvious. All i need to do is pass a stop boolean to a subpanel VI which will then use that in an event driven state machine to stop the VI running. How does what you link solve that, also I can't afford to be changing the whole artitecture of my VI.

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 6 of 14
(8,387 Views)