Processing The Scan Cycle In Run Mode; Organization Blocks (Obs) - Siemens S7-1200 System Manual

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

Advertisement

4.1.2

Processing the scan cycle in RUN mode

For each scan cycle, the CPU writes the outputs, reads the inputs, executes the user
program, updates communication modules, and responds to user interrupt events and
communication requests. Communication requests are handled periodically throughout the
scan.
These actions (except for user interrupt events) are serviced regularly and in sequential
order. User interrupt events that are enabled are serviced according to priority in the order in
which they occur. For interrupt events, the CPU reads the inputs, executes the OB, and then
writes the outputs, using the associated process image partition (PIP), if applicable.
The system guarantees that the scan cycle will be completed in a time period called the
maximum cycle time; otherwise a time error event is generated.
● Each scan cycle begins by retrieving the current values of the digital and analog outputs
● The scan cycle continues by reading the current values of the digital and analog inputs
● After reading the inputs, the user program is executed from the first instruction through
Communications processing occurs periodically throughout the scan, possibly interrupting
user program execution.
Self-diagnostic checks include periodic checks of the system and the I/O module status
checks.
Interrupts can occur during any part of the scan cycle, and are event-driven. When an event
occurs, the CPU interrupts the scan cycle and calls the OB that was configured to process
that event. After the OB finishes processing the event, the CPU resumes execution of the
user program at the point of interruption.
4.1.3

Organization blocks (OBs)

OBs control the execution of the user program. Specific events in the CPU trigger the
execution of an organization block. OBs cannot call each other or be called from an FC or
FB. Only an event such as a diagnostic interrupt or a time interval, can start the execution of
an OB. The CPU handles OBs according to their respective priority classes, with higher
priority OBs executing before lower priority OBs. The lowest priority class is 1 (for the main
program cycle), and the highest priority class is 24.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
from the process image and then writing them to the physical outputs of the CPU, SB,
and SM modules configured for automatic I/O update (default configuration). When a
physical output is accessed by an instruction, both the output process image and the
physical output itself are updated.
from the CPU, SB, and SMs configured for automatic I/O update (default configuration),
and then writing these values to the process image. When a physical input is accessed
by an instruction, the value of the physical input is accessed by the instruction, but the
input process image is not updated.
the end instruction. This includes all the program cycle OBs plus all their associated FCs
and FBs. The program cycle OBs are executed in order according to the OB number with
the lowest OB number executing first.
PLC concepts
4.1 Execution of the user program
85

Advertisement

Table of Contents
loading

Table of Contents