User`s guide
2-21
GPIB Tutorial and Examples
Program 1
1190 Busport=INT(Uut/100) !Get the GPIB port code from Uut
address
1200 CLEAR Busport !Clear bus from any aborted previous
commands
1210 Timeinit$=”yes” !Set a flag so timeout code is not
executed first pass
1220 ON TIMEOUT Busport,Timeouttime GOTO Timeflag !Establish goto flag
for HPIB timeouts
1230 Timeflag:IF Timeinit$<>”yes” THEN !After a timeout, execution comes
here
1240 OFF TIMEOUT Busport
1250 CLEAR Busport !Clear any half done commands
1260 OUTPUT Uut;”TRIG:AST ‘disarm’” !Dissarm the DSP trigger
1270 CALL Sub_syserror(Uut,Error$(*),Errcount) !Gather any error message from the
Agilent 8922M/S
1280 PRINT “Measurement Timed Out. Ending Test”
1290 IF Errcount=0 THEN
1300 Errcount=1
1310 Error$(1)=”No errors recorded”
1320 END IF
1330 FOR X=1 TO Errcount !Print error messages
1340 PRINT Error$(X)
1350 NEXT X
1360 STOP !Execution stops here after critical
errors
1370 ELSE
1380 Timeinit$=”no” !Reset flag so next time, it must
be a real timeout
1390 END IF
1400 Errcount=0
1410 CALL Sub_syserror(Uut,Error$(*),Errcount) !Clear any old errors from
Agilent 8922M/S before the
1420 Errcount=0 !test begins
1430 !
1440
!=================================================================================
1450 !
1460 !PRESET THE Agilent 8922M/S AND SET IT TO THE CORRECT COMPATIBILITY MODE (exe-
cuted once only)
1470 !
1480 !
1490 OUTPUT Uut;”*RST” !Preset the Agilent 8922M/S
1500 OUTPUT Uut;”CONF:COMP?” !Check compatability mode and set
to F or H
1510 ENTER Uut;Product$
1520 IF Product$<>”””8922S””” AND Product$<>”””8922M””” THEN
1530 IF Product$=”””8922E””” THEN OUTPUT Uut;”CONF:COMP ‘8922S’”
1540 IF Product$=”””8922G””” THEN OUTPUT Uut;”CONF:COMP ‘8922M’”
1550 OUTPUT Uut;”*RST” !A preset is needed after compat-
ability change
1560 END IF
1570 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any errors logged by
HP 8922M/S
1580 !
1590 !===========================================================================
1600 !
1610 !SET THE Agilent 8922M/S INITIAL CONDITIONS (executed once only)
1620 !
1630 !
1640 OUTPUT Uut;”MSINFO:PAGING:IMSI “&Imsi$ !Set the paging IMSI
1650 OUTPUT Uut;”CONF:OFL:RFIN “;Extloss !Set the external cable loss
1660 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Dsparfcn(1) !Set the ARFCN to the first
expected test point
1670 OUTPUT Uut;”CELL:MS:TLEV “;Dsppwr(1) !Set the mobile Tx Level to the
first test point
1680 OUTPUT Uut;”CONF:OFL:MODE ‘ON’” !Turn external offset mode ON to
use cable loss
1690 OUTPUT Uut;”CW:PMZERO” !Zero the power meter