From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating panel close programmatically

Solved!
Go to solution

hi nijams,

I have modified some of the VI properties and I can open any SubVI even if other is running.

Labview user
0 Kudos
Message 11 of 15
(1,320 Views)

 hi jcarmody         


jcarmody's wrote

In that case, you can use a standard global variable, notifier, queue or FGV to communicate to all sub VIs that they need to close and handle whatever needs handling in them when the main VI is closed.  Each sub VI can also handle their own Panel Close event in an Event Structure.


Can you tell me what is FGV??

 

Labview user
0 Kudos
Message 12 of 15
(1,320 Views)

FGV stands for Function Global Variable

 

http://labviewwiki.org/Functional_global_variable

 

https://decibel.ni.com/content/docs/DOC-2143

 

Did you give a try using boolean Globals to stop the sub vis ?

 

0 Kudos
Message 13 of 15
(1,318 Views)

Hi

 

I have some suggestions:

 

1. the block diagram design is not the best approach. suggest you to use event strcutures. you can have a single event case handle more than a single event. attached image uses and event structure

 

2. in your design, if you do not close the sub vi, other sub vis cannot be opened. so, you can use dynamic vi calling as shown in the image attached with this post. you must set 'wait until done' to false.

 

3. i would suggest using functional globals to pass the 'panel close' event or stop event to the sub vis. for example, i had shown a global variable. you can write to the global variable in the event for panel close or for stop button event. pass this event value to the sub vis using FGV or a normal global variable.

 

this design will help you in scaling your code in future and to handle the user events in a better way.

 

Note: place your boolean controls correspondign to each event inside the respective event cases and set the mechanical action of the buttons to latch when pressed.

 

 

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 14 of 15
(1,312 Views)
Solution
Accepted by topic author Aojha

HI all

Thanks for your suggestions.

I will try it and come back to you.

Thanks agian.

Labview user
0 Kudos
Message 15 of 15
(1,293 Views)