Control LCD Update Timing

Other topics about Sample Programs

Overview

This sample program is provided in this section where the command processing time is improved by controlling the update timing of the LCD display.

This program sets the necessary measurement conditions and then turns OFF the updating of the LCD display. Next, it performs measurement, reads out the result, and updates the screen once. This program repeats this measurement procedure ten times.

See Improving Command Processing Speed for this programming.

Sample Program in HT Basic (cont_upd.htb)

10 REAL Trace1(1:201,1:2),Trace2(1:201,1:2)

20 DIM Buff$[9],Img$[30]

30 INTEGER Nop,I

40 !

50 ASSIGN @Agte507x TO 717

60 ASSIGN @Binary TO 717;FORMAT OFF

70 !

80 OUTPUT @Agte507x;":SENS1:SWE:TYPE LIN"

90 OUTPUT @Agte507x;":SENS1:FREQ:CENT 950E6"

100 OUTPUT @Agte507x;":SENS1:FREQ:SPAN 100E6"

110 OUTPUT @Agte507x;":SENS1:SWE:POIN 201"

120 OUTPUT @Agte507x;":TRIG:SOUR BUS"

130 OUTPUT @Agte507x;":INIT1:CONT ON"

140 FOR I=2 TO 9

150 OUTPUT @Agte507x;":INIT"&VAL$(I)&":CONT OFF"

160 NEXT I

170 !

180 OUTPUT @Agte507x;":DISP:SPL D1"

190 OUTPUT @Agte507x;":DISP:WIND1:SPL D1_2"

200 !

210 OUTPUT @Agte507x;":CALC1:PAR:COUN 2"

220 OUTPUT @Agte507x;":CALC1:PAR1:DEF S21"

230 OUTPUT @Agte507x;":CALC1:PAR1:SEL"

240 OUTPUT @Agte507x;":CALC1:FORM MLOG"

250 OUTPUT @Agte507x;":CALC1:PAR2:DEF S11"

260 OUTPUT @Agte507x;":CALC1:PAR2:SEL"

270 OUTPUT @Agte507x;":CALC1:FORM MLOG"

280 !

290 OUTPUT @Agte507x;":DISP:ENAB OFF"

300 OUTPUT @Agte507x;":FORM:DATA REAL"

310 !

320 FOR I=1 TO 10

330 OUTPUT @Agte507x;":TRIG:SING"

340 OUTPUT @Agte507x;"*OPC?"

350 ENTER @Agte507x;Buff$

360 !

370 ! Read Trace Data

380 !

390 OUTPUT @Agte507x;":CALC1:PAR1:SEL"

400 OUTPUT @Agte507x;":CALC1:DATA:FDAT?"

410 ENTER @Agte507x USING "#,8A";Buff$

420 ENTER @Binary;Trace1(*)

430 ENTER @Agte507x USING "#,1A";Buff$

440 !

450 OUTPUT @Agte507x;":CALC1:PAR2:SEL"

460 OUTPUT @Agte507x;":CALC1:DATA:FDAT?"

470 ENTER @Agte507x USING "#,8A";Buff$

480 ENTER @Binary;Trace2(*)

490 ENTER @Agte507x USING "#,1A";Buff$

500 !

510 ! Update Display

520 !

530 OUTPUT @Agte507x;":DISP:UPD"

540 NEXT I

550 END

Description

Lines 50 to 60

Assigns a GPIB address to the I/O pass.

Lines 80 to 110

These lines set the sweep type to linear sweep, the sweep center value to 950 MHz, the sweep span value to 100 MHz, and the number of measurement points to 201.

Lines 120 to 160

These lines set the trigger source to bus trigger, turn on Continuous Activation mode for channel 1, and turn the mode off for channels 2 through 9.

Lines 180 to 190

These lines display the window for channel 1 only and arrange two graphs tiled horizontally.

Lines 210 to 270

These lines set the number of traces for channel 1 to 2, the measurement parameter and its data format for trace 1 to S21 and Log Mag, respectively, and those for trace 2 to S11 and Log Mag, respectively.

Line 290

This line turns Off the updating of the LCD screen.

Line 300

This line sets the data transfer format to binary.

Lines 320 to 540

These lines repeat the following procedure ten times.

Lines 340 to 360: These lines trigger the instrument and wait until the measurement cycle finishes.

Lines 400 to 440: Reads out the formatted data array of trace 1 in channel 1.

Lines 460 to 500: Reads out the formatted data array of trace 2 in channel 1.

Line 540: This line updates the LCD screen once.