

10 '  **************************************************************
20 '  *  Program example EXAM5.BAS                                 *
30 '  *  Readout of cursor values max and min                      *
40 '  *  1-channel frequency sweep level versus frequency          *
50 '  *  Setup for this example: EXAM5.SAC (Actual Setup Mode)     *
60 '  *  Attention requires firmware 2.05 or higher !              *
70 '  **************************************************************
80 '
90 Upl=20: '                           Bus-Address
100 IEC TERM 10: IEC TIME 10000: '      Terminator and timeout
110 IEC OUT Upl,"MMEM:LOAD:STAT 0,'C:\UPL\IEC_EXAM\EXAM5.SAC'"
120 IEC OUT Upl,"init:cont off;*WAI": '   single sweep
125 IEC OUT Upl,"SYST:BEEP:STAT ON": '    Dummycommand waits for WAI
130 IEC LAD Upl: IEC GTL : HOLD 1000: '   Show graphic
140 IEC OUT Upl,"disp:trac:curs:pos:mode min1": 'set cursor to min
150 IEC OUT Upl,"disp:trac:curs:data1?": 'ask for cursor data
160 IEC IN Upl,Wmin$: '                   read out of cursor data
170 IEC OUT Upl,"disp:trac:curs:data2?": 'ask for frequency value
180 IEC IN Upl,Fmin$: '                   read out of frequency
190 IEC OUT Upl,"disp:trac:curs:pos:mode max1": 'set cursor to max
200 IEC OUT Upl,"disp:trac:curs:data1?": 'ask for cursor data
210 IEC IN Upl,Wmax$: '                   read out of cursor data
220 IEC OUT Upl,"disp:trac:curs:data2?": 'ask for frequency value
230 IEC IN Upl,Fmax$: '                   read out of frequency
240 ' printout of results
250 PRINT "Fmin ";LEFT$(Fmin$,8);" Hz";TAB(20);" Wmin ";LEFT$(Wmin$,8);" dBV"
260 PRINT "Fmax ";LEFT$(Fmax$,8);" Hz";TAB(20);" Wmax ";LEFT$(Wmax$,8);" dBV"
270 '    with following line you can ask UPL for syntax errors (wo REM)
280 REM IEC OUT Upl,"syst:err?": IEC IN Upl,W$: PRINT W$
