Example Code

Use Shift Register to Create a Circular Buffer to Compare Data in LabVIEW

Code and Documents

Attachment

Overview
Demonstrates how to implement a Circular Buffer using an array and a shift register.

 

Description

This example initializes an array with zeros and sets the size to user specified number. While Loop is then used to move through the array based on the iteration number. The difference between the new value and the value it is replacing will be displayed. The array is stored using a shift register.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Set the Circular Buffer Array Size
  2. Run the program
  3. The array elements value  will be updated with random numbers
  4. When the array is full, the older elements will be replaced with newer values
  5. Click "Stop Button" button to stop the program

 

Additional Information or Resources

VI Block Diagram

 

BD.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

Justin Parker
National Instruments
Product Support Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.