LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can an output data generated within a loop in a sub-vi be transfered to the main program for each iteration of the loop ?

Solved!
Go to solution

@Zekasa wrote:
Or does it mean that I have to write to the global only once?



Do a search on "Worm" global

0 Kudos
Message 31 of 36
(1,261 Views)

Thanks Ray,

 

I was Smiley Mad when I saw ur reply I became Smiley Happy.

 

I will see the Gloabl worm, and hope to get more understanding.

 

thanks

0 Kudos
Message 32 of 36
(1,257 Views)

Zaki,

 

There's no need to get angry..  I still learn many things from this forum.  Expertise is a relative word..

Just do your thing, have fun, share & learn.

 

And it's okay to get upset every once in a while... Otherwise, we wouldn't be human, would we?  😉

 

Cheers,


RayR

0 Kudos
Message 33 of 36
(1,245 Views)

Below you will find a link to the Worm Global.

 

Queues are fine and dandy, but I'm surprised nobody mentioned using a reference.  Queues are probably quicker, but its worth looking into the reference solution.  In the two attached VIs, the main calls a subvi.  The subvi runs a loop where a variable changes on each iteration.  That change is displayed in the main as it happens by using a reference and the Value property node.  Property nodes are slower than queues, but the coding is simpler.

 

- tbob

Inventor of the WORM Global
Download All
0 Kudos
Message 34 of 36
(1,238 Views)

Hi tbob,

 

Thanks very much for your message. I will evaluate the possibility to use references. It looks easier indeed.

Thanks for the examples, that's reaaly nice to have a direct reading of an illustration of what you propose.

 

Thanks a lot.

I'll try it.

 

Cheers,

 

yoyo87

0 Kudos
Message 35 of 36
(1,228 Views)

References are fine as long as you do not need to synchronize between when data is ready (available) and it reads only new data.  If you pass only a single data, then a Notifier would also do the trick.

 

There are many choices to choose from.  It usually depends on exactly how you want the sw to behave.  Which brings another topic (that I gave up within the forum), which is "designing the software".

0 Kudos
Message 36 of 36
(1,217 Views)