Siemens SIMATIC S7-1200 Manual page 50

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

Advertisement

Programming concepts made easy
5.2 Easy to design your user program
By designing FBs and FCs to perform generic tasks, you create modular code blocks. You
then structure your user program by having other code blocks call these reusable modules.
The calling block passes device-specific parameters to the called block. When a code block
calls another code block, the CPU executes the program code in the called block. After
execution of the called block is complete, the CPU resumes the execution of the calling
block. Processing continues with execution of the instruction that follows after the block call.
A
B
You can nest the block calls for a
more modular structure.
By creating generic code blocks that can be reused within the user program, you can simplify
the design and implementation of the user program.
● You can create reusable blocks of code for standard tasks, such as for controlling a pump
● When you structure the user program into modular components that relate to functional
● Creating modular components simplifies the debugging of your program. By structuring
● Utilizing a modular design that relates to specific functional tasks can reduce the time
50
Calling block
Called (or interrupting) block
Program execution
Instruction or event that initiates the
execution of another block
Program execution
Block end (returns to calling block)
Start of cycle
Nesting depth
In this example, the nesting
depth is 4: the program
cycle OB plus 3 layers of
calls to code blocks.
or a motor. You can also store these generic code blocks in a library that can be used by
different applications or solutions.
tasks, the design of your program can be easier to understand and to manage. The
modular components not only help to standardize the program design but can also help
to make updating or modifying the program code quicker and easier.
the complete program as a set of modular program segments, you can test the
functionality of each code block as it is developed.
required for the commissioning of the completed application.
Easy Book
Manual, 11/2009, A5E02486774-01

Advertisement

Table of Contents
loading

Table of Contents