Advanced Features of High Speed Digital I/O devices : Memory
Overview
This paper belongs to the Advanced Features in High Speed Digital I/O Devices: White Paper Series
This tutorial describes the advantages of having deep on board memory on High Speed Digital I/O. Scripting and waveform generation use this memory available on the boards.Table of Contents
NI digital waveform generator/analyzers use multiple megabytes of onboard memory to acquire and generate data. Onboard memory allows much higher data rates than would be allowed by streaming data from system memory across the PCI bus. Acquisition Memory and Generation Memory are separate; for example, a 64 MS device has two 64 MS memory blocks—one for acquisition and one for generation.
If you are performing hardware comparison, the fault data is stored separately from the acquisition and generation data, so fault data does not consume any of your Acquisition or Generation 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).
This property node determines the sample size of the board. This also sets the number of usable channels. The default size is determined by the board. The acquisition data width can be set but the generation data width is fixed.

Figure 1: Data Width and number of channels available
In LabVIEW, you can use the Data Width Property Node to write to or read this property for the board.

Figure 2: Data Width Property Node
Acquisition Memory: The sample storage amount is determined by the physical memory and data width. You can increase the number of samples that can be stored in memory by reducing the data width.
Generation Memory: Similar to acquisition, the amount of samples that can be stored is determined by the physical memory and the data width. The data width is set by the device and the mode. For generation, a portion of the memory is also used for scripting instructions.

Figure 3: Memory Sizes
Streaming
The vast amounts of memory available on the High Speed Digital products enable users to stream data to and from the PC memory. The onboard memory acts as a buffer, which can store data while the board generates/acquires. The examples below show how to stream data for both acquisition and generation using the high speed digital boards.
Streaming on High Speed Digital I/O Boards: Acquisition
Streaming on High Speed Digital I/O Boards: Generation
A single instruction compiled for the National Instruments High Speed Digital I/O boards is 16 bytes. The number of samples that are used by an instruction depends on data width.
• Data width of 1 (654x, 655x) 4 Samples
• Data width of 2 (656x, SDR) 8 Samples
• Data width of 4 (656x, DDR) 16 Samples.
The amount of memory occupied can be determined by:
1 Byte 8 ch
Memory Option (Mbit/ch) x -----------------x ------------ x datawidth (Bytes)
8 bits 1 Byte
All scripts have a two instruction overhead.
- Generate statement
- No markers
- 1 instruction
- N markers
- N+1 instructions
- Subsets
- 1 Instruction
- No markers
- Wait statement
- 1 instruction
- Clear trigger statement
- 0 instruction
- Repeat Loops
- Repeat n loops
- 2 instructions
- Repeat until trigger
- 3 instructions
- Repeat forever
- Up to 47 instructions
- 2 instructions
- Greater than 47
- Must be a Multiple of 128 Bytes
- Extra space, if any, will be filled with null commands
- 2 instructions
- Up to 47 instructions
- Repeat n loops
- If-else statements
- Else statement must be a Multiple of 128 Bytes
- Extra space, if any, will be filled with null commands
- 2 instructions
- Else statement must be a Multiple of 128 Bytes
Conclusion
The onboard memory on the high speed digital boards is used for storing data. Digital vectors can be stored on the memory and advanced linking and looping of these vectors can be achieved using scripting. Also, for features such as hardware compare, the expected data is stored on the memory, which is then used to compare against the data that is acquired. Lastly, the on-board memory is used for streaming data to and from the PC memory.
Reader Comments | Submit a comment »
from
A single instruction compiled for the
National Instruments High Speed Digital I/O
boards is 16 bytes. The number of samples
that are used by an instruction depends on
data width.
• Data width of 1 (654x, 655x) 4 Samples
• Data width of 2 (656x, SDR) 8 Samples
• Data width of 4 (656x, DDR) 16
Samples.
Data width of generation for 6552 is fixed at
4 byte.
And the script is stored together with
generation memory.
So, why
• Data width of 1 (655x) 4 Samples
But not
• Data width of 4 (655x) 16 Samples
Thanks.
- engwei tan, Nexfrontier. engwei.tan@nexfrontier.com.sg - Oct 21, 2008
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/).

