R3131 Spectrum Analyzer Operation Manual
4.2 RS-232 Remote Control Function
4-50*
Aug 28/98
4.2.6
Differences Between RS-232 and GPIB
•
Command code
Trace data input or output can only be formatted in ASCII.
NOTE: The following commands are unavailable: TBA and TBB.
4.2.7
Panel Control
During remote control operation, spectrum analyzer panel control is affected as follows.
•
The remote lamp does not light.
•
The key panel is not disabled.
•
CAUTION: If any settings are changed during remote control, the operation of the spectrum analyzer
may become unstable.
4.2.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 com-
pleted.
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, ”TS”
’
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
END