2-28
Sample Programs
BASIC Programming Examples
BASIC Programming Examples
Listings of the BASIC sample programs in this section include:
General Measurement Example 2-28
Service Request Example 2-33
Learn String Example 2-36
General Measurement Example
File: init.bas
10 !file: init
20 !
30 !
40 ! This program demonstrates the order of commands suggested for operation of
50 ! the Agilent 86100 analyzer via GPIB. This program initializes the scope, acquires
60 ! data, performs automatic measurements, and transfers and stores the data on the
70 ! PC as time/voltage pairs in a comma-separated file format useful for spreadsheet
80 ! applications. It assumes an interface card at interface select code 7, an
90 ! Agilent 86100 scope at address 7, and the Agilent 86100 cal signal connected to Channel 1.
100 !
110 !
120 !
130 COM /Io/@Scope,@Path,Interface
140 COM /Raw_data/ INTEGER Data(4095)
150 COM /Converted_data/ REAL Time(4095),Volts(4095)
160 COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg
170 COM /Variables/ INTEGER Record_length
180 !
190 !
200 CALL Initialize
210 CALL Acquire_data
220 CALL Auto_msmts
230 CALL Transfer_data
240 CALL Convert_data
250 CALL Store_csv
260 CALL Close
270 END
280 !
290 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
300 !
310 !