Agilent Technologies A.18.00 Weather Radio User Manual


 
524
S:\agilent\8920\8920b\PRGGUIDE\BOOK\CHAPTERS\callproc.fb
Chapter 8, Programming the Call Processing Subsystem
Example Programs
3080 ELSE
3090 Error_flag=0
3100 END IF
3110 IF BINAND(Status_byte,31) THEN
3120 BEEP
3130 PRINT "Error in SRQ process. Status Byte = ";Status_byte
3140 STOP
3150 END IF
3160 IF BIT(Status_byte,7) THEN ! Check for call processing state
3170 OUTPUT Inst_addr;"STAT:OPER:EVEN?;:STAT:CALLP:EVEN?"
3180 ENTER Inst_addr;Oper_event,Call_proc_event
3190 Oper_complete=1
3200 END IF
3210 ENABLE INTR Bus_addr;2
3220 SUBEND
3230 !
5000 Cnfg_base_sta:DEF FNCnfg_base_sta(Vmac,Vch,Sid,Sat,REAL Ampl,Sys$,INTEGER Cch)
5010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
5020 COM /Prog_control/ INTEGER Oper_complete,Wait_time,Error_flag
5030 OUTPUT Inst_addr;"CALLP:AMPL "&VAL$(Ampl)&" DBM;SID "&VAL$(Sid)
5040 OUTPUT Inst_addr;"CALLP:VCH "&VAL$(Vch)
5050 OUTPUT Inst_addr;"CALLP:SAT ’"&VAL$(Sat)&"HZ"&"’;VMAC "&VAL$(Vmac)
5060 OUTPUT Inst_addr;"STAT:CALLP:PTR 1;:CALLP:CCH "&VAL$(Cch)
5070 GOSUB Wait_loop
5080 IF Error_flag THEN RETURN 0
5090 Oper_complete=0
5100 Error_flag=0
5110 OUTPUT Inst_addr;"CALLP:CSYS ’"&Sys$&"’"
5120 GOSUB Wait_loop
5130 IF Error_flag THEN
5140 RETURN 0
5150 ELSE
5160 RETURN 1
5170 END IF
5180 Wait_loop: LOOP
5190 WAIT Wait_time
5200 EXIT IF Oper_complete OR Error_flag
5210 END LOOP
5220 RETURN
5230 FNEND
5240 !
6000 Set_state: DEF FNSet_state(State$)
6010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
6020 COM /Prog_control/ INTEGER Oper_complete,Wait_time,Error_flag
6030 INTEGER Ptr_value
6040 Oper_complete=0 !Initialize to zero at start of any state change
6050 Error_flag=0 !Initialize to zero at start of any state change
6060 SELECT State$
6070 CASE "Active"
6080 Ptr_value=1