LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass data between the main VI and VI within a sub-VI?

I have a main VI which has sub-VIs. I am simply trying to pass a boolean value, programmatically, from the sub-VI of the sub-VI to the main VI. I have passed data using references from a sub-VI to a main VI all the time. I am now trying to go one level lower. I have been all over the boards trying to find an answer but I cannot. Or maybe I am just not understanding some answers. Any help would be appreciated.
 
Thanks,
Troy
0 Kudos
Message 1 of 13
(3,667 Views)

You can pass the value back over the vi's terminals back to the vi's caller, from where you pass it also back over the terminal.

You could also use the reference, but this is usually just necessary, if there is an action to take place in the main vi while the sub vi is executing. If possible, avoid it and try to use the dataflow.

This are just two possible ways, but there are much more. Every way with its advantages and disadvantages.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 13
(3,666 Views)

Becktho,

Do you mean to say that:

If I have a sub-vi executing a while loop, with the iteration passed to a numeric indicator on the FP of the sub-vi, I can show the iteration count on my main-vi by simply passing the sub-vi's numeric indicator's reference to another numeric indicator on the front panel of my main-vi? And this will happen even while my sub-vi's While Loop is still executing?

Thanks,

Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 3 of 13
(3,662 Views)
No. You can pass a reference of you counter on the main vi's frontpanel to the sub vi and set there its value.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 13
(3,654 Views)

Becktho, Thanks!.

Sorry if my small aside interrupted the real thread.

Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 5 of 13
(3,647 Views)
No problem if you have learned something 😉
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 13
(3,644 Views)