2-31
Sample Programs
BASIC Programming Examples
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
1740 PRINT "Period is ";Period
1750 PRINT
1760 ELSE
1770 PRINT
1780 PRINT "Automated period measurement error";Period
1790 PRINT
1800 END IF
1810 SUBEND
1820 !
1830 !
1840 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1850 !
1860 !
1870 ! Subprogram name: Transfer_data
1880 ! Parameters: none
1890 ! Return value: none
1900 ! Description: This routine transfers the waveform data and conversion factors to
1910 ! to PC.
1920 !
1930 !
1940 SUB Transfer_data
1950 COM /Io/@Scope,@Path,Interface
1960 COM /Raw_data/ INTEGER Data(4095)
1970 COM /Converted_data/ REAL Time(4095),Volts(4095)
1980 COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg