Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-42
Sample Programs
Listings of the Sample Programs
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
1990 COM /Variables/ INTEGER Record_length
2000 ! define waveform data source and format
2010 OUTPUT @Scope;":WAVeform:SOURce CHANnel1"
2020 OUTPUT @Scope;":WAVeform:FORMat WORD"
2030 ! request values needed to convert raw data to real
2040 OUTPUT @Scope;":WAVeform:XINCrement?"
2050 ENTER @Scope;Xinc
2060 OUTPUT @Scope;":WAVeform:XORigin?"
2070 ENTER @Scope;Xorg
2080 OUTPUT @Scope;":WAVeform:XREFerence?"
2090 ENTER @Scope;Xref
2100 OUTPUT @Scope;":WAVeform:YINCrement?"
2110 ENTER @Scope;Yinc
2120 OUTPUT @Scope;":WAVeform:YORigin?"
2130 ENTER @Scope;Yorg
2140 OUTPUT @Scope;":WAVeform:YREFerence?"
2150 ENTER @Scope;Yref
2160 !
2170 ! request data
2180 OUTPUT @Scope;":WAVeform:DATA?"
2190 ENTER @Scope USING "#,1A";First_chr$ !ignore leading #
2200 ENTER @Scope USING "#,1D";Header_length !input number of bytes in header value
2210 ENTER @Scope USING "#,"&VAL$(Header_length)&"D";Record_length !Record length in bytes
2220 Record_length=Record_length/2 !Record length in words
2230 ENTER @Scope USING "#,W";Data(*)
2240 ENTER @Scope USING "#,A";Term$ !Enter terminating character
2250 !
2260 SUBEND
2270 !
2280 !
2290 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!