Chapter 7 7-11
Programming Examples
Measurement Setup Examples
BASIC Program Listing
10 ! This program demonstrates setup of various measurement parameters such
20 ! as start frequency, stop frequency, etc. The program first selects one
30 ! type of measurement to be viewed using dual-channel display format.
40 ! The specified start and stop frequencies are then programmed and the
50 ! analyzer display is autoscaled. The program concludes by displaying
60 ! four types of measurements simultaneously.
70 !
80 ! EXAMP1A
90 !
100 ASSIGN @Nwa TO 716 ! Assign an I/O path for the analyzer
110 !
120 CLEAR SCREEN
130 ! Initialize the system
140 ABORT 7 ! Generate an IFC (Interface Clear)
150 CLEAR @Nwa ! SDC (Selected Device Clear) analyzer
160 OUTPUT @Nwa;”OPC?;PRES;” ! Preset the analyzer and wait
170 ENTER @Nwa;Reply ! Read in the 1 returned
180 !
190 ! Set up measurement and display
200 OUTPUT @Nwa;”CHAN1;” ! Channel 1
210 OUTPUT @Nwa;”AUXCOFF;” ! Turn off auxiliary channel, if it is on
220 OUTPUT @Nwa;”S11;” ! Return Loss (Reflection) measurement
230 OUTPUT @Nwa;”LOGM;” ! Log magnitude display
240 !
250 OUTPUT @Nwa;”CHAN2;” ! Channel 2
260 OUTPUT @Nwa;”AUXCOFF;” ! Turn off auxiliary channel, if it is on
270 OUTPUT @Nwa;”S11;” ! Return Loss (Reflection) measurement
280 OUTPUT @Nwa;”PHAS;” ! Phase display
290 !
300 OUTPUT @Nwa;”DUACON;” ! Dual channel display
310 !
320 ! Request start and stop frequency
330 INPUT “ENTER START FREQUENCY (MHz):”,F_start
340 INPUT “ENTER STOP FREQUENCY (MHz):”,F_stop
350 !
360 ! Program the analyzer settings
370 OUTPUT @Nwa;”STAR”;F_start;”MHZ;” ! Set the start frequency
380 OUTPUT @Nwa;”STOP”;F_stop;”MHZ;” ! Set the stop frequency
390 !
400 ! Autoscale the displays
410 OUTPUT @Nwa;”CHAN1;AUTO;” ! Autoscale channel 1 display
420 OUTPUT @Nwa;”CHAN2;AUTO;” ! Autoscale channel 2 display
430 !
440 PRINT “The display should now be autoscaled.”
450 INPUT “Press RETURN to view four types of measurements simultaneously”,X
460 !
470 OUTPUT @Nwa;”CHAN1;AUXCON;” ! Turn on auxiliary channel (Channel 3)
480 OUTPUT @Nwa;”CHAN2;AUXCON;” ! Turn on auxiliary channel (Channel 4)
490 !
500 ! Channel 2 Insertion Loss (Transmission) measurement
510 OUTPUT @Nwa;”S21;”
520 OUTPUT @Nwa;”LOGM;AUTO;” ! Channel 2 log magnitude and autoscale
530 !
540 ! Channel 3 Reflected Power measurement
550 OUTPUT @Nwa;”CHAN3;MEASA;”
560 OUTPUT @Nwa;”LOGM;AUTO;” ! Channel 3 log magnitude and autoscale