Using the
*WAI
Command, Example
Program 7
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
The following example illustrates the use of the
*WA1
command to
cause the swept signal generator to perform a synchronous sweep.
Source=719
ABORT 7
LOCAL 7
CLEAR Source
REMOTE Source
CLS
OUTPUT
Source;"*RST"
OUTPUT
Source;"FREQ:STAR
4GHZ; STOP
SGHZ;
MODE
SWE"
OUTPUT
Source;"SWE:TIME
2"
OUTPUT
Source;"*OPC?"
ENTER Source;X
FOR
I=1
TO 4
OUTPUT
Source;"INIT"
OUTPUT
Source;"*WAI"
OUTPUT
Source;"POW:STAT
ON"
OUTPUT
Source;"INIT"
OUTPUT
Source;"*WAI"
OUTPUT
Source;"POW:STAT
OFF"
NEXT I
PRINT "Finished sending commands to source."
PRINT "Note that execution is continuing for four cycles."
END
Run the program.
Program Comments
10: Assign the source’s HP-IB address to a variable.
20 to 50: Abort any HP-IB activity and initialize the HP-IB
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, suffixes 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 response to the *OPC? into a variable “X”.
The program execution will halt here until the source has finished
processing all the commands up to this point. Once complete, the
source will respond to the *OPC? with a “1”.
120: Begin a FOR/NEXT loop that is repeated four times.
130: Initiate a sweep on the source.
Getting Started Programming
1-l
0 1