LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Vi at the end of another

Solved!
Go to solution

Hey,

I programmed 2 vi's that run perfect seperately, but I am trying to run the 2nd Vi once the first one ends, I want the first Vi to close out and automatically open + start the next

0 Kudos
Message 1 of 16
(3,033 Views)
Put both VIs on a block diagram. Connect the error out of VI 1 to the error in of VI 2. If you need the front panels visible, you can set that in the VI Properties.
Message 2 of 16
(3,028 Views)

Dennis Knutson wrote:
Put both VIs on a block diagram. Connect the error out of VI 1 to the error in of VI 2. If you need the front panels visible, you can set that in the VI Properties.

How do I put them on a block diagram?

also what If I want only the running VI to be visible?

thanks so much  :smileytongue:

0 Kudos
Message 3 of 16
(3,023 Views)

spole96 wrote:

How do I put them on a block diagram?


Have you gone through the tutorials or have at least opened the Help file? To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

Message 4 of 16
(3,021 Views)

I think you may be confused as to what I am asking.

I have 2 completed Vi's that have both front panels and corresponding block diagram's

I want to have at the completion of 1 Vi close itself and call the 2nd Vi and automatically run that Vi

 

for example I want to double click on Startup.Vi have it run, and at the completion of it close Startup.Vi and automatically open and run Control_Panel.Vi

0 Kudos
Message 5 of 16
(3,013 Views)

Use VI Server.

 

 Write a reference out of each of your VIs to your "main" block diagram. Then use property nodes to open the front panels and make them visible. Once the VI is done, you can close the reference.

 

Is this more of what you are looking for? You will have a VI that treats your other two VIs as subVIs, but you will be able to see their front panels while they are running.

Chris Van Horn
Applications Engineer
Message 6 of 16
(3,009 Views)

Chris_VH wrote:

Use VI Server.

 

 Write a reference out of each of your VIs to your "main" block diagram. Then use property nodes to open the front panels and make them visible. Once the VI is done, you can close the reference.

 

Is this more of what you are looking for? You will have a VI that treats your other two VIs as subVIs, but you will be able to see their front panels while they are running.


 

This is more of what I am looking for, but is there a way to make it automatically close the first Vi when finished?
or would you manually have to close the windows

this may be a little more complicated than I originally hoped

 

0 Kudos
Message 7 of 16
(3,005 Views)

You can do it programmatically with property nodes and invoke nodes, it would actually be fairly simple for you, no worries on the complications.

 

I attached a quick image for you (obviously not your complete goal) but you can see the reference, an FP open and an FP close. This will programatically open and close the front panel of THIS VI. 

 

For your case, you will want to reference your subVI to open and close the front panel.

 

 

Message Edited by Chris_VH on 04-16-2009 01:13 PM
Chris Van Horn
Applications Engineer
Message 8 of 16
(2,992 Views)

 

Thanks for the reply Chris, I'm a little confused as to actually what I'm doing

does this look along the right lines? I didn't put a FP.close for the final VI becuase when the 'OFF' button is pushed it should exit labview

 

and could someone with labview 8.6 convert this vi down to 8.0?

http://forums.ni.com/ni/attachments/ni/170/400764/1/example.vi

I'm trying to learn from that VI

Message Edited by spole96 on 04-17-2009 07:25 PM
0 Kudos
Message 9 of 16
(2,939 Views)

 

or would something like this be more simple, I would just link the first and 2nd run VI commands and tell the 2nd run command which VI to run?

0 Kudos
Message 10 of 16
(2,937 Views)