LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert into Waveform Array

Solved!
Go to solution

This is a snippet of code that I am using in a larger program, but the functionality remains the same. I'm reading two waveforms from an oscilloscope and want to insert them into my Data cluster that gets passed globally. For some reason, when I do the insert into array, no data ever makes it into that array. What concept am I missing here and what do I need to fix it? 

 

Example.png

0 Kudos
Message 1 of 4
(3,189 Views)

I think I may have stumbled across a solution. I replaced the Insert into array with a Build Array, and then right-clicked and chose the concatenate option. Is this the preferred solution? Can anybody explain to me why my original solution didn't work?

0 Kudos
Message 2 of 4
(3,182 Views)
Solution
Accepted by topic author nickb34

Build Array is the correct way about 99.9% of that time.

 

I don't think I've ever actually used insert into array.  It is intended for those situations where you want to Insert and element into the middle of an array, not when you want to Build on to the array at the beginning or end.

 

Your original mode didn't work because you wired the value of the N terminal into the index of insert into array.  That value is 3.  If the array coming into the loop is empty, then you can't insert an element at index 3 because the rest of the array before that doesn't exist.

Message 3 of 4
(3,177 Views)

That makes sense, thank you!

0 Kudos
Message 4 of 4
(3,154 Views)