99BProgramming concepts
6.2 Structuring your user program
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
137
Linear structure:
Modular structure:
2%
)%
)&
2%
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
or a motor. You can also store these generic code blocks in a library that can be used by
different applications or solutions.
●
When you structure the user program into modular components that relate to functional
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.
●
Creating modular components simplifies the debugging of your program. By structuring
the complete program as a set of modular program segments, you can test the
functionality of each code block as it is developed.
●
Creating modular components that relate to specific technological functions can help to
simplify and reduce the time involved with commissioning the completed application.