LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run VI with GUI, don't wait for it

Solved!
Go to solution

Hi. I'm using Labview 9.03f. I have an event loop that handles user interaction. When the user selects a menu item, I want to run a VI which has its own user interface, but I don't want to wait for it to finish executing (as it will hold up all the rest of the user interaction). Basically, I want the new VI to float around on top, but  the user to still be able to interact with the main GUI.

 

I'm looking at using a VI reference with the RunVI method, and parameter Wait Until Done set to false. Is this the right way to go about it?

 

Thanks!

0 Kudos
Message 1 of 8
(4,726 Views)

Yes

 

- tbob

Inventor of the WORM Global
Message 2 of 8
(4,724 Views)

Great, thank you!

 

I have one more question. Is it possible to pass parameters to the VI that I'm running programmatically?

0 Kudos
Message 3 of 8
(4,720 Views)

Yes

 

(I was going to leave another simple one word answer, but I had enough fun)

You can pass any parameters as long as the subvi being called dyamically has terminals defined on the terminal pane.  Here are the steps:

 

On block diagram, place a Static VI Reference, found in Applications Control palette.  Right click and select Browse for VI Path.  Select the vi you want to call dynamically.  Then right click again on the Static VI Reference and select Strictly Typed VI Reference.  The icon should then have a star in it.

 

Place a Call By Reference Node onto the block diagram, found in Applications Control palette.  Wire the Strictly Typed Static VI Reference output to the reference input of the Call By Reference Node.  You will see the terminal pane show  in the node.  Wire any inputs and outputs to the pane.

 

Here is an example of what it would look like:

 

ReferenceCall_BD.png

 

 

Forgot to mention.  If you use this method, you don't usethe previous call method you mentioned.  This calls it automatically and it will not wait for the VI to finish.  The vi runs concurrently with your main vi (I think?).

 

Message Edited by tbob on 04-19-2010 10:45 AM
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 8
(4,701 Views)
Solution
Accepted by zola_the_gorgon

psssttt...

 

Call by ref will wait for the calng vi to return.

 

You can use the invoke node ctrl val.set method to pass data before it starts.

 

Dynamic_Instance5.PNG 

 

Ben

 

PS I contrived that screen shot to feature the grand daughter but I never thought Y'all would be helping so much with giving me license.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 8
(4,695 Views)

Ben wrote:

psssttt...

 

Call by ref will wait for the calng vi to return.

 

You can use the invoke node ctrl val.set method to pass data before it starts.

 


 

ooops.  Didn't know that.  Bad advice.  Do as Ben says.  Even an old dog like me learns new things every day.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 8
(4,693 Views)
Aha! I was looking at setting the control panel, and banging my head on the desk. Thanks guys, you're the best!
0 Kudos
Message 7 of 8
(4,690 Views)
Er - I meant connector pane, not control panel. Anyway, it was a bad idea. Long, pointless day and my head now sore from abrupt contact with fake wood.
0 Kudos
Message 8 of 8
(4,685 Views)