Sets/Clears the InterruptMask Bit.
SetInterruptMask ( enInterrupt, bSet )
The SetInterruptMask procedure syntax has the following parts:
Name |
Type |
Description |
enInterrupt |
Val enumAInterrupts |
An integer specifying the INT_xxx interrupt constant. |
bSet |
Bool |
A boolean expression specifying whether the procedure should set or clear the InterruptMask bit. |
enumAInterrupts can be one of the following values:
Name |
Value |
Description |
INT_TIMER1 |
10 |
TIMER1 Interrupt. The interval expired. |
INT_TIMER2 |
11 |
TIMER2 Interrupt. The interval expired. |
INT_COM1 |
12 |
COM1 Interrupt. Bytes were received. |
INT_COM2 |
13 |
COM2 Interrupt. Bytes were received. |
INT_COM3 |
14 |
COM3 Interrupt. Bytes were received. |
INT_COM4 |
15 |
COM4 Interrupt. Bytes were received. |
INT_COM5 |
16 |
COM5 Interrupt. Bytes were received. |
INT_COM6 |
17 |
COM6 Interrupt. Bytes were received. |
INT_COM7 |
18 |
COM7 Interrupt. Bytes were received. |
INT_COM8 |
19 |
COM8 Interrupt. Bytes were received. |
INT_COM9 |
20 |
COM9 Interrupt. Bytes were received. |
INT_GPIB1 |
22 |
GPIB1 Interrupt. An SRQ signal was received. |
INT_GPIB2 |
23 |
GPIB2 Interrupt. An SRQ signal was received. |
INT_USER1 |
24 |
USER1 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
INT_USER2 |
25 |
USER2 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
INT_USER3 |
26 |
USER3 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
INT_USER4 |
27 |
USER4 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
INT_USER5 |
28 |
USER5 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
INT_USER6 |
29 |
USER6 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
INT_USER7 |
30 |
USER7 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
INT_USER8 |
31 |
USER8 Interrupt. A user-defined interrupt. Set a bit in the interrupt mask to high and the interrupt will be called. |
bSet can have one of the following values:
Value |
Description |
True |
Set the InterruptMask bit on. |
False * |
Set the InterruptMask bit off (clear). |
Some of the GPIB boards or Drivers (GPIBxxx.DLL) do not support, or are not configured to support, interrupts.
During interrupt subroutine execution, interrupts are disabled until control returns from the interrupt subroutine. When executing Doit!/Loopit! code, interrupts are disabled.
Calling EnableInterrupt/DisableInterrupt or masking interrupts inside an interrupt subroutine will take place only on return. Re-enabling (Disable and Enable) of the current interrupt number handler during Interrupt sub is not allowed (only Disable is allowed). Re-enabling of other interrupt numbers is allowed.
Interrupts are serviced (called) according to their priority number. The current priorities are:
TIMER1 (highest)
COM port
GPIB board
USER8
ATEasy subroutines are not re-entrant; if an interrupt occurs inside a subroutine, that interrupt subroutine must not call that subroutine again.
Calling EnableInterrupt clears (zeros) the corresponding enInterrupt bit in the InterruptMask variable. Interrupts can be invoked by using the command:
SetInterruptMask (INT_USER1, True)
This request can be cancelled by:
SetInterruptMask (INT_USER1, False)
i=0 ! Use i as interrupt counter
if EnableInterrupt(INT_USER1, 0, InterruptHandler) < 0
TestStatus=FAIL
else
while i<10 ! looks as a forever loop
SetInterruptMask (INT_USER1, True)
endwhile
DisableInterrupt(INT_USER1) ! free INT_USER1
TestStatus=PASS ! how did it get here??
endif