LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indicators inside for loop does not display value in Main VI

Solved!
Go to solution

I have few indicators one is array and another one is displaying image inside FOR loop in the sub vi (see attached files). If I run sub vi individually it works fine but when I call those indicators in my main vi it does not show any thing and those indicators appear to be empty or blank, although at the same time the sub vi shows those indicator values perfectly. 

 

Can any body guide me why I cannot see those indicators properly in main vi although I can see them in the sub vi properly.

Message 1 of 14
(4,060 Views)

Take the tutorials on LabVIEW and think dataflow.

If you want information from inside your subVI for loop to be available to your main VI, you'll have to pass it in a manner where the main VI isn't waiting for the for loop to finish.

 

You can do this with control references. You could also pass the data out of the subVI using a notifier or a queue.

 

Depending on what you actually want to do, you may want to pick a different architecture for handling your image.

0 Kudos
Message 2 of 14
(4,046 Views)

Can you provide me any document or guide link which explains how to use Control Reference with For loop. I found Control Reference guide but it only explains with While loop. Also I did not find any document which explain how to use queue and notifier with for loop. 

0 Kudos
Message 3 of 14
(4,011 Views)

The guide you link to will work the same in a for loop as it does in a while loop.

 

For an example of passing data from loops using queues, take a look at the Producer Consumer White Paper.

0 Kudos
Message 4 of 14
(3,999 Views)

What do you expect to be different about a For Loop vs. a While Loop?

 

They are both loops with somewhat different methods for determining how many times to iterate.

0 Kudos
Message 5 of 14
(3,997 Views)

I tried both while and for loop but using control references technique does not work for any of them. Can you please exactly guide me what should I exactly do to make it work?

 

Many thanks for your support.

Message 6 of 14
(3,988 Views)

Post the VI's where you've tried this.

 

It is much easier to work with something you've already started and then figure out where things went wrong.

0 Kudos
Message 7 of 14
(3,980 Views)

Control reference files attached

0 Kudos
Message 8 of 14
(3,976 Views)
Solution
Accepted by topic author josephkirmani

The control references you want to pass to your VI are the Image and Output Array References if you want those to update.

Then, in your subVI, write to the property nodes of those references if you want to see the updates on your Main VI.

 

EDIT: While this method may get you around your immediate problem, I don't think this is something you really want to do often. There is probably a better way to architect this to achieve your real desired result.

Message 9 of 14
(3,969 Views)

I did not get your point clearly. Can you explain in detail or if possible attach screen shot so that I can understand easily.

 

Many thanks.

 

 

0 Kudos
Message 10 of 14
(3,964 Views)