R3132 Series Spectrum Analyzer Operation Manual
4.3.8 Remote Control Usage Examples
4-67
4.3.8
Remote Control Usage Examples
The following examples show typical remote control commands, and are written in “Microsoft Quick Ba-
sic” (licensed by Microsoft Corporation).
The Open command statement OPEN” COM1: 9600, N, 8, 1, ASC” FOR RANDOM AS #1 shown below
has the following characteristics: baud rate is 9600 bps, no parity, 8 bit data length, stop bit of 1, ASCII
format and random access mode.
Example:
This program is used to check the status byte register to see if the sweep has been completed.
OPEN ”COM1:9600,N,8,1,ASC” FOR RANDOM AS #1
PRINT #1, ”DL3”
’
CR and LF are set as the GPIB delimiter.
PRINT #1, ”SI”
’
Single sweep is performed.
PRINT #1, ”OPR8”
’
Sweep completion bit in the GPIB operation register is set.
PRINT #1, ”CLS”
’
Clearing the status bytes.
PRINT #1, ”SI”
’
Single sweep is performed.
MEAS.LOOP:
PRINT #1, ”*STB?”
’
Read out the status bytes.
INPUT #1, STAT
IF (STAT AND 128) = 0 THEN GOTO MEAS.LOOP
PRINT #1, ”PS”
’
Peak search.
PRINT #1, ”ML?”
’
Read out the peak level.
INPUT#1,MLEVEL
PRINT MLEVEL
CLOSE #1
END