Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-41
Sample Programs
Listings of the Sample Programs
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
1430 ENTER @Scope;Period_str$
1440 Bytes_read=LEN(Period_str$) !Find string length
1450 IF Period_str$[Bytes_read;1]="0" THEN !Determine result value
1460 PRINT
1470 PRINT "Period is ";VAL(Period_str$[1,Bytes_read-1])
1480 PRINT
1490 ELSE
1500 PRINT
1510 PRINT "Automated period measurement error with result ";Period_str$[Bytes_read;1]
1520 PRINT
1530 END IF
1540 !
1550 !
1560 ! METHOD TWO
1570 !
1580 OUTPUT @Scope;":MEASure:SEND OFF" !turn off results
1590 OUTPUT @Scope;":MEASure:VPP? CHANnel1" !Query volts peak-to-peak
1600 ENTER @Scope;Vpp
1610 IF Vpp<9.99E+37 THEN
1620 PRINT
1630 PRINT "VPP is ";Vpp
1640 PRINT
1650 ELSE
1660 PRINT
1670 PRINT "Automated vpp measurement error ";Vpp
1680 PRINT
1690 END IF
1700 OUTPUT @Scope;":MEASure:PERiod? CHANnel1"
1710 ENTER @Scope;Period
1720 IF Freq<9.99E+37 THEN
1730 PRINT