ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data transfering from sub-vi to main-vi

Hi everybody,
I have a simple example, where I would like to transfer the data immediately from the sub-vi to the main vi, during the system is running (and not after the sub-vi has finished its execution). In this example, I would like to transfer only the loop index i of the for-loop. In my application there is a lot of more stuff in the two VIs, so I need this sub-vi and cannot put the stuff out of the sub vi into the main vi. I tried the data transfer with a global variable, but then I get only the last number of the loop into the main vi. Or I did something wrong. Has anybody an (easy) idea, how to solve this problem? BTW: I am using LV 6.0.
Thanx for your help,
Oliver.
Download All
0 Kudos
Message 1 of 6
(4,138 Views)
Hi Oliver,
in your example the numeric data is passed from sub-vi to main only when sub-vi terminates, this is what it's supposed to be when you fetch the data from the connector output of a sub-vi.
You can use queues function to exchange data between sub-vi and main.vi; take a look at the example Message Logging with Named Queue.vi.
An alternative method is passing to sub-vi a reference of an indicator (or control) and update its value on the fly.
See example.
Alberto
Message 2 of 6
(4,138 Views)
Thank you very much, Alberto. Now it is working.
Thanx, Oliver.
0 Kudos
Message 3 of 6
(4,138 Views)

Good example

0 Kudos
Message 4 of 6
(3,179 Views)

@Croby1980 wrote:

Good example



Not bad for your first post!  A reply to a 13.5 year old thread?  No kudos! 

NICE bump!

 

*.llb's are no longer relevant as good examples.  Smiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(3,166 Views)

Wow!  Are you really using LabVIEW 6 (which is what the two attachment report, and which may explain why my browser crashed when I tried to click-download them)?

 

Bob Schor

0 Kudos
Message 6 of 6
(3,164 Views)