101BExtended instructions
8.4 Interrupts
S7-1200 Programmable controller
276
System Manual, 11/2011, A5E02486680-05
You have the option to attach or detach an OB to an enabled event at configuration time. To
attach an OB to an event at configuration time, you must use the "HW interrupt:" drop-down
list (click on the down arrow on the right) and select an OB from the list of available
hardware-interrupt OBs. Select the appropriate OB name from this list, or select "<not
connected>" to remove the attachment.
You can also attach or detach an enabled hardware interrupt event during run time. Use the
ATTACH or DETACH program instructions during run time (multiple times if you wish) to
attach or detach an enabled interrupt event to the appropriate OB. If no OB is currently
attached (either from a "<not connected>" selection in device configuration, or as a result of
executing a DETACH instruction), the enabled hardware interrupt event is ignored.
DETACH operation
Use the DETACH instruction to detach either a particular event or all events from a particular
OB. If an EVENT is specified, then only this one event is detached from the specified
OB_NR; any other events currently attached to this OB_NR will remain attached. If no
EVENT is specified, then all events currently attached to OB_NR will be detached.
Condition codes
Table 8- 88 Condition codes
RET_VAL (W#16#....)
ENO
Description
0000
1
No error
0001
1
Nothing to Detach (DETACH only)
8090
0
OB does not exist
8091
0
OB is wrong type
8093
0
Event does not exist
8.4.2
Cyclic interrupts
8.4.2.1
SET_CINT (Set cyclic interrupt)
Table 8- 89 SET_CINT (Set cyclic interrupt instruction)
LAD / FBD
SCL
Description
ret_val := SET_CINT(
ob_nr:=_int_in_,
cycle:=_udint_in_,
phase:=_udint_in_);
Set the specified interrupt OB to begin cyclic execution
that interrupts the program scan.