Plc Concepts; Execution Of The User Program - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

PLC concepts

3.1

Execution of the user program

The CPU supports the following types of code blocks that allow you to create an efficient
structure for your user program:
● Organization blocks (OBs) define the structure of the program. Some OBs have
● Functions (FCs) and function blocks (FBs) contain the program code that corresponds to
● Data blocks (DBs) store data that can be used by the program blocks.
Execution of the user program begins with one or more optional start-up organization blocks
(OBs) which are executed once upon entering RUN mode, followed by one or more program
cycle OBs which are executed cyclically. An OB can also be associated with an interrupt
event, which can be either a standard event or an error event, and executes whenever the
corresponding standard or error event occurs.
A function (FC) or a function block (FB) is a block of program code that can be called from
an OB or from another FC or FB, down to the following levels:
● 16 from the program cycle or startup OB
● 4 from time delay interrupt, cyclic interrupt, hardware interrupt, time error interrupt, or
FCs are not associated with any particular data block (DB), while FBs are tied directly to a
DB and use the DB for passing parameters and storing interim values and results.
The size of the user program, data, and configuration is limited by the available load memory
and work memory in the CPU. There is no limit to the number of blocks supported within the
available amount of work memory.
Each cycle includes writing the outputs, reading the inputs, executing the user program
instructions, and performing system maintenance or background processing. The cycle is
referred to as a scan cycle or scan.
The signal board, signal modules and communication modules are detected and logged in
only upon power up.
Note
Insertion and extraction of a signal board, signal modules, and communications module
under power (hot) is not supported. The only exception is the SIMATIC memory card, which
can be inserted or removed while the CPU is under power.
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02
predefined behavior and start events, but you can also create OBs with custom start
events.
specific tasks or combinations of parameters. Each FC or FB provides a set of input and
output parameters for sharing data with the calling block. An FB also uses an associated
data block (called an instance DB) to maintain state of values between execution that can
be used by other blocks in the program.
diagnostic error interrupt OB
3
37

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents