Unexpected and Default Data in Loops

For Loops produce unexpected values when the iteration count is zero for an auto-indexed For Loop. While Loops produce default data when the shift register is not initialized.

For Loops

For Loops produce unexpected values if you wire 0 to the count terminal of the For Loop or if you wire an empty array to the For Loop as an input with auto-indexing enabled. The loop does not execute, and any output tunnel with auto-indexing disabled contains unexpected values. Use shift registers to transfer values through a loop regardless of whether the loop executes.

While Loops

If you do not initialize a shift register on a While Loop, the output is the default value for the parameter (0, FALSE, empty string, and so on) or the last value loaded into the shift register when you last ran the VI.