Extended instructions
9.5 Interrupts
S7-1200 Programmable controller
420 System Manual, V4.2, 09/2016, A5E02486680-AK
ATTACH and DETACH (Attach/detach an OB and an interrupt event)
instructions
You can activate and deactivate interrupt event-driven subprograms with the ATTACH and
DETACH instructions.
Table 9- 97 ATTACH and DETACH instructions
ob_nr:=_int_in_,
event:=_event_att_in_,
add:=_bool_in_);
ATTACH enables interrupt OB subprogram
execution for a hardware interrupt event.
ob_nr:=_int_in_,
event:=_event_att_ in);
DETACH disables interrupt OB subprogram
execution for a hardware interrupt event.
Table 9- 98 Data types for the parameters
OB_NR IN OB_ATT Organization block identifier: Select from the available hardware
interrupt OBs that were created using the "Add new block" feature.
Double-click on the parameter field, then click on the helper icon to
EVENT IN EVENT_ATT Event identifier: Select from the available hardware interrupt events
that were enabled in PLC device configuration for digital inputs or
high-speed counters. Double-click on the parameter field, then click
on the helper icon to see the available events.
ADD
(ATTACH only)
IN Bool
• ADD = 0 (default): This event replaces all previous event attach-
ments for this OB.
• ADD = 1: This event is added to previous event attachments for
this OB.