User`s guide

2-48
GPIB Tutorial and Examples
Program 3
4020
!====================================================================================
4030 !SUBROUTINES BELOW
4040
!====================================================================================
4050 !
4060 !RESULTS PRINTING SUBROUTINE
4070 !
4080 SUB
Sub_printit(Result1(*),Result2(*),Result3(*),Result4(*),Result5(*),Result6(*),Result7
(*),Result8$(*),Numarfcn,Numpwr,Title$,Heading$,Emptyst$,Empty)
4090 PRINT Title$
4100 PRINT
4110 PRINT Heading$
4120 FOR Arcount=1 TO Numarfcn
4130 FOR Txcount=1 TO Numpwr
4140 PRINT Result1(Arcount),
4150 PRINT Result2(Txcount),
4160 IF Result3(1,1)<>Empty THEN PRINT DROUND(Result3(Arcount,Txcount),4),
4170 IF Result4(1,1)<>Empty THEN PRINT DROUND(Result4(Arcount,Txcount),4),
4180 IF Result5(1,1)<>Empty THEN PRINT DROUND(Result5(Arcount,Txcount),4),
4190 IF Result6(1,1)<>Empty THEN PRINT DROUND(Result6(Arcount,Txcount),4),
4200 IF Result7(1,1)<>Empty THEN PRINT DROUND(Result7(Arcount,Txcount),4),
4210 IF Result8$(1,1)<>Emptyst$ THEN PRINT Result8$(Arcount,Txcount),
4220 PRINT
4230 NEXT Txcount
4240 NEXT Arcount
4250 PRINT
4260 SUBEND
4270 !
4280 !=============================================================================
4290 !
4300 !CHECK FOR Agilent 8922M/S SYSTEM ERRORS
4310 !
4320 SUB Sub_syserror(Uut,Error$(*),Errcount)
4330 DIM Systemerror$[100]
4340 REPEAT !Set up a loop to drain the
Agilent 8922M/S error stack
4350 OUTPUT Uut;”SYSTEM:ERROR?” !Read the last error from the
stack
4360 ENTER Uut;Systemerror$
4370 IF VAL(Systemerror$)<>0 THEN !Code 0 indicates no error
4380 Errcount=Errcount+1 !If not zero, add the error to
the programs error array
4390 Error$(Errcount)=Systemerror$
4400 END IF
4410 UNTIL VAL(Systemerror$)=0 !End when all the errors have
been read
4420 SUBEND
4430 !
4440 !==============================================================================
4450 !
4460 !CONFIGURE THE Agilent 8922M/S AUX RF OUT PORT TO EMULATE A MOBILE IN TEST MODE
4470 !
4480 !This subroutine uses unsupported HP-IB commands to ‘trick’ the Agilent 8922M/S
into opperating as if
4490 !a test mode mobile was connected. The Aux RF Out port is configured to emulate
the mobile.
4500 !Replacing this subroutine with one to control a real GSM mobile would allow the
program to be
4510 !used in a real application
4520 !
4530 SUB Sub_trickmobile(Uut,Func$,Arfcn,Txlev,Trickfreq,Extloss)
4540 Trickfreq=(935+Arfcn*.2)*1000000 !Adjust the uplink frequency
to equal the downlink
4550 Trickloss=Extloss+(2*Txlev)-43+7 !Adjust the ext loss to simu-
late Tx Level changes