Scripts
- Updated2024-08-16
- 2 minute(s) read
Scripts
You can link and loop multiple waveforms together in a generation operation 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 in which the waveforms are generated, the number of times they are generated, and the triggers and markers associated with the generation.
Basic Scripting Example
You can create a script to manage waveform generation based on multiple waveforms and triggers. For example, you could download waveforms A, B, C, and D into instrument memory and script it to do the following:
- Wait for a trigger to initiate generation
- Upon receiving this trigger, generate waveform A three times with a marker at position 16 each time
- 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
NI-RFSG Marker
Event Details
A marker is an event that an NI RF signal generator produces in relation to a waveform that is generated. The marker event is delayed slightly relative to the leading edge of the waveform that it marks.
By default, the marker event is a pulse of fixed width. The following figure shows a waveform generated on the output of a waveform generator. The waveform contains a pulse that represents a waveform sample n that is one Sample Clock in width. The second pulse, the marker event, represents the pulse that generates when the corresponding waveform sample n is output at the output connector.
You can use NI-RFSG to configure the characteristics of the pulse generated as the Marker event.
In addition, you can use scripts to create markers to develop complex behaviors around generated waveforms.
For example, you can configure the Marker event as a toggled digital pulse signal that changes state between a low level and high level. While the basic pulse option for Marker events generates event pulses of fixed width, using the toggle option allows you to use scripts to change the duration of the Marker event pulse. You can control the initial state of the toggled pulse with MarkerEvent.Toggle.InitialState.