|Download Help (Windows Only)|
Script mode allows you to use scripting to link and loop multiple waveforms in complex combinations using a script. A script is a series of instructions that indicates how waveforms saved in the onboard memory should be sent to the DUT. The script can specify the order of the generated waveforms, the number of times they are generated, and the triggers and markers associated with the generation.
To create your script, complete the following steps:
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, as you receive 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 code illustrates this example:
wait until scriptTrigger0
generate waveformA marker0(16)
|Note Internally, the script stores physical device memory locations to refer to named waveforms. Thus, you must write all waveforms to the device before writing the script, or the device does not know where the waveform is located. The niFgen Initiate Generation VI or the niFgen_InitiateGeneration function returns an error if this rule is violated. If you delete waveforms and rewrite them, rewrite the script to update it with the new locations even if the script text has not changed.
In some cases at high Sample clock rates, your script may result in an underflow error. Underflow errors in a script can be created by waveform size, marker placement, and specific script instructions. To avoid underflow errors, refer to the minimum waveform size in your device specifications.