04-19-2010 12:09 PM
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!
Solved! Go to Solution.
04-19-2010 12:12 PM
04-19-2010 12:21 PM
Great, thank you!
I have one more question. Is it possible to pass parameters to the VI that I'm running programmatically?
04-19-2010 12:43 PM - edited 04-19-2010 12:45 PM
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:
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?).
04-19-2010 12:51 PM
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.
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.
04-19-2010 12:53 PM
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.
04-19-2010 01:00 PM
04-19-2010 01:03 PM