Siemens S7-1200 Programming Manualline page 31

Step 7 tia portal, background and system description
Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

3 General Programming
3.2 Program blocks
Temporary and out tags are undefined when called in non-optimized blocks. In
optimized blocks, the values are always preset to the default value (S7-1500
and S7-1200 Firmware V4). Thus, the resulting behavior is not accidental but
reproducible.
In order to permanently save the data of an FC, the functions of the global data
blocks are available.
FCs can have several outputs.
The function value can be directly reused in SCL in a formula.
Recommendation
Use the functions for continuously recurring applications that are called several
times in different locations of the user program.
Use the option to directly reuse the function value in SCL.
<Operand> := <FC name> (parameter list);
Example
In the following example a mathematical formula is programmed in a FC. The result
of the calculation is directly declared as return value and the function value can be
directly reused.
Table 3-2: Reusing function value
Step
1.
2.
Programming Guideline for S7-1200/1500
V1.2, Entry ID: 81318674
Create an FC with the mathematical formula (circular segment) and define the
"Return" value as the result for the formula.
FC
Call the FC with the circular segment calculation in any block (SCL).
<Operand> := <FC name> (parameter list);
Instruction
31

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

S7-1500

Table of Contents