1 / 8

Colorado ALARM User Group 09 December 2010 Steve Solga | Electromecha LLC

Circular Buffer Architectures Performance Comparison of Conventional Circular Data Buffers versus Lossy Que Circular Data Buffers. Colorado ALARM User Group 09 December 2010 Steve Solga | Electromecha LLC. Conventional Circular Buffer. Initializing CB

geri
Download Presentation

Colorado ALARM User Group 09 December 2010 Steve Solga | Electromecha LLC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Circular Buffer ArchitecturesPerformance Comparison of Conventional Circular Data Buffers versus Lossy Que Circular Data Buffers Colorado ALARM User Group 09 December 2010 Steve Solga | Electromecha LLC

  2. Conventional Circular Buffer • Initializing CB • LV2 Style Functional Global with the data array persisting in an un-initialized shift register. • Initialize a data array of prescribed dimensions in order to allocate total memory required for circular buffer once. • Adding to CB • Use LabVIEW’s native Array Subset.vi and Replace Array Subset.vi to replace pre-initialized data subsets with the real data subsets. • Need to keep track of an array index pointer in order to implement the rotational data buffer.

  3. Conventional Circular Buffer • Getting CB • Get operations are fast because array construction and organization have already been performed. • Need to rotate array according to pointer in order to get full data buffer in chronological order.

  4. Lossy Que Circular Buffer • Initializing CB • LV2 Style Functional Global with Queue reference persisting in an uni-initialized shift register. • Obtain Queue of prescribed data type and size. • Add to CB • Use LabVIEW’s native Lossy EnqueueElement.vi to add a data element to the Circular Buffer. • No need to keep track of an array index pointer since the queue manages the location automatically.

  5. Lossy Que Circular Buffer • Getting CB • Getting the entire data history requires concatenating all the elements in the Lossy Queue. • This of course requires pre-allocating a data array and replacing initialized array subsets with data elements from the Lossy Queue.

  6. Performance Results

  7. Conclusions | Contrasts • Lossy Que Circular Buffers • Super easy to program on the front end by simply Obtaining a Queue. • Code is simple and lean to Add data to, Flush, or get Status of Lossy Queue. • All data types are already conveniently managed by the Queue Functions. • No need to worry about where the oldest data is in the Circular Buffer when getting the entire history. • Work and processor time required on the back end if you need the entire Circular Data Buffer at once. • Conventional Circular Buffers • Nearly all of development time is on the Front End in programming the replacement of data subsets in the pre-initialized data buffer. • Coding one is always a fun brain teaser in trying to get the array index pointer logic correct when adding data elements. • Extra code required to manage where the pointer is in order to rotate buffer correctly when reading the entire Circular Data Buffer. • Getting the entire Data Buffer is fast since all of the data array construction and organization has already been performed in the Add State.

  8. Thanks! • This presentation and it’s corresponding code are on the Alarm User Group NI Community site. • Thanks Dave Thomson for oversight and a second set of eyes. • Thanks Colorado Alarm Group. • Thanks NI for awesome products and support.

More Related