LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using loop to fill array

Solved!
Go to solution
I'm having trouble with array's. I want to fill a loop based on a variable input (x). If the input is less than 5, I want to fill the array with 1-x. If the array is greater than 5, I want to fill the array with 1-5 and then start over with 1. This needs to continue on in multiples of 5. I have been able to do this with several loops and many comparisons up to 20 elements. The problem is that the input may be greater than 20. There has to be an easy way to do this, but I can't figure it out. I have attached a vi without the comparisons (the numbers still have to be entered manually). It should give you an idea of what I need. Can someone help?

thanks
Kevin
Message 1 of 3
(13,043 Views)
Solution
Accepted by topic author kphite
Hi Kevin,
if I understood what you need, this example should do it.

Let me know,

Alberto
Message 2 of 3
(13,043 Views)
Thanks it works great.
0 Kudos
Message 3 of 3
(13,043 Views)