Programming Made Easy; Easy To Design Your User Program - Siemens SIMATIC S7-1200 Manual

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

Advertisement

Programming made easy

6.1

Easy to design your user program

When you create a user program for the automation tasks, you insert the instructions for the
program into code blocks (OB, FB, or FC).
Choosing the type of structure for your user program
Based on the requirements of your application, you can choose either a linear structure or a
modular structure for creating your user program.
● A linear program executes all of the instructions for your automation tasks in sequence,
● A modular program calls specific code blocks that perform specific tasks. To create a
Linear structure:
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.
You can also assign an OB to an interrupting event. When the event occurs, the CPU
executes the program code in the associated OB. After the execution of the OB is complete,
the CPU resumes the execution at the point in the user program when the interrupting event
occurred, which could be any point in the scan.
Easy Book
Manual, 11/2011, A5E02486774-04
one after the other. Typically, the linear program puts all of the program instructions into
one program cycle OB (such as OB 1) for cyclic execution of the program.
modular structure, you divide the complex automation task into smaller subordinate tasks
that correspond to the functional tasks being performed by the process. Each code block
provides the program segment for each subordinate task. You structure your program by
calling one of the code blocks from another block.
Modular structure:
6
87

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents