08-27-2024 03:28 PM
I want to move the first element of a 16-element array to where the second element was, the second to where the third was, and so on, in an incoming infinite data set in LabVIEW. How would I do this? The data is basically a sampled waveform for more context.
Solved! Go to Solution.
08-27-2024 03:51 PM
Are you creating a circular buffer or moving window of 16 elements in length/size?
08-27-2024 04:25 PM
Definitely moving window of length. thats exactly what I am trying to do. An infinite set of data in array and first element becomes second element, and 16th element becomes 17th element and so on. So almost like a "moving window" if If you can help on how to achieve this or link some sort of VI that would be amazing.
08-27-2024 04:31 PM - edited 08-27-2024 04:31 PM
Each time you receive a new value rotate the array one place and replace element 0 with the new value.
08-27-2024 04:53 PM
@Havordpete wrote:
Definitely moving window of length. thats exactly what I am trying to do. An infinite set of data in array and first element becomes second element, and 16th element becomes 17th element and so on. So almost like a "moving window" if If you can help on how to achieve this or link some sort of VI that would be amazing.
Check this out - https://forums.ni.com/t5/Community-Documents/Dynamic-Circular-Buffer/ta-p/4297791
08-27-2024 05:21 PM
thank you so much for that link, I'm trying to build one of the responses from EMCCI since they didn't add VI to the project but Im having a hard time identifying one of the blocks, I put a image of it below if you could help me out.
08-27-2024 06:50 PM
Looks like "reshape array". If input and output are both 1D strays, the input gets trimmed or padded with zeroes to the new size
08-27-2024 11:30 PM
@Havordpete wrote:
I want to move the first element of a 16-element array to where the second element was, the second to where the third was, and so on, in an incoming infinite data set in LabVIEW. How would I do this? The data is basically a sampled waveform for more context.
OK, lets clarify a few things. if it is a sampled waveform, it is tagged with a t0 and dt. Do you need to update t0 (Most likely, dt is constant)?
Typically, instead of explaining how (move-move-move) you want do do something, explain what you need to do in a more general way. There are quite a few ptbypt VIs that could do some of the lifting. There is even a data queue ptbypt VI that might be useful.
So please explain the purpose of that history buffer, e.g. process it in some way (Mean, FFT, etc.) or just for cosmetics (display in a graph). The more detail you provide, the more useful our answers will be.
08-28-2024 01:41 AM
I actually found the solution! Turns out I just needed to implement a “circular shift” but I didn’t know the exact terminology on how to describe it but one of the posters on this page helped out, thank you for your help as well!!