10 ! RE-SAVE "RESU_83480"!Operation of SENDValid & STATistics on RESULTS? 20 ! 30 !**********************************************************************! 40 !******************** Main Program, Rev. 1.18 ***********************! 50 !**********************************************************************! 60 Readme 70 Initscope(@Scope) 80 True_rep(@Scope) 90 Measure(@Scope) 100 PRINT "End of Program -- Results are on your printer." 110 BEEP 15,2 120 !*************************************************************! 130 END !* End of Main Program *! 140 !*************************************************************! 150 ! 160 !*************************************************************! 170 !* Begin Sub Programs *! 180 !*************************************************************! 190 SUB Readme 200 !*****************************************************************! 210 !*This sub program writes user program information to the screen.*! 220 !*****************************************************************! 230 CLEAR SCREEN 240 PRINT "This example program will measure the signal." 250 PRINT "from an HP8133A generator (or any similar signal). " 260 PRINT 270 PRINT "It measures the Positive Pulse Width with Statistics." 280 PRINT "Then uses the *RESULTS?* to report over the HPIB." 290 PRINT 300 PRINT "The report from the RESULTS? varies depending on the status" 310 PRINT "of STATISTICS ON|OFF and SENDValid ON|OFF." 320 PRINT 330 PRINT "This program will print the results for each of the cases." 340 PRINT 350 PRINT "The program assumes that the system is configured such that:" 360 PRINT 370 PRINT " HP-IB interface is at address 7." 380 PRINT " Scope is at address 7." 390 PRINT " An 83483A is installed into slots 1 & 2." 400 PRINT " Printer at 701" 410 PRINT 420 PRINT "If these addresses are incorrect, break program and set addresses" 430 PRINT "as needed in the ASSIGN statements." 440 PRINT 450 PRINT "PRESS continue to run program" 460 PAUSE 470 CLEAR SCREEN 480 SUBEND 490 ! 500 SUB Initscope(@Scope) 510 !****************************************************************! 520 !* This sub program initializes the I/O and scope. *! 530 !****************************************************************! 540 ASSIGN @Scope TO 707 550 CLEAR @Scope !clear HP-IB interface 560 OUTPUT @Scope;"*cls" 570 OUTPUT @Scope;"*RST" !reset scope to default config 580 OUTPUT @Scope;":SYSTEM:HEADER OFF"!turn off header 590 CLEAR SCREEN 600 SUBEND 610 ! 620 SUB True_rep(@Scope) 630 !****************************************************************! 640 !* This sets up the scope to look at the signal of the 8133. *! 660 !****************************************************************! 670 PRINT " Connect the HP 8133A CHANNEL 1 Output to the Input " 680 PRINT " of the 83483A. " 690 PRINT 700 PRINT " Press continue when ready to continue. " 710 PAUSE 720 CLEAR SCREEN 730 OUTPUT @Scope;":channel1:display on" 770 OUTPUT @Scope;":autoscale" 780 OUTPUT @Scope;":display:persistence infinite" 790 WAIT 5 800 PRINT " The displayed waveform on the 83480A is the true " 810 PRINT " representation of the 8133A signal." 820 PRINT 840 PRINT " Sampling rate is 40 kSa/s," 850 PRINT " Analog Bandwidth is 20 GHz" 860 PRINT 870 SUBEND 880 ! 890 SUB Measure(@Scope) 900 !***************************************************************! 910 !* This sub program will make a +width measurement. *! 920 !* It will also report the mean and standard deviation. *! 930 !***************************************************************! 940 CLEAR SCREEN 950 PRINT " Measuring Waveform and Reporting Results. " 960 REAL R(1:12) 970 !***************************************************************! 980 ! Normally when making measurements, they should be preceeded ! 990 ! by a DIGITIZE. But, because I have the scope setup like I ! 1000 ! want it from previous sub programs and I will be using the ! 1010 ! statistics, I will not use the DIGITIZE command. ! 1020 !***************************************************************! 1030 OUTPUT @Scope;":measure:source channel1" 1040 PRINTER IS 701 1050 FOR C=1 TO 4 1060 OUTPUT @Scope;"run" 1070 MAT R= (0) 1080 OUTPUT @Scope;":measure:statistics ";INT(C/3) 1090 OUTPUT @Scope;":measure:sendvalid ";C MOD 2 1100 OUTPUT @Scope;":measure:statistics?" 1110 ENTER @Scope;St$ 1120 OUTPUT @Scope;":measure:sendvalid?" 1130 ENTER @Scope;Sv$ 1140 OUTPUT @Scope;":measure:pwidth" 1150 OUTPUT CRT;"Measuring for 20 seconds to get good stats." 1160 WAIT 20 !* Give the measurements a chance to build up values *! 1170 OUTPUT @Scope;"stop"!* See that values match ON SCREEN & OVER HPIB *! 1180 OUTPUT @Scope;":measure:results?" 1190 ENTER @Scope USING "%,K";R(*) 1200 OUTPUT CRT;"Printing Results to your printer" 1210 PRINT 1220 PRINT "Statistics is ";St$,"SendValid is ";Sv$ 1230 PRINT 1240 PRINT "First value is ";R(1) 1250 PRINT "Second value is ";R(2) 1260 PRINT "Third value is ";R(3) 1270 PRINT "Fourth value is ";R(4) 1280 PRINT "Fifth value is ";R(5) 1290 PRINT "Sixth value is ";R(6) 1300 PRINT "Seventh value is ";R(7) 1310 WAIT 5 1320 CLEAR SCREEN 1330 NEXT C 1340 PRINTER IS CRT 1350 SUBEND