02-15-2010 04:54 PM - edited 02-15-2010 04:54 PM
I have a while loop and a random numbers produced in this loop.
I desire to take a value of this loop and use it in an other loop.
It's possible? When I do it I fall in error because I can't pass number out of the cycle. I don't want to do a vector, I desire only use the number of every loops, but out of cycle. Can U show me how I can do?
02-15-2010 08:28 PM
You say vector, but do you mean array?
When you say "cycle", do you mean loop?
The best way to pass a value out of a loop to be used elsewhere is to use a queue. In LabVIEW, go to File, New.... and Producer/consumer loops (data) for an example.
02-16-2010 09:34 AM
Hello Michelle,
There are different ways to pass data according to your idea.
In this way i figure out that you should use Local Variables. Don't abuse of this technique of communicating between multiples loops. Keep in mind that this methods are very useful but could give a lot of problems if don't managed as needed.
Please refer to the following developer zone example to better undestand.
Passing Information using Local Variable for Two While Loops
Let me know if yo need additional assistance.
Kind regards
02-16-2010 10:14 AM
Here is a very quick example.
They can get much more complicated depending on what you eventually need to do.
02-17-2010 09:07 AM
Imagine to have a cycle for, in which there is a random number icon and in this cycle I can multiply this number for 10, 100. But to choose the multiplier I must save in an array 2 subsequently numbers, add this 2 numbers and after if the result is much of 1 I multiply for 100, if is minus than 1 I multiply to 100.
I must to use two subsequently numbers of for cycle so I can use the same for cycle. But I must also choose the multiplier of the third number of cycle: so the result must be given inside the cycle. There is a problem, for me, to pass every number of cycle out of thisand after pass thegood multiplier inside the cycle. How can do it? Can u do a simple Vi that do this?
Thanks.
02-17-2010 12:05 PM