LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

more vi's and using the return value

I have one program in this program their is a value indicator and a string indicator and a button.

If I press the button in this program, a new vi starts. in this new vi there is a value control box and a string control box. I can input for example "Ice cream" and "2" if I would want to insert a price for ice cream. I press the insert button in the latter vi. after doing so the values should be displayed in the first vi.

the problem is that I don't know how to return value's from one vi to another. I based my application on VI Server - Changing Another VI's Properties.vi example.

Message Edited by memmo on 03-07-2005 08:56 AM

0 Kudos
Message 1 of 6
(2,780 Views)
The easiest way to do this is to use the connector pane. In the subvi, you have outputs on the connector pane for item (string) and price (numeric). In the main vi, connect the subvi connector pane terminals to your string and numeric indicators. If you don't know about the connector pane, look up the help window for connector pane.
- tbob

Inventor of the WORM Global
Message 2 of 6
(2,767 Views)
The normal way to pass values from a subVI to a main VI is through the subVIs connector and wires to indicators in your main VI. You wouldn't normally use VI Server to start a subVI either. Attached is an example that shows the simplest way to start a subVI and get values back from it. Is there a specific reason you need to use VI Server? I suspect the only reason you're not getting anything back is that you don't have indicators wired to the subVI's connector pane.
Message 3 of 6
(2,767 Views)
I tried something with these connector pane's and this is what I get. it doesn't work what am I doing wrong?

the example you send me Dennis is made in 7.1, I have 7.0.

Message Edited by memmo on 03-08-2005 02:40 AM

Message Edited by memmo on 03-08-2005 02:41 AM

0 Kudos
Message 4 of 6
(2,756 Views)
Your subVI does not have an indicator. You pass values from a main VI to a control (input) of a subVI and the subVI passes a value via an indicator (output) to the main VI. If your just want to return whatever the user enters in the main VI, wire the value of the control to the edge of the while loop and then right click on the wire and select Create Indicator. Then on the front panel, wire the new indicator to the VI's connector panel.

I've also attached my example in 7.0.

Aslso, in the future, please don't save images as bmp files. Even zipped, they are large files. Save images as jpeg file. Windows Paint supports jpeg.
Message 5 of 6
(2,744 Views)
This works perfectly!!! Trail and error but I've got it now.

Thanks
0 Kudos
Message 6 of 6
(2,732 Views)