89

Chapter 3, GPIB Command Guidelines

Guidelines for Operation

Sample GPIB Program

The following program was written on an HP® 9000 Series 300 controller using

Rocky Mountain BASIC (RMB). To run this program directly in the Test Set’s

IBASIC Controller make the following modifications:

1. Use exclamation marks (!) to comment-out lines 440, 450, and 460 (these commands

not supported in IBASIC).

2. Change line 70 to Bus = 8 (internal GPIB select code = 8).

10 ! This program generates an FM carrier, measures and displays the
20 !deviation, and draws the modulation waveform from the
30 !oscilloscope to the CRT display. For demonstration purposes the
40 ! carrier is generated and analyzed through the uncalibrated input
50! path so that no external cables are required.
60 GCLEAR !Clear graphics display.
70 Bus=7 ! Interface select code of GPIB interface
80 Dut=100*Bus+14 ! Default Test Set GPIB address is 14
90 CLEAR Bus ! Good practice to clear the bus
100 CLEAR SCREEN ! Clear the CRT
110 OUTPUT Dut;"*RST" ! Preset the Test Set
120 OUTPUT Dut;"DISP DUPL" ! Display the DUPLEX TEST screen
130 OUTPUT Dut;"RFG:AMPL -14 DBM" ! Set RF Gen Amptd to -14 dBm
140 OUTPUT Dut;"AFAN:INP ’FM Demod’"
150 ! Set AF Analyzer’s input to FM Demod
160 OUTPUT Dut;"AFAN:DET 'Pk+-Max'"
170 ! Set AF Analyzer’s detector to Peak +/-Max
180 ! The following trigger guarantees the instrument will auto-tune
190 !and auto-range to the input signal before measuring.
200 OUTPUT Dut;"TRIG"! Trigger all active measurements
210 OUTPUT Dut;"MEAS:AFR:FM?" ! Request an FM deviation measurement
220 ENTER Dut;Dev ! Read measured value into variable Dev
230 PRINT USING "K,D.DDD,K";"Measured FM = ",Dev/1000," kHz peak."
240 DISP "'Continue' when ready..." ! Set up user prompt
245 ! Set up interrupt on softkey 1
250 ON KEY 1 LABEL "Continue",15 GOTO Proceed
260 LOOP! Loop until the key is pressed
270 END LOOP
280 Proceed: OFF KEY! Turn off interrupt from softkey 1
290 DISP "! Clear the user prompt
300 !
310 !Measure and plot oscilloscope trace to see the waveform shape.
320 DIM Trace(0:416)! Oscilloscope has 417 trace points
330 OUTPUT Dut;"DISP OSC" Display the Oscilloscope screen
340 OUTPUT Dut;"TRIG"! Trigger all active measurements
350 OUTPUT Dut;"MEAS:OSC:TRAC?"
360 !Request the oscilloscope trace
370 ENTER Dut;Trace(*)