Using the *WAI
Command, Example
Program 7
The following example illustrates the use of the *WAI command to
cause the swept signal generator to p erform a synchronous sweep.
10 Source=719
20 ABORT 7
30 LOCAL 7
40 CLEAR Source
50 REMOTE Source
60 CLS
70 OUTPUT Source;"*RST"
80 OUTPUT Source;"FREQ:STAR 4GHZ; STOP 5GHZ; MODE SWE"
90 OUTPUT Source;"SWE:TIME 2"
100 OUTPUT Source;"*OPC?"
110 ENTER Source;X
120 FOR I=1 TO 4
130 OUTPUT Source;"INIT"
140 OUTPUT Source;"*WAI"
150 OUTPUT Source;"POW:STAT ON"
160 OUTPUT Source;"INIT"
170 OUTPUT Source;"*WAI"
180 OUTPUT Source;"POW:STAT OFF"
190 NEXT I
200 PRINT "Finished sending commands to source."
210 PRINT "Note that execution is continuing for four cycles."
220 END
Run the program.
Program Comments
10: Assign the source's GPIB address to a v
ariable.
20 to 50: Ab ort any GPIB activity and initialize the GPIB
interface.
60: Clear the computer's display.
70: Set the source to its initial state for programming.
80: Set the source up for a sweep, from 4 GHz to 5 GHz.
90: Set the sweep time to 2 seconds. In SCPI, suxes are optional
if you program in fundamental units (for sweep time, that would
be seconds).
100: Send an *OPC? to the source.
110: Enter the query resp onse to the *OPC? into a variable \X".
The program execution will halt here until the source has nished
pro cessing all the commands up to this p oint. Once complete, the
source will respond to the *OPC? with a \1".
120: Begin a FOR/NEXT lo op that is rep eated four times.
130: Initiate a sweep on the source.
Getting Started Programming 1-101