Programming with GPIB Commands
2-25 Programming Examples
MG369xC GPIB PM
PN: 10370-10374 Rev. F
2-65
The following program (1) receives entries from the keyboard to set initial frequency and step-size
parameters, and (2) activates the soft keys on the controller so that they can step the frequency up
or down.
20 ! PARAMETER ENTRY, SYZ, UP, AND DN COMMANDS
30 Address=705
40 CALL Iddev(Address,Model,Fmin,Fmax,Pmin,Pmax)
50 OFF KEY
60 DISP “ENTER FREQUENCY IN GHz”;
70 INPUT Freq
80 IF Freq>Fmax OR Freq<Fmin THEN
90 DISP “FREQUENCY OUT OF RANGE - ”;
100 GOTO 60
110 END IF
120 DISP “ENTER STEP SIZE IN GHz”;
130 INPUT Stepsize
140 IF Stepsize>Fmax-Fmin OR Stepsize<.000001 THEN
150 DISP “ILLEGAL STEP SIZE - ”;
160 GOTO 120
170 END IF
180 OUTPUT Address;"CF1";Freq;"GH SYZ";Stepsize;"GH"
190 ON KEY 0 LABEL “STEP” GOTO 300
200 ON KEY 5 LABEL “ UP ” GOTO 300
210 ON KEY 1 LABEL “STEP” GOTO 320
220 ON KEY 6 LABEL “DOWN” GOTO 320
230 ON KEY 2 LABEL “NEW ” GOTO 50
240 ON KEY 7 LABEL “FREQ” GOTO 50
250 GOTO 250
300 OUTPUT Address;"UP"
310 GOTO 250
320 OUTPUT Address;"DN"
330 GOTO 250
340 END
1010 SUB Iddev(Address,Model,Fmin,Fmax,Pmin,Pmax)
1020 DIM Ident$[36]
1030 OUTPUT Address;"OI"
1040 ENTER Address;Ident$
1050 Model=VAL(Ident$[1,2])
1060 Model Number=VAL(Ident$[3,4])
1070 Fmin=VAL(Ident$[5,9])
1080 Fmax=VAL(Ident$[10,14])
1090 Pmin=VAL(Ident$[15,20])
1100 Pmax=VAL(Ident$[21,24])
1110 Model Prefix=Ident$[35,35]
1120 Series=VAL(Ident$[36])
1130 SUBEND
NOTE:
The program explanation is on the next page.
Figure 2-19.
Controlling CW Frequency/Parameter Entries (1 of 2)
Summary of Contents for MG369 C Series
Page 2: ......
Page 6: ...Contents 4 PN 10370 10374 Rev F MG369xC GPIB PM ...
Page 262: ...A 34 PN 10370 10374 Rev F MG369xC GPIB PM ...
Page 264: ...Index 2 PN 10370 10374 Rev F MG369xC GPIB PM ...
Page 265: ......