Hellow,i have a question,how to append a series of data into an array? for example,my program produce number 1,2,3,4... one by one,then how to show it in an 1-D array?Thanks!
See if this answers your question. If Im not mistaking you just want to insert your data to a 1D array. I created a simple methods with indexing and one with the shift register and build array function. Hope this helps. -Dave
You can get more info in the on-line help and shipping examples but briefly, auto-indexing is a feature of for and while loops. If you wire an array to a for loop, each element of the array enters the for loop one a time. You do not need to use the index array fucntion to access individual elements. A scalar element exiting a for loop is automatically built into an array. This is the default behavior of for loops and the optional behavior of while loops. A quick way to create an example is to drop a for loop on a block diagram. Wire some constant to the iteration terminal (i.e. 5). Put the random number generator function inside the for loop. Wire the output of that to the edge of the for loop. Right click on the output tunnel and select C reate Indicator. You'll see that it creates an array. If you then run the VI, the array will be populated. Auto-indexing is very effecient because the array size is allocated according to the number wired to the iteration terminal or to the size of the input array. Using a shift register and build array is less effecient becasue there's no way for LabVIEW to know the final size of the output array so additional array allocation has to be done periodically.