Creating a For Loop with Alternative Starting Index and Increment Value

Updated Aug 25, 2023

Reported In

Software

  • LabVIEW Base
  • LabVIEW Full

Issue Details

The index of a For Loop or While Loop in LabVIEW always starts with zero and increments by one. Is there a way to start with a different number and increment that index by a number other than one?

Solution

You can get around this problem programmatically by adding your start index to the Loop index and multiplying your increment by the Loop increment of one. 

The following diagram illustrates one method for doing this. The start value represents the first value in the sequence and the Stop value represents the last value. The increment represents the jump between values. For example, if you had a start value of 3, a stop value of 11 and an increment of 2, your Output array would be [3,5,7,9,11].