Agilent Technologies A.18.00 Weather Radio User Manual


 
534
S:\agilent\8920\8920b\PRGGUIDE\BOOK\CHAPTERS\callproc.fb
Chapter 8, Programming the Call Processing Subsystem
Example Programs
7190 IF BINAND(Std_event,195) THEN
7200 BEEP
7210 PRINT "Unrecognized condition. Standard Event register = ";Std_event
7220 END IF
7230 STOP
7240 SUBEND
7250 !
10000 Meas_carrier: SUB Meas_carrier
10010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
10015 ON TIMEOUT Bus_addr,5 RECOVER Timed_out
10020 OUTPUT Inst_addr;"DISP ACNT;:CALLP:MODE ’MEAS’;:MEAS:RFR:POW?;FREQ:ERR?"
10030 ENTER Inst_addr;Power,Freq_error
10040 OUTPUT Inst_addr;"MEAS:AFR:FREQ?;FM?"
10050 ENTER Inst_addr;Audiofreq,Deviation
10060 PRINT USING "K,2D.3D,K";"Carrier Power = ";Power;" Watts"
10070 PRINT USING "K,2D.3D,K";"Audio Frequency = ";Audiofreq/1000;" kHz"
10080 PRINT USING "K,2D.3D,K";"FM Deviation = ";Deviation/1000;" kHz"
10090 PRINT USING "K,2D.3D,K";"Carrier Freq Error = ";Freq_error/1000;" kHz"
10100 SUBEXIT
10110 Timed_out:!
10120 ON TIMEOUT Bus_addr,5 GOTO Cannot_recover
10130 CLEAR Inst_addr
10140 OUTPUT Inst_addr;"trig:abort;mode:retr:rep"
10150 DISP "you should have the box back."
10160 ENABLE
10170 Cannot_recover:!
10180 DISP "Cannot regain control of the Test Set."
10190 STOP
10200 SUBEND
10210 !
11010 Meas_sinad: SUB Meas_sinad
11020 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
11030 INTEGER N
11035 ON TIMEOUT Bus_addr,5 RECOVER Timed_out
11040 OUTPUT Inst_addr;"DISP CME;:AFG1:DEST ’FM’;FREQ 1KHZ;FM 8KHZ;FM:STAT ON"
11050 OUTPUT Inst_addr;"AFAN:INP ’AUDIO IN’;DEMP ’OFF’;DET ’RMS’"
11060 OUTPUT Inst_addr;"AFAN:FILT1 ’C MESSAGE’;FILT2 ’>99KHZ LP’"
11070 OUTPUT Inst_addr;"MEAS:AFR:SEL ’SINAD’;:RFG:AMPL -116DBM"
11080 OUTPUT Inst_addr;"TRIG:MODE:RETR SINGLE;SETT FULL"
11090 Avg_sinad=0
11100 FOR N=1 TO 5
11110 OUTPUT Inst_addr;"TRIG;:MEAS:AFR:SINAD?"
11120 ENTER Inst_addr;Sinad
11130 Avg_sinad=Avg_sinad+Sinad
11140 NEXT N
11150 PRINT USING "K,3D.2D,K";"SINAD = ";Avg_sinad/N;" dB at -116 dBm."
11160 OUTPUT Inst_addr;"TRIG:MODE:RETR REP;SETT FULL"
11170 OUTPUT Inst_addr;"RFG:AMPL -47DBM;:DISP ACNT"
11180 SUBEXIT