10-10-2009 02:01 PM
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
10-10-2009 02:23 PM
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.
10-10-2009 02:28 PM
A queue might be a good approach, for instance if you're going to implement a producer/consumer architecture.
10-10-2009 09:51 PM
03-19-2012 08:24 AM
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?
03-19-2012 09:52 AM
@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)?
03-19-2012 10:51 AM
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.
03-19-2012 02:00 PM
@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. ;))
08-15-2013 11:14 AM
Do have any example can show it because i still don't get how to create a FIFO array?
08-16-2013 02:59 PM
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