Specifications

Chapter 6 129
Read and Write Measurement Data
Example Programs for Reading Internal Data Arrays
6. Read and Write
Measurement Data
Example Programs for Reading Internal Data Arrays
Reading the data trace array (ASCII format)
An example program for reading the data trace array is shown. In the program, the data
trace array is read in ASCII transfer format.
Example program using HTBasic
The program shown in Example 6-1 is saved under the filename asc_read.htb on the
sample programs disk. Below is an explanation of the program’s details.
Line 50 Sets the GPIB address
Lines 70 - 80 Substitutes variables for the trace number and measurement point.
Line 120 Resets the E4991A.
Lines 140 - 150 Turns on Trace 1 and sets the measurement point.
Lines 170 - 190 Sets the trigger source to the internal trigger and turns off the
continuous activation of the trigger system. Then, it resets the trigger
system, and sets the trigger sequence to the idle state.
Line 210 Calls the sub-program that executes a sweep.
Line 230 Executes auto-scale adjustment of the trace.
Line 250 Sets the data transfer format to ASCII transfer format.
Lines 270 - 300 Reads the data trace array and stimulus array.
Lines 340 - 570 Refer to “Example Programs for Detecting Measurement End” on
page 114 for an explanation of the sub-program.
Example 6-1 Reading the data trace array
10 DIM Meas_data(1:201),Swp_prm(1:201)
20 INTEGER Trc1,Nop
30 !
40 CLEAR SCREEN
50 ASSIGN @Agte4991a TO 717
60 !
70 Trc1=1
80 Nop=201
90 !
100 ! E4991A settings
110 !
120 OUTPUT @Agte4991a;"SYST:PRES"
130 !
140 OUTPUT @Agte4991a;"DISP:TRAC"&VAL$(Trc1)&" ON"
150 OUTPUT @Agte4991a;"SWE:POIN "&VAL$(Nop)
160 !
170 OUTPUT @Agte4991a;"TRIG:SOUR INT"
180 OUTPUT @Agte4991a;"INIT:CONT OFF"
190 OUTPUT @Agte4991a;"ABOR"
200 !
210 CALL Sweep(@Agte4991a)