User`s manual
84 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
HP-IB Command Guidelines
Guidelines for Operation
Sample HP-IB Program
The following program was written on an HP 9000 Series 300 controller
using Agilent Technologies 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 HP-IB select code = 8).
Example 3-33 Example
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 HP-IB interface
80 Dut=100*Bus+14 ! Default Test Set HP-IB 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
115 OUTPUT Dut;"DISP RFAN" !Display the RF ANALYZER screen
116 OUTPUT Dut;"RFAN:FREQ 100 MHZ" !Set the tune freq. to 100 MHz
120 OUTPUT Dut;"DISP RFG" ! Display the RF GENERATOR screen
125 OUTPUT Dut;"RFG:FREQ 100 MHZ" ! Set the RF Gen frequency to 100 MHz
130 OUTPUT Dut;"RFG:AMPL -26 DBM" ! Set RF Gen Amptd to -26 dBm
135 OUTPUT Dut;"AFG1:FM:STAT ON" !Turn on FM (3 kHz deviation, default)
136 OUTPUT Dut;"DISP AFAN" ! Display the AF ANALYZER screen
140 OUTPUT Dut;"AFAN:INP ’FM Demod’"
150 ! Set AF Analyzer’s input to FM Demod
160 OUTPUT Dut;"AFAN:DET 'Pk+-Max'"
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