Chapter 7 7-89
Programming Examples
List-Frequency and Limit-Test Table Examples
130 ABORT 7 ! Generate an IFC (Interface Clear)
140 CLEAR @Nwa ! SDC (Selective Device Clear)
150 OUTPUT @Nwa;”OPC?;PRES;” ! Preset the analyzer and wait
160 ENTER @Nwa;Reply ! Read the 1 when complete
170 !
180 ! Edit the list frequency table and set its type
190 ! LISTTYPE = LSTP (stepped list mode)
200 !
210 OUTPUT @Nwa;”EDITLIST;LISTTYPELSTP;”
220 !
230 OUTPUT @Nwa;”CLEL;” ! Clear the existing list frequencies
240 !
250 INPUT “Number of segments?”,Numb ! Read number of segments to define
260 ALLOCATE Table(1:Numb,1:3) ! Define an array for the list segments
270 !
280 PRINT USING “10A,15A,15A,20A”;”SEGMENT”,”START(MHZ)”,”STOP(MHZ)”,”NUMBER OF
POINTS”
290 !
300 FOR I=1 TO Numb ! Cycle through the segments and read in the values
310 GOSUB Loadpoin
320 NEXT I
330 !
340 LOOP
350 INPUT “DO YOU WANT TO EDIT? Y OR N”,An$
360 EXIT IF An$=”N”
370 INPUT “ENTRY NUMBER?”,I ! Get an entry number
380 GOSUB Loadpoin ! Go load point
390 END LOOP
400 !
410 OUTPUT @Nwa;”EDITLIST” ! Send the new list to the analyzer
420 FOR I=1 TO Numb ! Send one segment at a time
430 OUTPUT @Nwa;”SADD;” ! Add a segment
440 OUTPUT @Nwa;”STAR”;Table(I,1);”MHZ;” ! Start frequency
450 OUTPUT @Nwa;”STOP”;Table(I,2);”MHZ;” ! Stop frequency
460 OUTPUT @Nwa;”POIN”,Table(I,3),”;” ! Number of points
470 OUTPUT @Nwa;”SDON;” ! Segment done
480 NEXT I ! Next segment to send to the analyzer
490 !
500 OUTPUT @Nwa;”EDITDONE;” ! Done with list
510 OUTPUT @Nwa;”LISFREQ;” ! Set list frequency mode
520 !
530 OUTPUT @Nwa;”OPC?;WAIT;” ! Wait for analyzer to finish
540 ENTER @Nwa;Reply ! Read the 1 when complete
550 LOCAL @Nwa ! Release HP-IB control
560 STOP ! End of main program
580 ! ***************************Subroutines ******************************
590 !
600 Loadpoin: ! Sub to read in each segment value
610 INPUT “START FREQUENCY? (MHZ)”,Table(I,1) ! Read start frequency
620 INPUT “STOP FREQUENCY? (MHZ)”,Table(I,2) ! Read stop frequency
630 INPUT “NUMBER OF POINTS?”,Table(I,3) ! Read number of points in seg
640 IF Table(I,3)=1 THEN Table(I,2)=Table(I,1)! Single point same start stop
650 !
660 ! Print new segment into table on display
670 PRINT TABXY(0,I+1);I;TAB(10);Table(I,1);TAB(25);
680 PRINT Table(I,2);TAB(40),Table(I,3)
690 RETURN
700 END