LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

running 2 vis in parallel and returning parameters to the caller

I have an application where I want to run a main VI and allow the user to open subVIs to peform supporting tasks.  I want the subVI to return parameters to the caller.  I have found an example on NIs website for running VIs in parallel.  The problem with this example is the subVI doesn't return any values to the caller.  I can't figure out how to do this.
Thanks.
0 Kudos
Message 1 of 16
(3,986 Views)

My question is similar:

http://forums.ni.com/ni/board/message?board.id=170&message.id=225964

I still haven't solved. My example (incomplete) calls to vi template and makes an action.  With call by reference node you would can get the value.

 

Vicen

WinXP / LV7.1

0 Kudos
Message 2 of 16
(3,972 Views)

If you need to wait for the subVIs results before you can continue, simply connect the results to indicators on the front panel and use the connector pane to transfer these results back to the caller.

If you need to communicate while the VI is running, you can use any number of global communication mechanisms, from globals to queues to USR globals.
Searching the example finder for "global" should probably return some results.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 3 of 16
(3,971 Views)
Jim,

there are several ways to do this.

It depends on the way you're going design your application.

Are both vis in one application?
Then it's the easiest way to use a global variable.

Are you using two applications, then you should use Queues.
If you give the queue the same name in each apllication, you can interact via this queue.

Regards,

Balze
0 Kudos
Message 4 of 16
(3,969 Views)

Attached is the code.

The calling VI is UI_3.  This VI contains 2 buttons, each of which calls a different VI called EEC2 & EEC3 respectively.  When one of the buttons is pressed on the caller, the child VI opens, is interactive and returns the data like I want it to.  The problem is that the button on the caller never turns off so when the child VI closes, it is immediately reopened again.

 

 

0 Kudos
Message 5 of 16
(3,966 Views)
Have you set the mode of the button you are using to LATCH ?
0 Kudos
Message 6 of 16
(3,961 Views)

It is set to latch currently.  I tried to attach 3 files to my post but it only included one. 

I'm going to try and attach them again.  I'm new to LabView as well as using discussion forums.  Bear with me.  Thanks for the help!!

 

 

Download All
0 Kudos
Message 7 of 16
(3,954 Views)
like this?
0 Kudos
Message 8 of 16
(3,941 Views)

There is way too much unnecessary code there. You don't need to call those sub vis by reference like that, just drop the sub vi right into your diagram. Also, the mechanism you're using to poll the button press is excessive. Take a look at the links tst posted (he goes through a lot of trouble typing those up all the time Smiley Wink ). An event structure would be of great help to you.

I see you're on 7.1, which I can't save for, but maybe someone can whip you up an example.

Message Edited by Marc A on 01-25-2007 09:23 AM

Message 9 of 16
(3,939 Views)
or like that?

🙂

Regards,

Balze

P.S.: You should check the howtos and examples 🙂
Download All
0 Kudos
Message 10 of 16
(3,936 Views)