Math Made Easy With The Calculate Instruction - Siemens SIMATIC S7-1200 Manual

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

Advertisement

Table 6- 6
SCALE_X and NORM_X instructions
LAD / FBD
SCL
out := SCALE_X(
out := NORM_X(
Equivalent SCL:
1
out := value (max-min) + min;
6.3.4

Math made easy with the Calculate instruction

Table 6- 7
CALCULATE instruction
LAD / FBD
Table 6- 8
Data types for the parameters
Parameter
Data type
IN1, IN2, ..INn
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord
OUT
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte, Word, DWord
The IN and OUT parameters must be the same data type (with implicit conversions of the input parameters). For
1
example: A SINT value for an input would be converted to an INT or a REAL value if OUT is an INT or REAL
Click the calculator icon to open the dialog and define your math function. You enter your
equation as inputs (such as IN1 and IN2) and operations. When you click "OK" to save the
function, the dialog automatically creates the inputs for the CALCULATE instruction.
An example and a list of possible math operations you can include is shown at the bottom of
the editor.
Easy Book
Manual, 03/2014, A5E02486774-AF
min,:=_undef_in_
value:=_real_in_,
max:=undef_in_);
min:=_,undef_in_
value:=_undef_in_,
max:=_undef_in_);
SCL
Description
Use the
The CALCULATE instruction lets you create a math function that
standard SCL
operates on inputs (IN1, IN2, .. INn) and produces the result at OUT,
math
according to the equation that you define.
expressions to
create the
equation.
1
6.3 Powerful instructions make programming easy
Description
Scales the normalized real parameter VALUE where ( 0.0
<= VALUE <= 1.0 ) in the data type and value range
specified by the MIN and MAX parameters:
OUT = VALUE (MAX - MIN) + MIN
Normalizes the parameter VALUE inside the value range
specified by the MIN and MAX parameters:
OUT = (VALUE - MIN) / (MAX - MIN),
where ( 0.0 <= OUT <= 1.0 )
Equivalent SCL:
2
out := (value-min)/(max-min);
Select a data type first. All inputs and the output must be the same
data type.
To add another input, click the icon at the last input.
Programming made easy
103

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents