LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

do loop with increment equivalent

Hello all,

 

Can anyone help me in describing or posting an example of the equivalent of a do loop with increment?

 

do  i = 1, 110, 11

....

enddo 

 

I searched the past posts without clearly seeing an example.

 

Thanks

Pecan204

0 Kudos
Message 1 of 6
(3,100 Views)

If you mean you want a loop that will execute three times, with the values 1, 110, and 11, create a constant array containing those values, and connect it to a for loop.  LabVIEW will auto-index through the array, executing the loop once for each value the array contains.

Message Edited by nathand on 02-25-2009 05:07 PM
0 Kudos
Message 2 of 6
(3,093 Views)

I was trying to insert values 1,11,22,33,44, etc to 121 duplicating the fortran do loop wuth optional increment. Any other thoughts?

 

Thanks

0 Kudos
Message 3 of 6
(3,078 Views)

Hello,

 

see this example !!

 

Phil

NTA-Automation

Philippe B.
Certified Associate Developer / Dépt Moyens d'essais

www.ingenia-system.com
0 Kudos
Message 4 of 6
(3,077 Views)

Try this.

 

You could also use the conditional stop terminal or a while loop.

Message 5 of 6
(3,068 Views)

Thanks Dennis for the example.

 

The equivalent for a do while loop in LabVIEW is the While loop. The while loop in LabVIEW executes atleast one similar to the do while in text based programming languages. 

 

Taken from the For Loop and While Loop Structures help file:

 

While Loops

Similar to a Do Loop or a Repeat-Until Loop in text-based programming languages, a While Loop, shown as follows, executes a subdiagram until a condition occurs.

The While Loop executes the subdiagram until the conditional terminal, an input terminal, receives a specific Boolean value. The default behavior and appearance of the conditional terminal is Stop if True, shown as follows.

 

 

Hope this helps!

 

Warm regards,
Karunya R
National Instruments
Applications Engineer
Message 6 of 6
(3,031 Views)