Agilent Technologies A.18.00 Weather Radio User Manual


 
531
Chapter 8, Programming the Call Processing Subsystem
Example Programs
500 Print_error
510 END IF
520 IF NOT FNSet_state("Release") THEN CALL Print_error
530 PRINT "Program completed."
540 END
1000 Cnfg_stat_reg: SUB Cnfg_stat_reg
1010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
1020 OUTPUT Inst_addr;"*RST;*CLS;*SRE 0;STAT:CALLP:PTR 0;NTR 0;*OPC?"
1030 ON TIMEOUT Bus_addr,10 GOTO Cnfg_failed
1040 ENTER Inst_addr;Cnfg_complete
1050 OFF TIMEOUT Bus_addr
1060 SUBEXIT
1070 Cnfg_failed: BEEP
1080 PRINT "Cnfg_stat_reg SUB timed out on *OPC? query."
1090 STOP
1100 SUBEND
1110 !
2000 Cond_test_set: SUB Cond_test_set
2010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
2020 !**********************************************************************
2030 ! Prompt operator to make sure that no RF power is applied to the
2040 ! RF IN/OUT port when the power meter is zeroed.
2050 !**********************************************************************
2060 OUTPUT Inst_addr;"DISP RFAN;:RFAN:PME:ZERO"
2070 OUTPUT Inst_addr;"DISP CONF;:CONF:NOTC ’AFGEN1’"
2080 SUBEND
2090 !
3000 Cnfg_base_sta: DEF FNCnfg_base_sta(INTEGER Cch,Vmac,Vch,Sid,Sat,REAL Ampl,Sys$)
3010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
3020 COM /Prog_control/ INTEGER Wait_time,Oper_complete
3021 INTEGER Ptr_value,Call_proc_even
3030 OUTPUT Inst_addr;"CALLP:AMPL "&VAL$(Ampl)&" DBM;SID "&VAL$(Sid)
3040 OUTPUT Inst_addr;"CALLP:VCH "&VAL$(Vch)
3050 OUTPUT Inst_addr;"CALLP:SAT ’"&VAL$(Sat)&"HZ"&"’;VMAC "&VAL$(Vmac)
3060 OUTPUT Inst_addr;"STAT:CALLP:PTR 1;:CALLP:CCH "&VAL$(Cch)
3070 GOSUB Wait_loop
3100 OUTPUT Inst_addr;"CALLP:CSYS ’"&Sys$&"’"
3110 GOSUB Wait_loop
3120 IF Oper_complete THEN
3130 RETURN 0
3140 ELSE
3150 RETURN 1
3160 END IF
3170 Wait_loop: LOOP
3180 WAIT Wait_time
3190 OUTPUT Inst_addr;"*ESR?;STAT:CALLP:EVEN?"
3200 ENTER Inst_addr;Std_event,Call_proc_even
3210 IF Std_event THEN RETURN Oper_complete=0
3250 IF BIT(Call_proc_even,LOG(1)/LOG(2)) THEN RETURN Oper_complete=1
3281 END LOOP