Event Execution Priorities And Queuing - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

3.1.2

Event execution priorities and queuing

The CPU processing is controlled by events. The events trigger interrupt OBs to be
executed. The interrupt OB for an event is specified during the creation of the block, during
Device configuration or with an ATTACH or DETACH instruction. Some events happen on a
regular basis like the program cycle or cyclic events. Other events happen only a single time,
like the startup event and time delay events. Some events happen when there is a change
triggered by the hardware, such as an edge event on an input point or a high speed counter
event. There are also events like the diagnostic error and time error event which only happen
when there is an error. The event priorities, priority groups and queues are used to
determine the processing order for the event interrupt OBs.
The program cycle event happens once during each program cycle (or scan). During the
program cycle, the CPU writes the outputs, reads the inputs and executes program cycle
OBs. The program cycle event is required and is always enabled. You may have no program
cycle OBs, or you may have multiple OBs selected for the program cycle event. After the
program cycle event is triggered, the lowest numbered program cycle OB (usually OB1) is
executed. The other program cycle OBs are executed sequentially, in numerical order, within
the program cycle.
The cyclic interrupt events allows you to configure the execution of an interrupt OB at a
configured time interval. The time interval is configured when the OB is created and selected
to be a cyclic interrupt OB. The cyclic events will interrupt the program cycle and execute the
cyclic interrupt OB (the cyclic event is in a higher priority group than the program cycle
event). Only one cyclic interrupt OB can be attached to a cyclic event. The CPU supports
four cyclic interrupt events. The cyclic interrupt OBs have a phase shift property so that the
execution of cyclic interrupts with the same time period can be offset from one another by
the phase shift amount.
The startup event happens one time on a STOP to RUN transition and causes the startup
OBs to be executed. Multiple OBs can be selected for the startup event. The startup OBs are
executed in numerical order.
The time delay interrupt events allow you to configure the execution of an interrupt OB after
a specified delay time has expired. The delay time is specified with the SRT_DINT
instruction. The time delay events will interrupt the program cycle to execute the time delay
interrupt OB. Only one time delay interrupt OB can be attached to a time delay event. The
CPU supports four time delay events.
The hardware interrupt events are triggered by a change in the hardware, such as a rising or
falling edge on an input point, or a HSC (High Speed Counter) event. There can be one
interrupt OB selected for each hardware interrupt event. The hardware events are enabled in
Device configuration. The OBs are specified for the event in the Device configuration or with
an ATTACH instruction in the user program. The CPU supports several hardware interrupt
events. The exact events are based on the CPU model and the number of input points.
The time and diagnostic error interrupt events are triggered when the CPU detects an error.
These events are a higher priority group that the other interrupt events and can interrupt the
execution of the time delay, cyclic and hardware interrupt events. One interrupt OB can be
specified for each of the time error and diagnostic error interrupt events.
Understanding event execution priorities and queuing
The number of pending (queued) events from a single source is limited using a different
queue for each event type. Upon reaching the limit of pending events for a given event type,
the next event is lost. Refer to the following section on "Understanding time error events" for
more information regarding queue overflows.
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02
PLC concepts
3.1 Execution of the user program
43

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents