User`s guide

2-28
GPIB Tutorial and Examples
Program 1
4460 Run$=”no”
4470 IF Answer$=”Y” OR Answer$=”y” THEN Run$=”yes”
4480 UNTIL Run$<>”yes”
4490 END
4500 !
4510
!====================================================================================
4520 !SUBROUTINES BELOW
4530
!====================================================================================
4540 !
4550 !RESULTS PRINTING SUBROUTINE
4560 !
4570 SUB
Sub_printit(Result1(*),Result2(*),Result3(*),Result4(*),Result5(*),Result6(*),Result7
(*),Result8$(*),Numarfcn,Numpwr,Title$,Heading$,Emptyst$,Empty)
4580 PRINT Title$
4590 PRINT
4600 PRINT Heading$
4610 FOR Arcount=1 TO Numarfcn
4620 FOR Txcount=1 TO Numpwr
4630 PRINT Result1(Arcount),
4640 PRINT Result2(Txcount),
4650 IF Result3(1,1)<>Empty THEN PRINT DROUND(Result3(Arcount,Txcount),4),
4660 IF Result4(1,1)<>Empty THEN PRINT DROUND(Result4(Arcount,Txcount),4),
4670 IF Result5(1,1)<>Empty THEN PRINT DROUND(Result5(Arcount,Txcount),4),
4680 IF Result6(1,1)<>Empty THEN PRINT DROUND(Result6(Arcount,Txcount),4),
4690 IF Result7(1,1)<>Empty THEN PRINT DROUND(Result7(Arcount,Txcount),4),
4700 IF Result8$(1,1)<>Emptyst$ THEN PRINT Result8$(Arcount,Txcount),
4710 PRINT
4720 NEXT Txcount
4730 NEXT Arcount
4740 PRINT
4750 SUBEND
4760 !
4770 !=============================================================================
4780 !
4790 !CHECK FOR Agilent 8922M/S SYSTEM ERRORS
4800 !
4810 SUB Sub_syserror(Uut,Error$(*),Errcount)
4820 DIM Systemerror$[100]
4830 REPEAT !Set up a loop to drain the
Agilent 8922M/S error stack
4840 OUTPUT Uut;”SYSTEM:ERROR?” !Read the last error from the
stack
4850 ENTER Uut;Systemerror$
4860 IF VAL(Systemerror$)<>0 THEN !Code 0 indicates no error
4870 Errcount=Errcount+1 !If not zero, add the error to
the programs error array
4880 Error$(Errcount)=Systemerror$
4890 END IF
4900 UNTIL VAL(Systemerror$)=0 !End when all the errors have
been read
4910 SUBEND
4920 !
4930 !==============================================================================
4940 !end of program