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

Programming made easy
6.3 Powerful instructions make programming easy
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.
Note
You also must create an input for any constants in your function. The constant value would
then be entered in the associated input for the CALCULATE instruction.
By entering constants as inputs, you can copy the CALCULATE instruction to other locations
in your user program without having to change the function. You then can change the values
or tags of the inputs for the instruction without modifying the function.
When CALCULATE is executed and all the individual operations in the calculation complete
successfully, then the ENO = 1. Otherwise, ENO = 0.
102
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
Select a data type first. All inputs and the output must be the same
create the
data type.
equation.
To add another input, click the icon at the last input.
1
Easy Book
Manual, 11/2011, A5E02486774-04

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents