02-06-2016 06:52 PM
Dear all,
I have a main VI which calls another VI which consist of a while loop and a indicator which show the number of iteration. How do I display the iteration as it increments on my main vi, as I am seeing that it only display the number which the while loop ends. Attached is my VIs, someone please guide me. Thanks a lot.
Solved! Go to Solution.
02-06-2016 07:01 PM - edited 02-06-2016 07:18 PM
There are plenty of solutions and it really depends how th rest of the code looks like.
For example you could give a reference to an indicator on the main VI to the subVI and the update it from within the subVI via a value poperty node.
02-06-2016 07:01 PM
You could use Queues, User Events, Notifers, or Global Variables to pass the data up to your main VI. This will require that your subVI runs in parallel to everything else in your main VI. I am partial to the User Events route. Another option is to use a subpanel that you can load your subVI's front panel into to show the indicator.
02-06-2016 07:05 PM
02-06-2016 07:07 PM
Now that I have had a quick look at your code...
That subVI should use a FOR loop since you know how many times it will run. And with that knowledge, you could use a progress bar on the subVI and have the subVI pop up when it start running. If you set the progress bar's maximum to be the number of iterations you will have of your loop, it will be a since graphic of the progress of your test.
02-06-2016 07:23 PM
@altenbach wrote:There are plenty of solutions and it really depends how th rest of the code looks like.
As I said, we really need more information about the full code design.
What else is there? (currently, th code is so sparse that the subVI is not even really needed). Must the main VI code wait until the subVI returns or does it need to do other things in the meantime? What else does the subVI do? What is the purpose of it all?
02-06-2016 09:50 PM
thanks for helping. this is good enough for me