ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create data buffer with arrays

Hello.. I'm trying to create a data buffer but I can't...(I don't understand very well how to use the shift registers, feedback, auto-index, etc.) I receive real-data from 16 sources and I want the buffer to allocate 20 samples or so... (20 x 16 matrix or array). I'm trying to simulate the sources and using replace array subset, but I can't do what I want.. (that a single data fill the space in index 0, and when a value reaches index 19, the next number replace the one in index 0 and so on....)

 

I want to create a buffer for when some disturbance ocurrs, I want to save the data from 1 or 2 seconds before the event. I think that I can use too a history data property node, but I'm not using a waveform chart anymore, because I want also the time stamp of the data in the xscale.. and with the chart I didn't manage to do it... (I tried with an offset property node.. but eventually the time in the xscale lagged the real time, I think that happens because the rate sample is not constant... but that's another problem.. =S)

 

Thanks in advance for all your help...   Mitzi

 

PS. I attach my attempt...

0 Kudos
Message 1 of 7
(9,531 Views)

Hi mia,

 

use a quotient&remainder function to limit the index values...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(9,522 Views)

If you want a build a 20x16 array with only the 20 most recent values, what you can do is use the build array function to concatenate on the end of the data (you will need a shift register for this). 

 

Next take the output of the build array and get the last 20 columns using the array subset function.

 

(There's a real clever way to do this involving reversing the arrays, but I'm not going to confuse you with that).

 

If you're still not getting it when I get home, I'll write up a VI and post it.  What version are you using?

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 7
(9,505 Views)

Hi... thanks for the answers... I´m using LabVIEW 8.2... Ohh... I will be so glad if you could write me an example.. I still can´t do it... =S

 

                                Have a nice day..       

                                                                         Mitzi

0 Kudos
Message 4 of 7
(9,482 Views)

You could also use a 'Lossy Queue'.

Set the size of the queue to only be 20 elements long.

It will then act as a FIFO array, with a constant length of 20 elements.

Cory K
0 Kudos
Message 5 of 7
(9,470 Views)

Ohh... That would be great.. ! But I searched in my LabVIEW version and it's not there!! I'll try to find it in internet.... but thanks!! That would work!

 

                 Mitzi

0 Kudos
Message 6 of 7
(9,454 Views)

mia.lara wrote:

Ohh... That would be great.. ! But I searched in my LabVIEW version and it's not there!! I'll try to find it in internet.... but thanks!! That would work!

 

                 Mitzi


Ahh, I forgot to check what version you were using, yes I believe that is a newer function (8.6 ?)

Message Edited by Cory K on 03-28-2009 11:58 PM
Cory K
0 Kudos
Message 7 of 7
(9,441 Views)