Agilent Technologies 1660AS TV Converter Box User Manual


 
Using Sub-routines in a measurement program
This program example shows a measurement example using sub-routines in
HP BASIC. The tasks perfumed in this example are:
Initializing the interface and the oscilloscope
Digitizing the acquired signal data
Measuring and printing the frequency and peak-to-peak voltage of the
acquired signal.
10 ! Measurement Example Using Sub-routines
20 !
30 !MAIN PROGRAM
40 !
50 CLEAR SCREEN
60 PRINT "This example program will perform the following tasks:"
70 PRINT " a. initialize the interface and oscilloscope"
80 PRINT " b. digitize the signal "
90 PRINT " c. measure and print the frequency "
100 PRINT
110 PRINT "The program assumes the system is configured as:"
120 PRINT " GPIB address = 7"
130 PRINT " Oscilloscope address = 7"
140 PRINT " Oscilloscope card is in slot 2"
150 PRINT " Signal attached to channel 1"
160 PRINT
170 PRINT "If the addresses are not correct for your configuration, change"
180 PRINT "the ASSIGN statements in the Initialize function."
190 PRINT
200 PRINT "Press Continue when ready to start program, or Shift/Break to
terminate."
210 PAUSE
220 GOSUB Initialize !initialize interface and oscilloscope
230 GOSUB Get_waveform !digitize signal
240 GOSUB Measure !measure and print frequency
250 STOP
260 !
270 !INITIALIZE INTERFACE AND OSCILLOSCOPE
280 !
290 Initialize:
300 ASSIGN @Scope TO 707 !System address
310 ASSIGN @Isc TO 7 !GPIB address
Programming Examples
Using Sub-routines in a measurement program
36–33