Example Code

niScope Multi Record Fetch More than Available Memory - Prevent Overwrite using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.


  • LabVIEW

Code and Documents


With NI Scope, you can enable your program to fetch more data than is able to be stored in memory on the card. When doing this, the user must ensure that data is being written from the buffer to prevent the buffer from overflowing.

This VI Demonstrates how to acquire a finite amount of records using Fetch More Than Available Memory to enable a circular buffer on the card.  Each fetch is triggered using an external reference trigger.  This VI was specifically created to dynamically change the location of the fetch pointer in an effort to prevent any unread samples from being overwritten.  The VI also keeps track of a "fetch backlog" of records that have not yet been fetched, adjusting the Minimum Record Length, Sample Rate, and Number of Records per Fetch will allow you better control of this backlog.




  1. LabVIEW 2012 (or compatible)
  2. NI-Scope

Steps to Implement or Execute Code

  1. Set Resource Name and Channel Name for the device
  2. Set Sample Rate, Record Length, Number of Records to Fetch, and the number of Records to Acquire per Fetch.
  3. Set Reference Trigger properties
  4. Run VI


Additional Information or References

VI Snippet


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

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


Hi, I want to use this function to acquire a infinite amount of records using an external reference trigger.  But it do not works after fetching Number of Records. It looks like the digitizer do not overwrite records but fetch the old data once by once. And it fetch very fast, not match the trigger frequency. Have you got any ideas? Thanks.