Using Blocks To Structure Your Program - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Linear 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. Using generic code blocks has a
number of benefits:
● 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
● Creating modular components that relate to specific technological functions can help to
5.3

Using blocks to structure your program

By designing FBs and FCs to perform generic tasks, you create modular code blocks. You
then structure your program by having other code blocks call these reusable modules. The
calling block passes device-specific parameters to the called block.
A
B
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.
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02
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.
simplify and reduce the time involved with commissioning the completed application.
Calling block
Called (or interrupting) block
Program execution
Operation that calls another block
Program execution
Block end (returns to calling block)
5.3 Using blocks to structure your program
Modular structure:
Programming concepts
81

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents