Interrupt Instructions - Siemens Simatic S7-200 System Manual

Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Interrupt Instructions

Enable Interrupt and Disable Interrupt
The Enable Interrupt instruction (ENI) globally enables processing of
all attached interrupt events. The Disable Interrupt instruction (DISI)
globally disables processing of all interrupt events.
When you make the transition to RUN mode, interrupts are initially
disabled. In RUN mode, you can enable interrupt processing by
executing the Enable Interrupt instruction. Executing the Disable
Interrupt instruction inhibits the processing of interrupts; however,
active interrupt events will continue to be queued.
Error conditions that set ENO = 0:
H 0004 (attempted execution of ENI, DISI, or HDEF instructions in an
interrupt routine)
Conditional Return from Interrupt
The Conditional Return from Interrupt instruction (CRETI) can be
used to return from an interrupt, based upon the condition of the
preceding logic.
Attach Interrupt
The Attach Interrupt instruction (ATCH) associates an interrupt event
EVNT with an interrupt routine number INT and enables the interrupt
event.
Error conditions that set ENO = 0:
H 0002 (conflicting assignment of inputs to an HSC)
Detach Interrupt
The Detach Interrupt instruction (DTCH) disassociates an interrupt event EVNT from all interrupt routines
and disables the interrupt event.
Table 6-43
Valid Operands for the Attach Interrupt and Detach Interrupt Instructions
Inputs/Outputs
Data Types
INT
BYTE
EVNT
BYTE
Operation of the Attach Interrupt and Detach Interrupt Instructions
Before an interrupt routine can be invoked, an association must be established between the interrupt
event and the program segment that you want to execute when the event occurs. Use the Attach Interrupt
instruction to associate an interrupt event (specified by the interrupt event number) and the program
segment (specified by an interrupt routine number). You can attach multiple interrupt events to one
interrupt routine, but one event cannot be concurrently attached to multiple interrupt routines.
When you attach an interrupt event to an interrupt routine, that interrupt is automatically enabled. If you
disable all interrupts using the global disable interrupt instruction, each occurrence of the interrupt event is
queued until interrupts are re-enabled, using the global enable interrupt instruction, or the interrupt queue
overflows.
Operands
Constant (0 to 127)
Constant
CPU 221 and CPU 222:
CPU 224:
CPU 226 and CPU 226XM:
S7-200 Instruction Set
Chapter 6
0 to 12, 19 to 23, and 27 to 33
0 to 23 and 27 to 33
0 to 33
6
155

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents