Program Execution; Principle Of Operation - Siemens Simatic S7-1500 Function Manual

Cycle and response times
Hide thumbs Also See for Simatic S7-1500:
Table of Contents

Advertisement

Program execution

2.1

Principle of operation

Introduction
You often program your user program with a cyclic OB, usually in OB 1. With complex
applications, problems are often encountered in complying with the response times required
by the application. You can often meet the response time requirements by splitting the user
program up into several parts with different response time requirements. The CPU offers a
number of different OB types for this purpose, the properties (priority, frequency, etc.) of
which can be adapted to meet your requirements.
Program organization
You can choose from the following types of program execution for running your user
program:
Program execution in the cyclic program of the CPU:
The CPU executes the user program cyclically. When the execution has reached the end of
a cycle, the program execution starts again in the next cycle. In the simplest case, you
execute the entire user program in the cyclic program of the CPU. All tasks in the user
program are then processed with equal rank. This also results in the same response times
for all tasks.
In addition to program execution in the cyclic program, there is time-driven and event-driven
program execution.
Time-driven execution:
In a complex user program, there are frequently portions with different response time
requirements. You can optimize the response times by taking advantage of these differences
in the requirements. To do so, you can break down the program parts with higher response
time requirements into higher-priority OBs with shorter cycles, for example cyclic interrupt
OBs.
The execution of these parts can thus occur at different frequencies and with different
priorities.
Event-driven execution:
Depending on the I/O modules used, you can configure hardware interrupts for specific
process events (such as an edge change of a digital input) that result in the call of the
assigned hardware interrupt OB. The hardware interrupts have a higher priority and interrupt
the cyclic program of the CPU. You can achieve very short response times in the CPU with
hardware interrupts by directly triggering program execution.
Keep in mind that the time characteristics of your application becomes less predictable with
intense use of hardware interrupts. The reason for this is that the time at which the triggering
events occur can result in drastically different response times.
Tip: Use hardware interrupts only for a few selected events.
Special consideration for hardware interrupts: If you have assigned an OB to an event
(hardware interrupt), the OB then has the priority of the event.
Cycle and response times
Function Manual, 10/2018, A5E03461504-AD
2
13

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents