LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data from subvi's several levles down to top level vi

Hello

I have a situation which I will try to 'best' describe below:

1. In one of the Event cases in my Main vi, I have LV code which executes a test that includes setting certain H/W and reading various instruments.

2. This execution in (1) executes a vi that is down as follows Main->sub1->sub2->sub3.

3. From sub3 I would like to pass some info up to Main where I want to display that thru an indicator, to a user.

4. What would be a good way to do this, given the constraint that I prefer to avoid wiring from sub3 all the way thru to Main? I would like to feed back this info as the sub3 changes it and still in execution. Want to avoid wiring since I already have so many I/O terminals being use
d(yes, even after clustering) on the connector pane.

Is there a way to do this using refnums between the main and sub3 without having to go thru the intermediate vi's?

Is there a way to read the output of a connector terminal of sub3 directly in Main? Something I saw in an LV manual about strictly typed VI, call by reference node etc, that I saw but not fully clear on.

Thanks for any tips & ideas.

Khan Kabir
Xerox Corporation
Rochester, NY
0 Kudos
Message 1 of 15
(4,274 Views)
Use the vi server in the sub vi to get access to he controls on the top level vi. Here is an example in labview 6.1.
-Devin
I got 99 problems but 8.6 ain't one.
0 Kudos
Message 2 of 15
(4,274 Views)
I have used a completely different approach to solve this problem:

1) Create a vi that is nothing more than the indicator. Show and position this indicator as part of the main user panel. Use FP.PanelBounds and FP.Origin property nodes to control size and position. Also activate the �show front panel when loaded�, deactivate �close afterwards�, �title bar� and all other show options besides panel related from the window-appearance vi properties.
2) Call this vi from anywhere in the program to update the display data.

I typically create programs whose main panel is comprised of the front panels of 4-8 vis. In effect it�s a displayable global with code capability. I use this method to create indicators that display all my measurement instruments readings gi
ving the user one place for all current measurements regardless of the instrument taking the measurement.
0 Kudos
Message 3 of 15
(4,274 Views)
hello Mr. Kabir

think of using a FGV (Functional Global Variable) as a buffer for the references of your controls/indicators. A FGV is a vi containing an unitialized shift register in a while loop for buffering some data (see example included in this message)

regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 4 of 15
(4,274 Views)
But if you do that you still have to explicitly "call" that sub vi I and you only update when you make the call. You don't update in real time.
-Devin
I got 99 problems but 8.6 ain't one.
0 Kudos
Message 5 of 15
(4,274 Views)
Same thing, you have to explicity ask your FGV for an updated value. Still not real time.
-Devin
I got 99 problems but 8.6 ain't one.
0 Kudos
Message 6 of 15
(4,274 Views)
Actually you you could do it that way I see what you mean.
-Devin
I got 99 problems but 8.6 ain't one.
0 Kudos
Message 7 of 15
(4,274 Views)
Pass REFERENCES to the front panel controls thru sub1 --> sub2 --> sub3
In sub3, use an unattached property node - pass it the reference to a specific control, and set its VALUE property to the new value.

Unattached property nodes are on the VI SERVER palette.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 15
(4,274 Views)
Is 100 msec too slow?
I have loops that update the indicators this fast.
0 Kudos
Message 9 of 15
(4,274 Views)
Don't you have to wire through your sub-vi layers doing that?
-Devin
I got 99 problems but 8.6 ain't one.
0 Kudos
Message 10 of 15
(4,024 Views)