
2-30
Sample Programs
BASIC Programming Examples
870 !
880 SUB Acquire_data
890 COM /Io/@Scope,@Path,Interface
900 OUTPUT @Scope;":DIGitize CHANnel1"
910 OUTPUT @Scope;":CHANnel1:DISPlay ON"
920 SUBEND
930 !
940 !
950 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
960 !
970 !
980 ! Subprogram name: Auto_msmts
990 ! Parameters: none
1000 ! Return value: none
1010 ! Description: This routine performs automatic measurements of volts peak-to-peak
1020 ! and frequency on the acquired data. It also demonstrates two methods
1030 ! of error detection when using automatic measurements.
1040 !
1050 !
1060 SUB Auto_msmts
1070 COM /Io/@Scope,@Path,Interface
1080 REAL Period,Vpp
1090 DIM Vpp_str$[64]
1100 DIM Period_str$[64]
1110 Bytes_read=0
1120 !
1130 ! Error checking on automatic measurements can be done using one of two methods.
1140 ! The first method requires that you turn on results in the Measurement subsystem
1150 ! using the command ":MEASure:SEND ON". When this is on, the scope will return the
1160 ! measurement and a result indicator. The result flag is zero if the measurement
1170 ! was successfully completed, otherwise a non-zero value is returned which indicates
1180 ! why the measurement failed. See the Programmer's Manual for descriptions of result
1190 ! indicators. The second method simply requires that you check the return value of
1200 ! the measurement. Any measurement not made successfully will return with the value
1210 ! +9.999e37. This could indicate that either the measurement was unable to be
1220 ! performed or that insufficient waveform data was available to make the measurement.
1230 !
1240 ! METHOD ONE
1250 !
1260 OUTPUT @Scope;":MEASure:SEND ON" !turn on results
1270 OUTPUT @Scope;":MEASure:VPP? CHANnel1" !Query volts peak-to-peak
1280 ENTER @Scope;Vpp_str$
1290 Bytes_read=LEN(Vpp_str$) !Find length of string
1300 CLEAR SCREEN
1310 IF Vpp_str$[Bytes_read;1]="0" THEN !Check result value
1320 PRINT
1330 PRINT "VPP is ";VAL(Vpp_str$[1,Bytes_read-1])
1340 PRINT
1350 ELSE
1360 PRINT
1370 PRINT "Automated vpp measurement error with result ";Vpp_str$[Bytes_read;1]
1380 PRINT
1390 END IF
1400 !
1410 !
1420 OUTPUT @Scope;":MEASure:PERiod? CHANnel1" !Query frequency
Содержание 86100A
Страница 18: ...1 14 Introduction Status Reporting Figure 1 4 Status Reporting Data Structures...
Страница 19: ...1 15 Introduction Status Reporting Status Reporting Data Structures continued...
Страница 94: ...2 40 Sample Programs BASIC Programming Examples...
Страница 124: ...4 16 Root Level Commands VIEW...
Страница 125: ...5 DATE 5 2 DSP 5 2 ERRor 5 3 HEADer 5 4 LONGform 5 5 MODE 5 6 SETup 5 7 TIME 5 7 System Commands...
Страница 132: ...5 8 System Commands TIME...
Страница 140: ...6 8 Acquire Commands SWAVeform RESet...
Страница 152: ...7 12 Calibration Commands STATus...
Страница 192: ...11 12 Display Commands SSAVer...
Страница 202: ...12 10 Function Commands VERTical RANGe...
Страница 203: ...13 AREA 13 2 DPRinter 13 2 FACTors 13 3 IMAGe 13 3 PRINters 13 4 Hardcopy Commands...
Страница 316: ...21 12 TDR TDT Commands Rev A 05 00 and Below STIMulus...
Страница 332: ......
Страница 353: ...26 DISPlay 26 2 LOAD 26 2 SAVE 26 3 XOFFset 26 3 XRANge 26 3 YOFFset 26 3 YRANge 26 4 Waveform Memory Commands...