From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FIFO analogue

Hi, I am wondering if there is an "analogue" of FIFO in Host VI? I will try to explain, what I mean. I am reading a fast channel of 1kHz output and try to visualize data from it in a graph. I am familiar with FIFO idea for FPGAs, but I was wondering, maybe there is smth simular in real-time or Host side VI? At the moment my idea was to build an array by using timed loop and shift register. The problem with it is that I will have to store the values in the array that increases its size constantly. But what I would like to have is the array of constant size that simply substitute old elements with new one. Or, maybe it is not the array but some other structure. Thanks in advance. 

0 Kudos
Message 1 of 2
(2,314 Views)

Look into Lossy Queues.

 

When you obtain the queue, you can set a maximum size.

When you add a new element to the queue, use  Lossy Enqueue Element.  If the Queue is full (as defined by the size you set), then it will bump out the oldest.

 

If you want to remove an item from the queue, use your regular Dequeue Element.

If you want to see the next item in the queue without removing it, use Preview Queue Element

If you want to see all the elements in the queue without removing any, the use Get Queue Status and set the input to Return Elements? to true.

Flush Queue lets you wipe it clean.

 

Advantages of queues, especially for large data structures is that only references to each element are stored in order.  The elements themselves do not have to be stored in contiguous memory like they are in an array.

Message 2 of 2
(2,281 Views)