532
S:\agilent\8920\8920b\PRGGUIDE\BOOK\CHAPTERS\callproc.fb
Chapter 8, Programming the Call Processing Subsystem
Example Programs
3290 FNEND
4000 Set_state: DEF FNSet_state(State$)
4010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
4020 COM /Prog_control/ INTEGER Std_event,Wait_time
4030 INTEGER Ptr_value,Call_proc_even
4040 SELECT State$
4050 CASE "Active"
4060 Ptr_value=1
4070 CASE "Register"
4080 Ptr_value=1
4090 CASE "Page"
4100 Ptr_value=32
4110 CASE "Handoff"
4120 Ptr_value=32
4130 CASE "Originate"
4140 Ptr_value=32
4150 CASE "Release"
4160 Ptr_value=1
4170 END SELECT
4180 IF State$="Originate" THEN
4190 OUTPUT Inst_addr;"STAT:CALLP:PTR "&VAL$(Ptr_value)
4200 ELSE
4210 OUTPUT Inst_addr;"STAT:CALLP:PTR "&VAL$(Ptr_value)&";:CALLP:"&State$
4220 END IF
4230 LOOP
4240 WAIT Wait_time
4250 OUTPUT Inst_addr;"*ESR?;STAT:CALLP:EVEN?"
4260 ENTER Inst_addr;Std_event,Call_proc_even
4270 IF Std_event THEN RETURN 0
4280 IF BIT(Call_proc_even,LOG(Ptr_value)/LOG(2)) THEN RETURN 1
4290 END LOOP
4300 FNEND
5010 Read_rcdd_data: SUB Read_rcdd_data(Fields$)
5020 OPTION BASE 1
5030 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
5040 COM /Prog_control/ INTEGER Std_event,Wait_time
5050 DIM Rcdd$(6)[40]
5060 INTEGER N
5070 WAIT .1!Allow time for RCDD data fields to be updated.
5080 FOR N=1 TO LEN(TRIM$(Fields$))
5090 OUTPUT Inst_addr;"CALLP:RCDD"&Fields$[N,N]&"?"
5100 ENTER Inst_addr;Rcdd$(N)
5110 PRINT "RCDD"&VAL$(N)&" = "&Rcdd$(N)
5120 NEXT N
5130 SUBEND
5140 !