Creating A Complex Equation With A Simple Instruction - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

95BSTEP 7 programming software
2.3 Easy-to-use tools
2.3.3

Creating a complex equation with a simple instruction

The Calculate instruction lets you create a math function that operates on multiple input
parameters to produce the result, according to the equation that you define.
For this example, enter the following equation for scaling a raw analog value. (The "In" and
"Out" designations correspond to the parameters of the Calculate instruction.)
Out
Out
Where:
30
Click the "???" and select the data types for the input and output
parameters. (The input and output parameters must all be the same
data type.)
For this example, select the "Real" data type.
Click the "Edit equation" icon to enter the equation.
= ((Out
- Out
value
high
= ((in4 - in5) / (in2 - in3)) * (in1 - in3) + in5
Out
value
In the Basic instruction tree, expand the Math functions folder.
Double-click the Calculate instruction to insert the instruction
into your user program.
) / (In
- In
)) * (In
low
high
low
(Out)
Scaled output value
The unconfigured Calculate
instruction provides two input
parameters and an output
parameter.
- In
) + Out
value
low
low
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents