Chapter 4
Programming
NI PXIe-5450 User Manual
4-18
ni.com
select the one you wish to execute by setting the Script to Generate
property.
C Example
The procedure below provides the basic steps required to configure Script
mode. To see a more detailed example of the use of Script mode in C, refer
to the ArbitraryScript example for CVI.
1.
Call the
niFgen_configureOutputMode
function with
outputMode
set to
NIFGEN_VAL_OUTPUT_FUNC
.
2.
Write all waveforms that are referenced in the script by calling the one
of the niFgen Write Named Waveform functions
(
niFgen_WriteNamedWaveformF64
,
niFgen_WriteNamedWaveformI16
,
niFgen_WriteNamedWaveformComplexF64
,
niFgen_WriteNamedWaveformComplexI16
) and associate the
proper names to them.
3.
After your waveforms are written to your device, call the
niFgen_WriteScript
function to write the script(s) containing the
generation instructions to be executed.
The script you write can manage waveform generation based on multiple
waveforms and triggers. For example, you could download waveforms A,
B, C, and D into device memory. You could then write a script that would
wait for a trigger to initiate generation and, upon receiving this trigger,
generate waveform A three times with a marker at position 16 each time
and finally generate waveforms B, C, and D twice (BCDBCD). The
following is the script of this example:
script myFirstScript
wait until scriptTrigger0
repeat 3
generate waveformA marker0(16)
end repeat
repeat 2
generate waveformB
generate waveformC
generate waveformD
end repeat
end script