Agilent Technologies A.18.00 Weather Radio User Manual


 
319
Chapter 5, Advanced Operations
Passing Control
The following program would run in the External Controller:
10 COM /Gpib_names/ INTEGER Internal_gpib,Inst_address,Cntrl_state
20 COM /Cntrl_names/ Ext_cntrl_addrs,Int_cntrl_addrs
30 COM /Io_names/ INTEGER Printer_addrs,Pwr_suply_addrs
40 COM /Io_values/ REAL Meas_power,Prog_state$[80],Prog_name$[50]
50 COM /Reg_vals/ INTEGER Status_byte,Stdevnt_reg_val
60 !
70 Internal_gpib=7
80 Ext_cntrl_addrs=14
90 Int_cntrl_addrs=21
100 Printer_addrs=1
110 Pwr_suply_addrs=26
120 Inst_address=(Internal_gpib*100)+Ext_cntrl_addrs
130 Prog_name$="PASCTLEX:INTERNAL,4"
140 !
150 PRINTER IS CRT
160 !
170 ! Set the Controller up to respond to an SRQ from Test Set
180 ! The interrupt is generated by the Request Control bit in the Test Set
190 ON INTR Internal_gpib CALL Pass_control
200 ENABLE INTR Internal_gpib;2
210 !
220 ! Bring Test Set to known state.
230 OUTPUT Inst_address;"*RST"
240 !
250 ! Set the Test Set to cause SRQ interrupt on Request Control
260 OUTPUT Inst_address;"*CLS"
270 OUTPUT Inst_address;"*ESE 2"
280 OUTPUT Inst_address;"*SRE 32"
290 !
300 ! Load the desired program into the Test Set from Memory Card
305 OUTPUT Inst_address;"DISP TIB” ! Display the IBASIC screen
310 OUTPUT Inst_address;"PROG:EXEC 'DISP """&"Loading program."&"""'"
320 OUTPUT Inst_address;"PROG:EXEC 'GET """&Prog_name$&"""'"
330 OUTPUT Inst_address;"PROG:EXEC 'DISP """&""&"""'"
340 !
350 ! Run the program in the Test Set
360 OUTPUT Inst_address;"PROG:EXEC 'RUN'"
370 !
380 REPEAT
390 STATUS Internal_gpib,3;Cntrl_state
400 DISP "WAITING TO PASS CONTROL TO THE Test Set."
410 UNTIL NOT BIT(Cntrl_state,6)
420 !
430 REPEAT
440 STATUS Internal_gpib,3;Cntrl_state
450 DISP "WAITING FOR CONTROL BACK FROM THE Test Set"
460 UNTIL BIT(Cntrl_state,6)
470 !