LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run a for loop for an array value

Hello
 
I got an array of value(for ex 1,4,6,10),depending on the array value i need to run the porgram in the case structure(as the examaple values given earlier case1,4,6,10)the program needs to run once for all the values in the array(i mean the program needs to run 1st for case1,then case4 and so on)
Any suggestions pls.
 
 
 
0 Kudos
Message 1 of 5
(3,012 Views)

Hi Veeru,

insert a for loop in your vi and a case structure inside the for loop. Place your array outside the loop and connect it directly with the case structure. Autoindexing is default so you shouldn´t have an error. Create your cases for 1, 4, 6 and 10 and insert your functionality in it. Now it should work like you need it.

Mike

Message 2 of 5
(3,010 Views)
Thanks Mike,
 
0 Kudos
Message 3 of 5
(2,984 Views)

Can you describe exactly what you want to do?  In most cases, you do not need a loop to deal with arrays.  Many functions are polymorphic and will deal with arrays directly. 

R

Message 4 of 5
(2,979 Views)

Thanks Joe

As said earlier,i got an array of values(say 5 values), these values are conncected to the case structure.As per the sequence of values from the array, the case structure nees to excecute(all needs to execute onc.,i.e as i said if it is 5 values in array then 5 cases in case structure needs to execute once)

Thanks

 

0 Kudos
Message 5 of 5
(2,958 Views)