The Benefits of Deep Onboard Memory Tutorial
Overview
This tutorial is part of the National Instruments Measurement Fundamentals series. Each tutorial in this series, will teach you a specific topic of common measurement applications, by explaining the theory and giving practical examples. This tutorial covers the advantages of deep memory on a high-speed digital I/O device.
For additional digital only concepts, refer to the Digital I/O Fundamentals main page.
For the complete list of tutorials, return to the NI Measurement Fundamentals Main page.
Table of Contents
Onboard Memory Overview
Digital I/O devices often use multiple megabytes of onboard memory to acquire and generate data. Onboard memory allows much higher data rates than would be allowed by streaming from system memory across a communication bus, like the PCI bus. In general, acquisition memory and generation memory are separate; for example, a 64 mega sample (MS) device has two 64 MS memory blocks—one for acquisition and one for generation.
Generation Onboard Memory
Waveforms and scripts are stored together in device memory. They are stored in contiguous blocks, appearing in memory in the order they were written to the device. You can delete individual waveforms from the device, freeing up the space they occupy for other waveforms to be written.
Deleting waveforms that are not at the end of the utilized space causes memory fragmentation. The following scenario demonstrates how memory fragmentation can occur. First, assume four waveforms are currently in memory as shown in the following figure (sizes, in MS, are shown for clarity).
In the previous figure, there is enough memory to write an additional 22 MS waveform to the device. If Waveform C is deleted, that memory is freed, as shown in the following figure.

However, because waveforms are always stored contiguously in memory, the largest waveform that could be stored in memory is still 22 MS. Writing Waveforms C last would have been advantageous because then deleting Waveform C would create a single block of free space, as shown in the following figure.

In this situation, you can now write a 37 MS waveform to your device. Notice that when you create a script for your dynamic generation operation it consumes some space in memory, as shown in the following figure.
Acquisition Onboard Memory
When an acquisition operation is initiated, the device begins waiting for the Start trigger. Once the Start trigger is received, the device starts acquiring data and storing the samples into device memory. The first sample acquired marks the beginning of the acquired record, as shown in the following figure.

[+] Enlarge Image
If no Start trigger has been configured, acquisition begins immediately after the operation is initiated. After the device has recognized the Start trigger and has acquired the configured number of pretrigger samples, the device can now recognize a Reference trigger. While waiting for the Reference trigger, the device is still sampling data into the device memory. If the record overflows, the newest samples overwrite the oldest samples in the record. After the Reference trigger is received, the device acquires enough posttrigger samples and finishes the acquisition, as shown in the following figure.

[+] Enlarge Image
If no Reference trigger has been configured, a single record of data is acquired.
Fetching Acquired Data
Data acquired between the Start trigger and the first pretrigger sample is also available to be fetched. The following figure shows the four common fetch positions.

[+] Enlarge Image
In cases where no Reference trigger has been configured, First Pretrigger Sample and Reference Trigger are equivalent to First Sample.
Multirecord Acquisitions
In the case of multirecord acquisitions, the Advance trigger initiates the acquisition or fetch operation for the second and all subsequent records. Therefore, for multirecord acquisitions, the Start trigger shown in the previous figures would be replaced by an Advance trigger for all records after the initial one.
Relevant NI Products
Customers interested in this topic were also interested in the following NI products:
- High-Speed Digital I/O
- Industrial Digital I/O
- Logic Analyzers
- Modular Instruments (digital multimeters, digitizers, switching, etc...)
- Digital Waveform Editor
- LabVIEW Graphical Programming Environment
- SignalExpress Interactive Software Environment
For the complete list of tutorials, return to the NI Measurement Fundamentals Main page
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
