User`s guide
2-31
GPIB Tutorial and Examples
Program 2
1140 Message$(7)=”Results from BER Test”
1150 Message$(8)=”ARFCN Downlink dBm BER1% RxQual RxLev TIMERR”
1160 Message$(9)=” Seconds.”
1170 Message$(10)=”Time for phone to camp and answer page: “
1180 Message$(11)=”Time for testing : “
1190 Message$(12)=”Time for call clear down : “
1200 !
1210 Emptyst$=”@”
1220 Empty=-999
1230 Nullst$(1,1)=Emptyst$
1240 Null(1,1)=Empty
1250 !
1260 !==========================================================================
1270 !
1280 !ERROR AND TIMEOUT HANDLING
1290 !
1300 Busport=INT(Uut/100) !Get the GPIB port code from Uut
address
1310 CLEAR Busport !Clear bus from any aborted previous
commands
1320 Timeinit$=”yes” !Set a flag so timeout code is not
executed first pass
1330 ON TIMEOUT Busport,Timeouttime GOTO Timeflag !Establish goto flag
for HPIB timeouts
1340 Timeflag:IF Timeinit$<>”yes” THEN !After a timeout, execution comes
here
1350 OFF TIMEOUT Busport
1360 CLEAR Busport !Clear any half done commands
1370 OUTPUT Uut;”TRIG:AST ‘disarm’” !Dissarm the DSP trigger
1380 CALL Sub_syserror(Uut,Error$(*),Errcount) !Gather any error message from the
Agilent 8922M/S
1390 PRINT “Measurement Timed Out. Ending Test”
1400 IF Errcount=0 THEN
1410 Errcount=1
1420 Error$(1)=”No errors recorded”
1430 END IF
1440 FOR X=1 TO Errcount !Print error messages
1450 PRINT Error$(X)
1460 NEXT X
1470 STOP !Execution stops here after critical
errors
1480 ELSE
1490 Timeinit$=”no” !Reset flag so next time, it must
be a real timeout
1500 END IF
1510 Errcount=0
1520 CALL Sub_syserror(Uut,Error$(*),Errcount) !Clear any old errors from
Agilent 8922M/S before the
1530 Errcount=0 !test begins
1540 !
1550 !===========================================================================
1560 !
1570 !PRESET THE HP 8922M/S AND SET IT TO THE CORRECT COMPATIBILITY MODE (executed
once only)
1580 !
1590 !
1600 OUTPUT Uut;”*RST” !Preset the Agilent 8922M/S
1610 OUTPUT Uut;”CONF:COMP?” !Check compatability mode and set
to M or S
1620 ENTER Uut;Product$
1630 IF Product$<>”””8922S””” AND Product$<>”””8922M””” THEN
1640 IF Product$=”””8922E””” THEN OUTPUT Uut;”CONF:COMP ‘8922S’”
1650 IF Product$=”””8922G””” THEN OUTPUT Uut;”CONF:COMP ‘8922M’”
1660 OUTPUT Uut;”*RST” !A preset is needed after compat-
ability change
1670 END IF
1680 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any errors logged by
Agilent 8922M/S