Chapter 4
Programming
©
National Instruments Corporation
4-31
NI PXIe-5450 User Manual
Note
The
NIFGEN_ATTR_STREAMING_SPACE_AVAILABLE_IN_WAVEFORM
attribute
specifies the total amount of space available in the streaming waveform. During
generation, this available space may be in multiple locations with, for example, part of the
available space at the end of the streaming waveform and the rest at the beginning. In this
situation, writing a block of waveform data the size of the total space available in the
streaming waveform causes NI-FGEN to return an error, as NI-FGEN will not wrap the
data from the end of the waveform to the beginning and cannot write data past the end of
the waveform buffer.To avoid writing data past the end of the waveform, write new data to
the waveform in a fixed size that is an integer divisor of the total size of the streaming
waveform.
6.
Call the
niFgen_WriteWaveform
function to write a new block of
waveform data to the streaming waveform in onboard memory.
Repeat the process of monitoring the available memory and writing
waveform data in blocks as free space becomes available.
Configuring Your Application for Direct DMA
You can achieve high rates of data transfer to the onboard memory by
configuring your device for Direct DMA. Direct DMA establishes a direct
connection between the signal generator onboard memory and a
specialized waveform data source.
The following instructions are a guide for configuring your application for
direct DMA.
LabVIEW Example
1.
Enable the signal generator for direct DMA writes by setting the Direct
DMA Enabled property. Once enabled, NI-FGEN monitors and
reports any issues with the direct DMA transfer.
2.
Identify the waveform data source and set the Direct DMA Window
Address property to the address provided by your direct
DMA-compatible data source.
3.
Set the Direct DMA Window Size property to the size of the memory
window provided by your direct DMA-compatible data source.
4.
Use the niFgen Write Waveform I16 Direct DMA VI to write blocks
of data to the signal generator. For each block of data written to the
signal generator, you provide the address of the direct DMA window
instead of an array of samples residing in host memory. NI-FGEN
detects when the address is within the direct DMA window and
handles the transfer appropriately.