

10 '   ******************************************************************
20 '   * Example program EXAM3.BAS                                      *
30 '   * 1-channel frequency response sweep                             *
40 '   * with readout of measured values and calc. of related curve     *
50 '   * Poin = Number of measured points                               *
60 '   * Setup for this example: EXAM3.SAC (Actual Setup Mode!)         *
70 '   ******************************************************************
80 '
90 UPL OUT "MMEM:LOAD:STAT 0,'C:\UPL\B10_EXAM\EXAM3.SAC'": 'load setup
100 '
110 Poin=50: '                  number of sweep points
120 DIM Result(Poin): '        dimension of results
130 DIM Calc(Poin): '          dimension of calculated values
140 UPL OUT "init:cont off": ' set single sweep
150 UPL OUT "init;*wai": '     trigger and wait for termination
160 UPL OUT "trac? trac1": '   ask for trace data channel 1
170 UPL BLOCKIN Result(1): '   read out of values beginning with index1
180 '  the results are now available in Result(1) to Result(Poin)
190 '  all values are in basic units eg in Volts for level measurements
200 '  all calculations have to consider this !
210 '  the grafical display of the UPL is independent !
220 '  calculation of a related curve - half the values gives -6 dB
230 FOR I=1 TO Poin
240 Calc(I)=Result(I)/2: '     divide measured values by 2
250 NEXT 
260 '  write the calculated values into the trace buffer
270 UPL BLOCKOUT Calc(1),Poin: '  beginning with Index 1 , Poin values
280 UPL OUT "trac trac1": '       write into trace buffer
290 PRINT "After switching back to UPL-graphic with F3 key the"
300 PRINT "calculated and the measured curve will be displayed"
310 PRINT "(Setup EXAM3.SAC stores the measured values in trace B)"
320 END 
