MORECHEMISTRY.COM::MORE CHEMISTRY ON THE WEB |
LabVIEW programming topics - arrays and loops
[LabVIEW vi collection]
[LabVIEW links]
[LabVIEW bookstore]
[programming topics] [drivers] [device simulators] [utilities] [projects] [events] [related topics] Using arrays (3)This vi demonstrates how arrays can be manipulated with For Loops. If a 1-dimensional array is connected to a 'for loop' then auto-indexing is on by default. The 'for loop' will treat the elements of the array one at the time. If you want to do some calculation on all the individual elements of the array it is okay to leave the N (number of iterations) unwired. Here are some cases of supplying an 8 element array as input to a 'for loop'. case 1 - Auto-indexing is on, the scalar NumericValue 1 will be updated 4 times if Loopsize is 4 or 8 times if Loopsize is 12. The intermediate values will be visible.
case 2 - Auto-indexing is on, the scalar NumericValue 2 will be updated 4 times if Loopsize is 4 or 8 times if Loopsize is 12. The intermediate values will not be visible.
case 3 - Auto-indexing is on, the 1-dimensional array Array 1 will contain 4 elements if Loopsize is 4 or 8 elements if Loopsize is 12. The intermediate values will not be visible.
case 4 - Auto-indexing is off, the 1-dimensional array Array 2 will be recalculated, in its entirety, 4 times if Loopsize is 4 or 8 times if Loopsize is 12. The intermediate values will be visible.
case 5 - Auto-indexing is off, the 1-dimensional array Array 3 will be recalculated, in its entirety, 4 times if Loopsize is 4 or 8 times if Loopsize is 12. The intermediate values will not be visible.
case 6 - Auto-indexing is off, the 2-dimensional array Array 4 will be recalculated, in its entirety, 4 times if Loopsize is 4 or 8 times if Loopsize is 12. The intermediate values will not be visible.
Downloadsarray-loops.vi See also...Bart Boshuizen, 2005/03/08
|
|