LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dealing with buffers in Labview

Hi,

 

 I have a program where I need it in such a way that every time the buffer is full the time values in the buffer are written to an array. The array should be a 2D array with each column being the times in the buffer when it became full. The program that needs to modified is the buffer.vi. The recent History BUffer 1 contains a functional global variable buffer. Thanks.

Download All
0 Kudos
Message 1 of 6
(3,287 Views)

The AE looks good, but i'd recommend setting Read as default command so you dont accidentally empty it.

It sounds to me like you could use a Build array each time the buffer is filled, and afterwards transpose the whole array. That should result in each fill of the buffer being 1 column.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 6
(3,261 Views)

Thanks for the response. I am not sure how to do the read as default command. I tried building the array but I am getting an error that says I am connecting two different lines, source is 32 bit integer while the array is a 2d void array error. Can you please change the Buffer vi and show me how it's done? Thanks.

0 Kudos
Message 3 of 6
(3,236 Views)

Hi,

 

Could you tell me what excatly you are trying to place in the array?  If there are two different data types, you will either need to convert one or instead build a cluster.  An array can only contain one type of data, whereas a cluster is more flexible.  You could also build to separate arrays and then combine them into a cluster.  Hope this helps!

 

Jon S

Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,185 Views)

There's really no need for the 2 loops, you can easily do it in 1, but here goes:

- Remove the Buffer full and Stop Local variables from the 1st loop.

- Create a Shift register in the 2nd loop which run through the Case.

- In the True case, grab the Array from the Buffer.vi, build array with the shift register and then initialize the AE.

- In the False case you just wire through.

- After the 2nd loop, you connect a Transpose Array to the shift register and create an indicator.

- Try and post the result.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(3,173 Views)

Hi,

 

How does this look?  Everytime the buffer is full, it writes to an array that stores the data in the buffer.  It uses only one while loop.  Hope this sends you in the right direction!

 

Jon S

Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,154 Views)