3 General Programming
3.2 Program blocks
Depending on the controller a number of different OB types are available.
Properties
OBs are called by the operating system of the controller
Several Main OBs can be created in a program. The OBs are processed
sequentially by OB number.
Figure 3-3: Using several Main OBs
Recommendation
Encapsulate the different program parts which should maybe be replaceable
from controller to controller, into several Main OBs.
Avoid the communication between the different Main OBs. They can then be
used independent from each other. If you nevertheless exchange data
between the individual main OBs, use the global DBs (see chapter 4.2 No bit
memory but global data blocks).
Divide all program parts that belong to each other into folders and store them
for reusability in the project or global library.
Programming Guideline for S7-1200/1500
V1.2, Entry ID: 81318674
User program
Main_1
OB1
Main_y
OB200
Main_x
OB300
FB
Local
FC
FB
Local
FC
FB
Local
FC
29