Agilent Technologies A.18.00 Weather Radio User Manual


 
533
Chapter 8, Programming the Call Processing Subsystem
Example Programs
6000 Order: DEF FNOrder(Order$,INTEGER Parm)
6010 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
6020 COM /Prog_control/ INTEGER Std_event,Wait_time
6030 INTEGER Ptr_value,Call_proc_even
6040 SELECT Order$
6050 CASE "Power"
6060 Ptr_value=32
6070 OUTPUT Inst_addr;"STAT:CALLP:PTR "&VAL$(Ptr_value)
6080 OUTPUT Inst_addr;"CALLP:ORD ’CHNG PL "&VAL$(Parm)&"’"
6090 CASE "Mainten"
6100 Ptr_value=16
6110 OUTPUT Inst_addr;"STAT:CALLP:PTR "&VAL$(Ptr_value)
6120 OUTPUT Inst_addr;"CALLP:ORD ’MAINTEN’"
6130 CASE "Alert"
6140 Ptr_value=32
6150 OUTPUT Inst_addr;"STAT:CALLP:PTR "&VAL$(Ptr_value)
6160 OUTPUT Inst_addr;"CALLP:ORD ’ALERT’"
6170 END SELECT
6180 LOOP
6190 WAIT Wait_time
6200 OUTPUT Inst_addr;"*ESR?;STAT:CALLP:EVEN?"
6210 ENTER Inst_addr;Std_event,Call_proc_even
6220 IF Std_event THEN RETURN 0
6230 IF BIT(Call_proc_even,LOG(Ptr_value)/LOG(2)) THEN RETURN 1
6240 END LOOP
6250 FNEND
6260 !
7000 Print_error: SUB Print_error
7010 OPTION BASE 1
7020 COM /Io_addresses/ INTEGER Inst_addr,Bus_addr
7030 COM /Prog_control/ INTEGER Std_event,Wait_time
7040 INTEGER N
7050 DIM Error_message$[255],Error$(5)[20]
7060 Error$(2)="Query"
7070 Error$(3)="Device Dependent"
7080 Error$(4)="Execution"
7090 Error$(5)="Command"
7100 WAIT .1 !Allow time for Error Queue to be updated.
7110 FOR N=2 TO 5
7120 IF BIT(Std_event,N) THEN
7130 PRINT "A "&Error$(N)&" error has occurred."
7140 OUTPUT Inst_addr;"SYSTem:ERRor?"
7150 ENTER Inst_addr;Error_number,Error_message$
7160 PRINT Error_number,Error_message$
7170 END IF
7180 NEXT N