LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

executing listbox items according to loop

I am making a vi in which we need to execute listbox items according to loop values defined at the begining( shown in the image attached below) , it's like that we start a loop with some values in it e.g loop(2,4,5) and loop ends with END string and all the items between loop and END we need to execute number of times the values we have defined within loop , e.g in this case since only three values are there within loop 2,4,5 so any items present between loop and END we need to execute 3 times, it could be nested loop also, we tried so many solutions but not getting how to do this, some guidance would be great help.

 

function of the values defined within loop bracket is that we are having instryment list defined within loop and End and we having kept one constant x with every instrument , this x ( and the values defined within loop) are different voltages, x would be replaced every time by the newq loop value until all values are not executed.

 

below i am attaching the sequence list image. 

0 Kudos
Message 1 of 7
(2,598 Views)

For Loop.

 

Auto-indexing tunnel on an array that contains all the values you want to work with.

0 Kudos
Message 2 of 7
(2,563 Views)

i am doing auto indexing but it not working correctly, below attached is the image of what i am doing.

0 Kudos
Message 3 of 7
(2,554 Views)

No.

 

Put the 2, 4, 6, 8, 10, ... in an array and autoindex that into the for loop and act on those numbers. 

 

0 Kudos
Message 4 of 7
(2,550 Views)

@Ritu wrote:

i am doing auto indexing but it not working correctly, below attached is the image of what i am doing.



 

Like this.  (However you'll need more algorithm for this to work in nested loops - you'll have to keep a track of outside loop iterations while you execute inside loops.)

 

-DP

 

Untitled.png

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 5 of 7
(2,519 Views)

Sorry for the late reply,

 

Thankyou RavensFan and BTC_Admin 

 

BTC_Admin

 

I tried the code as you mentioned but it is not working correctly even for single, i am not getting why you are using 2 for loops in the Loop case structure, the second fro loop is runnig twice the number of values i am keeping in loop bracket.

0 Kudos
Message 6 of 7
(2,470 Views)

it is working fine, i was doing some mistake, but i am not getting any idea how to do it for nested loops.

0 Kudos
Message 7 of 7
(2,463 Views)