LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with an array...

Solved!
Go to solution

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. 

0 Kudos
Message 1 of 9
(660 Views)

Are you creating a circular buffer or moving window of 16 elements in length/size?

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 9
(653 Views)

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. 

0 Kudos
Message 3 of 9
(635 Views)

Each time you receive a new value rotate the array one place and replace element 0 with the new value.

========================
=== Engineer Ambiguously ===
========================
Message 4 of 9
(630 Views)
Solution
Accepted by Havordpete

@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

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 5 of 9
(619 Views)

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. 

0 Kudos
Message 6 of 9
(604 Views)

Looks like "reshape array". If input and output are both 1D strays, the input gets trimmed or padded with zeroes to the new size 

Message 7 of 9
(585 Views)

@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.

Message 8 of 9
(567 Views)

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!! 

0 Kudos
Message 9 of 9
(510 Views)