Section 10 Program Examples
10-6
(4) Reading memory data
Shown below is an example of a program that reads the main data of the measured waveform. In this example,
the main data is read from memory A. The program for reading the main data from memory B is similar to this
program. In this example, binary data is converted to numeric data with DMA? contrasted with DBA?.
70 DIM DT (500), D 0 (i500), D 1(1001), D (500)
80 DIM L $ ∗10
90 !
100 WRITE @108 : “DMA ?”
110 FOR I = 0 TO 500
120 READ @108 : FDT( I )
130 NEXT I
140 !
150 WRITE @108 : “LVS ?”
160 READ @108 : L $
170 PRINT “LEVEL SCALE =” : L $
180 IF L $ = “LOG” THEN
190 WRITE @108 : “DBA?”
200 MAT READ @108 USING “WH” : D 0
210 !
220 FOR I = 0 TO 500
230 LET D ( I ) = D 0 ( i ) /100
240 NEXT I
250 !
260 ELSE
270 WRITE @108 : “DBA?”
280 MAT READ @108 USING “WH” : D 1
290 !
300 FOR I = 0 TO 500
310 LET D ( I ) = D 1 ( 2∗I +1 )/10000∗10ˆD 1 ( 2∗I )
320 NEXT I
330 !
340 END IF
Lines 70 to 80: Define arrays and character strings.
Lines 100 to 130: Read data (ASCN data) with a DMA? command.
Lines 150 to 180: Check the current level scale.
Lines 190 to 200: Read binary data when a log scale is selected.
Lines 220 to 240: Convert binary data to numeric data when a log scale is selected.
Lines 270 to 280: Read binary data when a linear scale is selected.
Lines 300 to 320: Convert binary data to numeric data when a linear scale is selected.