LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RTFIFOCreate error

I would use the RT FIFO with a size of one element (I would be sure that I read always the last one even I lost 'packets') but in this case I have an error on the RTFIFOCreate. I need to put at least 2 for the size.

Perhaps it is linked with the capability of RTFIFO which can be read and writen in the same time. But I would know if, in this case, I am sure to read the last 'packet'.
0 Kudos
Message 1 of 2
(2,508 Views)
I would guess, as I am not the developer of the VIs or underlying DLL, that the DLL code is doing something as simple as saying, if the READ location pointer is equal to the WRITE location pointer, the FIFO is empty. If this is the case, then a FIFO of size = 1 would always return saying it was empty, as the READ / WRITE pointer are always both pointing to the same one element.

To answer your question, a read to a FIFO of size = 2 would always return the first value written, not the last value written (First In, First Out). If you do not need a buffer and are only concerned with the last value written, I would highly recommend replacing your use of RTFIFOs with global variables, or for better performance, "functional global variables". For more information on fun
ctional global variables, see the link below.

NI Developer Zone: Improving Determinism with Functional Globals, LabVIEW 2-Style Globals, in LabVIE...
0 Kudos
Message 2 of 2
(2,508 Views)