R3131 Spectrum Analyzer Operation Manual
4.1 GPIB Remote Programming
4-43Aug 28/98
Example PC-17: Read the peak frequency and the level on every end of single sweeping. (when
using SRQ signal).
10 ISET IFC:ISET REN ’ Send IFC signal and set REN signal in
one.
20 SPA=8 ’ Set GPIB address (8) in variable.
30 PRINT @SPA;”SI” ’ Set in single sweeping mode.
40 ON SRQ GOSUB *SSRQ ’ Decline the SRQ interrupt processing
routine.
50 PRINT @SPA;”*CLS” ’ Clear the status byte
60 PRINT @SPA:”OPR8” ’ Make the Sweep-end bit of the
operation status register enable.
70 PRINT @SPA;”*SRE128” ’ Make the Operation Status bit of the
status byte enable.
80 PRINT @SPA;”S0” ’ Specify the sending out mode of SRQ
signal.
90 *LOOP
100 SEND=0 ’ Clear the Sweep-end flag.
110 PRINT @SPA;”SR” ’ Begin the sweeping.
120 SRQ ON ’ Make the SRQ interruption of PC
enable.
130 *WINT
140 IF SEND=0 THEN GOTO *WINT ’ Wait until SRQ interruption occurs.
150 PRINT @SPA;”PS” ’ Execute the peak search.
160 PRINT @SPA;”MFL?” ’ Request the output of the marker data.
170 INPUT @SPA:MF,ML ’ Read the peak frequency and the level.
180 PRINT ”Peak Freq:”;MF;”,Peak Level:”;ML ’ Display the read data.
190 GOTO *LOOP ’ Repeat the sweeping.
200
210 *SSRQ ’ SRQ interrupt processing routine.
220 POLL SPA,S ’ Read the status byte.
230 SEND=1 ’ Set the Sweep-end flag in one.
240 RETURN ’ Return to the main routine.
250
260 END