From the course: Learning LabVIEW

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Build an array with a for loop

Build an array with a for loop - LabVIEW Tutorial

From the course: Learning LabVIEW

Start my 1-month free trial

Build an array with a for loop

- For loops make it incredibly easy to build and initialize our rays. Right now the code inside this for loop generates and displays a random number. It will repeat that operation 10 times but at the end of the program, after the loop has finished running I'll only be able to see the last value that was generated. Let's say I want to save and use all the values that it generates by storing them into an array. To do that with a for loop, I can simply wire the output from the random function over to the right side of the for loop. That creates a tiny orange terminal with a pair of brackets in it. Those brackets indicate that this is an auto indexing terminal which means it takes the value that's pastuit each iteration and appends it to the end of an array. If I right click on the terminal and create an indicator, LabVIEW creates an array of numeric indicators rather than a single numeric indicator because the…

Contents