K1: Mode group, channel, program operation, reset response
9.10 Asynchronous subroutines (ASUBs), interrupt routines
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
601
9.10.3
Programming
Assignment Interrupt signal ↔ part program
The assignment interrupt signal ↔ part program is done with the command
SETINT
.
Example
Together with
SETINT
additionally the following commands can be programmed:
•
LIFTFAST
When the interrupt signal arrives, a "Fast retraction of the tool from the contour" is executed before the
interrupt routine starts. The motion direction for the fast retraction is specified by the program instruction
ALF
.
•
BLSYNC
Upon receiving the interrupt signal, the current program block is processed and only then is the interrupt
routine started.
Priorities
If several
SETINT
instructions are in the part program and therefore several signals can be simultaneously
received, the assigned interrupt routines must be allocated priorities that define the sequence in which the
interrupt routines are executed:
PRIO=<value>
There are priorities from 1 to 128. Priority 1 corresponds to the highest priority.
Example
The interrupt routines are executed in the sequence of the priority values if the inputs become available
simultaneously (are energized simultaneously): First "ABHEBEN_Z", then "ABHEBEN_X".
Program code
Comment
...
N20 SETINT(3) ABHEBEN_Z
;
If input 3 switches, then interrupt routine
"ABHEB_Z" should start.
...
Note
The assignment interrupt signal ↔ part program is cleared when the following happens:
• Channel in Reset state
•
CLRINT
instruction in part program
Program code
Comment
...
N20 SETINT(3) PRIO=2 ABHEBEN_Z
;
If input 3 switches, then interrupt routine
"ABHEB_Z" should start.
N30 SETINT(2) PRIO=2 ABHEBEN_X
;
If input 2 switches, then interrupt routine
"ABHEB_X" should start.
...