User`s manual

194 Chapter 6
O:\Manuals\E6380A_Progguid\Book\Advoper.fm
Advanced Operations
Passing Control
620 COM /Reg_vals/ INTEGER Status_byte,Stdevnt_reg_val
630 !
640 OFF INTR Internal_hpib
650 Status_byte=SPOLL(Inst_address)
660 IF NOT BIT(Status_byte,5) THEN
670 PRINT "SRQ for unknown reason. Status Byte = ";Status_byte
680 STOP
690 END IF
700 !
710 ! Tell Test Set where to pass control back to
720 OUTPUT Inst_address;"*PCB";Int_cntrl_addrs
730 !
740 ! Put Test Set in LOCAL mode so front panel keys function
750 LOCAL Inst_address
760 !
770 PASS CONTROL Inst_address
780 !
790 ENABLE INTR Internal_hpib;2
800 !
810 SUBEND
The following IBASIC program would be loaded off the PC card and run
in the Test Set:
Example 6-112 Example
10 COM /Hpib_names/ INTEGER Internal_hpib,External_hpib
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
50 !
60 Internal_hpib=800
70 External_hpib=700
80 Ext_cntrl_addrs=21
90 Int_cntrl_addrs=14
100 Printer_addrs=1
110 Pwr_suply_addrs=26
120 !
130 OUTPUT Internal_hpib;"*RST"
140 CLEAR SCREEN
150 PRINTER IS CRT
160 !
170 EXECUTE ("REQUEST_CONTROL")
180 !
190 Try_again: !
200 ON ERROR GOTO Not_actve_cntrl
210 DISP "WAITING TO GET CONTROL"
220 OUTPUT External_hpib;"" !If OUTPUT successful then Active Controller
230 !If OUTPUT not successful then not Active Controller
240 DISP "TEST SET NOW ACTIVE CONTROLLER."
250 CALL Start_program
260 !
270 Pass_back: !
280 DISP "PASSING CONTROL BACK"
290 !Control is passed back automatically when the program stops
300 !Control is passed back to address specified by *PCB command
310 DISP "PROGRAM FINISHED"
320 STOP
330 !
340 Not_actve_cntrl: !
350 OFF ERROR
360 DISP "CHECKING FOR ERROR"
370 IF ERRN=173 THEN