Download HP 8924C Application Guide
Transcript
1230 COM /Io_names/ INTEGER Hardware1_reg,Srq_enab_reg,Status_byte,Event_reg 1240 ! 1250 !Turn off interrupts while processing the current interrupt. 1260 OFF INTR 7 1270 ! 1280 !Conduct a SERIAL POLL to read the Status Byte and clear the SRQ: 1290 ! 1300 Status_byte=SPOLL(Inst_address) 1310 ! 1320 ! Determine which Register Group(s) caused the interrupt. Since three 1330 ! were enabled, all three must be checked: 1340 ! 1350 IF BIT(Status_byte,5) THEN GOSUB Srvice_std_evnt 1360 IF BIT(Status_byte,3) THEN GOSUB Srvice_calib 1370 IF BIT(Status_byte,0) THEN GOSUB Srvice_hard1 1380 ! 1390 ! Re-enable the interrupt before leaving the service routine 1400 ! 1410 ENABLE INTR 7;2 1420 SUBEXIT 1430 ! 1440 Srvice_std_evnt:! 1450 ! This routine would determine which bit(s) in the Standard Event 1460 ! Status Register are TRUE, logic 1, and take appropriate action. 1470 ! NOTE: Read the Event Register to clear it. If the Event Register is 1480 ! not cleared it will NOT latch another event, thereby preventing 1490 ! the HP 8920B from generating another SRQ. 1500 ! 1510 OUTPUT Inst_address;"*ESR?" 1520 ENTER Inst_address;Event_reg 1530 RETURN 1540 ! 1550 Srvice_calib:! 1560 ! This routine would determine which bit(s) in the Calibration Status 1570 ! Register Group Event Register are TRUE, logic 1, and take 1580 ! appropriate action. 1590 ! NOTE: Read the Event Register to clear it. If the Event Register is 1600 ! not cleared it will NOT latch another event from the Condition 1610 ! Register, thereby preventing the HP 8920B from generating another SRQ. 1620 ! 1630 OUTPUT Inst_address;"STAT:CAL:EVEN?" 1640 ENTER Inst_address;Event_reg 1650 RETURN 1660 ! 1670 Srvice_hard1:! 1680 ! This routine would determine which bit(s) in the Hardware Status 1690 ! Register #1 Group Event Register are TRUE, logic 1, and take 1700 ! appropriate action. 1710 ! NOTE: Read the Event Register to clear it. If the Event Register is 1720 ! not cleared it will NOT latch another event from the Condition 1730 ! Register, thereby preventing the HP 8920B from generating another SRQ. 1740 ! 1750 OUTPUT Inst_address;"STAT:HARD1:EVEN?" 1760 ENTER Inst_address;Event_reg 1770 RETURN 1780 ! 1790 SUBEND 331 N:\mkt\MANUALS\HP8924C\APPMOD\BOOK\chapters\amsrq.fb Chapter 10 Controlling Program Flow Chapter 10, Controlling Program Flow Controlling Program Flow Procedure