Function (Fc) - Siemens S7-1200 System Manual

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

Advertisement

Programming concepts
6.3 Using blocks to structure your program
Creating additional OBs
You can create multiple OBs for your user program, even for the program cycle and startup
OB events. Use the "Add new block" dialog to create an OB and enter a name for your OB.
If you create multiple program cycle OBs for your user program, the CPU executes each
program cycle OB in numerical sequence, starting with the program cycle OB with the lowest
number (such as OB 1). For example: after the first program cycle OB (such as OB 1)
finishes, the CPU executes the program cycle OB with the next higher number.
Configuring the properties of an OB
Note
Note that you can assign a process image part number to an OB that corresponds to PIP0,
PIP1, PIP2, PIP3, or PIP4. If you enter a number for the process image part number, the
CPU creates that process image partition. See the topic "Execution of the user program
(Page 77)" for an explanation of the process image partitions.
6.3.2

Function (FC)

A function (FC) is a code block that typically performs a specific operation on a set of input
values. The FC stores the results of this operation in memory locations. For example, use
FCs to perform standard and reusable operations (such as for mathematical calculations) or
technological functions (such as for individual controls using bit logic operations). An FC can
also be called several times at different points in a program. This reuse simplifies the
programming of frequently recurring tasks.
An FC does not have an associated instance data block (DB). The FC uses the local data
stack for the temporary data used to calculate the operation. The temporary data is not
saved. To store data permanently, assign the output value to a global memory location, such
as M memory or to a global DB.
174
You can modify the properties of an
OB. For example, you can configure the
OB number or programming language.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG

Advertisement

Table of Contents
loading

Table of Contents