LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a FIFO array?

Hi All,

 

Basic question, how do you create a FIFO array in Labview?  I want to read an analog input into a FIFO buffer of fixed size so I can do some statistical analysis on it.

 

Thanks for any help,

Sean

0 Kudos
Message 1 of 14
(23,398 Views)

Typically you would use a shift register initialized with an array of fixed size, then use replace array subset to add in new data, or use index array or array subset to read out data while keeping track if the insert point in another shift register.

 

Have a look at action engines for some ideas.

Message 2 of 14
(23,393 Views)

A queue might be a good approach, for instance if you're going to implement a producer/consumer architecture.

 

 

Message 3 of 14
(23,389 Views)
Thanks guys got it working.
0 Kudos
Message 4 of 14
(23,358 Views)

How did you implement your design? Did you do a "replace array subset to add in new data, or use index array or array subset to read out data while keeping track if the insert point in another shift register" wouldn't that be a memory hog?  There sould be a more efficent way, maybe with the use a variants?

0 Kudos
Message 5 of 14
(22,150 Views)

@Fro2 wrote:

Did you do a "replace array subset to add in new data, or use index array or array subset to read out data while keeping track if the insert point in another shift register" wouldn't that be a memory hog?  There sould be a more efficent way, maybe with the use a variants?


You are speculating randomly.

 

Keeping a fixed size array in a shift register is one of the most memory efficient code structures you can do in LabVIEW. The insert point is a single scalar and irrelevant for memory considerations.

 

I have no idea what you have in mind with "variants". Are you talking about variant attribute methods (such as discussed here)?

 

0 Kudos
Message 6 of 14
(22,141 Views)

Yes I was referring to variant attribute. The link you provided “Associative Arrays!” has given me insight in the past. Darin.K informed me of it.  I knew if I mentioned variants then Darin.K would also see the post.  He has helped me in the past working with array manipulation and when his method of using variants for array manipulation was bench tested against other methods suggested.  The variant method was the most efficient in terms of use of memory and speed.  Darin.K has provided me links so that I can learn more about variants.  I started to send a post directly to you because you have helped me in the past too, and your wrote the article "Associative Arrays!" however; you have written in your “About Me” section of your profile not to send you a message directly, instead post it to the forum.  So I did not send Darin.K the message directly either.  This way others could help out too.  In 2009 when “Sean m”  wrote in a post that he got is working he did not say how he did it nor give Kudos thus I replied to the post.  I will never start a new post again if there is one already similar.

0 Kudos
Message 7 of 14
(22,128 Views)

@Fro2 wrote:

 I will never start a new post again if there is one already similar.


In most cases (especially If the exiting thread is old or already marked as answered), I recommend to start a new thread anyway. This way you own the tread and can mark the solution if one is provided. If there is an older thread with a similar discussion, you can include a link to it.

 

(While I probably won't answer PM questions for help, you can send me a message pointing me to your public discussion if nobody else seems interested. Sometimes I overlook things. Then I can decide if I want to answer in the public thread or not. ;))

0 Kudos
Message 8 of 14
(22,106 Views)

Do have any example can show it because i still don't get how to create a FIFO array?

0 Kudos
Message 9 of 14
(20,295 Views)

Hi Oldies,

 

You can search for examples or "array FIFOs" on ni.com and will come up with several examples. Here are two:

 

Average Values in a FIFO Buffer Using Array Functions

https://decibel.ni.com/content/docs/DOC-10781

 

FiFo array

http://zone.ni.com/devzone/cda/epd/p/id/3103

Joey S.
Senior Product Manager, Software
National Instruments
0 Kudos
Message 10 of 14
(20,250 Views)