From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Appending to an array of clusters

Sorry if this is a dumb question, but i am a novice at programming and have been using labview for about a week.  I am trying to take data from two instruments, combine the two values together into a cluster, then append this new element to an array. I am unsure how many elements there will be total since the number of data points taken is variable, so the array must be dynamic, and i would like to just keep appending the new elements to the end of the array.  Any help in how to do this would be extremely appreciated. 

 

0 Kudos
Message 1 of 3
(2,508 Views)

Arrays in LabVIEW are automatically dynamic.  Use the Build array primitive to append the new cluster to the array.  The Build Array will adapt to handle the original array on one input ant the new element on the other input. 

 

Lynn 

Message 2 of 3
(2,507 Views)
Thanks, that was what i tried.  I just realized that when i was appending the new elements, i was not putting the output array into a shift register so the size of the array was staying fixed and the same element kept getting overwritten each time the while loop iterated.  I just added a shift register and its working the way i intended now.
0 Kudos
Message 3 of 3
(2,502 Views)