LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to close a VI and open another VI

Hi everybody,

on my project I have created 2 different VIs, "MASTER" and "SLAVE".

When the VI MASTER is running by a push button present on the Front Panel I want to open the VI SLAVE and close the VI MASTER.

When the VI SLAVE is running by a push button present on the Front Panel I want to open the VI MASTER and close the VI SLAVE.

 

Anybody can help me?

Many thanks in advance.

Luca

 

 

0 Kudos
Message 1 of 11
(3,454 Views)

Does it actually need to close or can it just hide the VI and keep it running?  This method is much easier and can be done by setting the Front Panel State, through the property node on the VI.  If you actually want to stop the execution of the other VI this could probably be done by passing in a reference like a queue or user event and command the other VI to react to it.

0 Kudos
Message 2 of 11
(3,444 Views)

Thanks for your answer.

I want to close the runnig VI MASTER and open the VI SLAVE. Then I want to close the running VI SLAVE and re-open the MASTER VI closed. And so on.

 

0 Kudos
Message 3 of 11
(3,438 Views)

@LucaMatulli wrote:

Thanks for your answer.

I want to close the runnig VI MASTER and open the VI SLAVE. Then I want to close the running VI SLAVE and re-open the MASTER VI closed. And so on.

 


By " close the runnig VI MASTER " do you mean;

 

close the VI and remove it from memory

 

OR

 

Close the Front Panel of the running VI

 

?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 11
(3,433 Views)

Yes, close the VI and remove it from memory.

Many Thanks

0 Kudos
Message 5 of 11
(3,430 Views)

Why is it necessary to remove it from memory when it is likely you'll be reopening it again?

0 Kudos
Message 6 of 11
(3,420 Views)

Okay here is a quick demo which uses the static VI reference to open a reference, and run the other VI, then close the current one.  There are multiple other ways to accomplish this.  But I agree a better method would be to keep both VIs in memory, or even both VIs running and then just show or hide one.

0 Kudos
Message 7 of 11
(3,417 Views)

Because the VIs are very heavy as memory usage. Now I am hidding the MASTER VI when the SLAVE is runnig but with 2 running VI the pc is slowly.

The MASTER is the MAIN PAGE where the operator write all the data for the test, the VIs SLAVES are different VIs where is possible perform different tests. At the end of each test the procedure expect to come back to the MAIN PAGE again and only from the MAIN  it is possible to open a new SLAVE VI for a different test.

 

 

0 Kudos
Message 8 of 11
(3,406 Views)

Okay.  As long as you have a good reason.  Sometimes people say they want something specific and lock themselves into a specific scenario when if they open up their minds a bit, a simpler and easier solution is available.  They are too busy asking questions about how to do something a complicated way rather than posing the question as what they are really trying to do and what is the best way to do that without predetermining the path to take.

 

Even now, you are talking about 3 slave VI's, when originally you were only talking about 1. So the real problem is 1 main VI and 3 Slave VI's all open at once are all too much memory,

 

Is the Main VI a heavy memory usage, or just all 3 of the slave VI's?

 

I would expect the Main VI to be lighter weight.  If so, I would have that remain in memory but hidden and just open up the particular slave VI at that time.  When the slave is done, it will close itself and pass control back to the main VI still in memory.  Then it can go and open the next slave VI.

 

 

0 Kudos
Message 9 of 11
(3,401 Views)

@LucaMatulli wrote:

Because the VIs are very heavy as memory usage. ...

 

 


God knows I have written my share of code that requires a lot of memory but I have to ask...

 

Is the heavy use of memory intended and expected?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 11
(3,396 Views)