![National Instruments NI PXIe-5450 Скачать руководство пользователя страница 151](http://html2.mh-extra.com/html/national-instruments/ni-pxie-5450/ni-pxie-5450_user-manual_3486740151.webp)
Chapter 4
Programming
NI PXIe-5450 User Manual
4-32
ni.com
C Example
1.
Enable the signal generator for direct DMA writes by setting the
NIFGEN_ATTR_DIRECT_DMA_ENABLED
attribute. Once enabled,
NI-FGEN monitors and reports any issues with the direct DMA
transfer.
2.
Identify the waveform data source and set the
NIFGEN_ATTR_DIRECT_DMA_WINDOW_ADDRESS
attribute to the
address provided by your direct DMA-compatible data source.
3.
Set the
NIFGEN_ATTR_DIRECT_DMA_WINDOW_SIZE
attribute to the
size of the memory window provided by your direct DMA-compatible
data source.
4.
Use the
niFgen_WriteBinary16Waveform
function 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.
Simulation Mode
NI signal generators support simulation. Simulating a device enables you
to perform the following tasks:
•
Protect your devices by first testing settings and configurations on
simulated devices.
•
Verify device behaviors under a wide variety of operating conditions.
•
Start or speed up application development before you have the
hardware.
•
Optimize designs and determine ideal design parameters.
Enabling simulation allows you to verify that you have correctly configured
the device. For example, if a parameter is set to an invalid value for the
device, NI-FGEN returns the same error it would for a real device. While
simulation is useful for verifying your configuration, there are some areas
where simulation is not sufficient to verify that your configuration is
correct. For example, no errors will be returned for configurations that
involve or depend upon external signals, such as configuring an external
Sample clock or routing signals. Also, the amount of time a generation
takes to complete will be ignored in simulation mode; a finite generation
will finish immediately after it is initiated, regardless of how much data is
downloaded and how fast it is generated.