Siemens S7-1200 System Manual page 333

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Adding new hardware interrupt OB code blocks to your program
By default, no OB is attached to an event when the event is first enabled. This is indicated by
the "HW interrupt:" device configuration "<not connected>" label. Only hardware-interrupt
OBs can be attached to a hardware interrupt event. All existing hardware-interrupt OBs
appear in the "HW interrupt:" drop-down list. If no OB is listed, then you must create an OB
of type "Hardware interrupt" as follows. Under the project tree "Program blocks" branch:
1. Double-click "Add new block", select "Organization block (OB)" and choose "Hardware
2. Optionally, you can rename the OB, select the programming language (LAD, FBD or
3. Edit the OB and add the programmed reaction that you want to execute when the event
OB_NR parameter
All existing hardware-interrupt OB names appear in the device configuration "HW interrupt:"
drop-down list and in the ATTACH / DETACH parameter OB_NR drop-list.
EVENT parameter
When a hardware interrupt event is enabled, a unique default event name is assigned to this
particular event. You can change this event name by editing the "Event name:" edit box, but
it must be a unique name. These event names become tag names in the "Constants" tag
table, and appear on the EVENT parameter drop-down list for the ATTACH and DETACH
instruction boxes. The value of the tag is an internal number used to identify the event.
General operation
Each hardware event can be attached to a hardware-interrupt OB which will be queued for
execution when the hardware interrupt event occurs. The OB-event attachment can occur at
configuration time or at run time.
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.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
interrupt".
SCL), and select the block number (switch to manual and choose a different block
number than that suggested).
occurs. You can call FCs and FBs from this OB, to a nesting depth of six.
Extended instructions
8.4 Interrupts
333

Advertisement

Table of Contents
loading

Table of Contents