EasyManua.ls Logo

Siemens SIMATIC S7-1200

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Basic instructions
8.5 Math functions
S7-1200 Programmable controller
262 System Manual, V4.2, 09/2016, A5E02486680-AK
8.5.8
LIMIT (Set limit value)
Table 8- 62 LIMIT (set limit value) instruction
LAD / FBD
SCL
Description
LIMIT(MN:=_variant_in_,
IN:=_variant_in_,
MX:=_variant_in_,
OUT:=_variant_out_);
The Limit instruction tests if the value of parameter IN is inside the
value range specified by parameters MIN and MAX and if not,
clamps the value at MIN or MAX.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 8- 63 Data types for the parameters
Parameter
Data type
1
Description
MN, IN, and MX SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Time, Date,
TOD·Constant
Math operation inputs
OUT SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Time, Date,
TOD
Math operation output
1
The MN, IN, MX, and OUT parameters must be the same data type.
If the value of parameter IN is within the specified range, then the value of IN is stored in
parameter OUT. If the value of parameter IN is outside of the specified range, then the OUT
value is the value of parameter MIN (if the IN value is less than the MIN value) or the value
of parameter MAX (if the IN value is greater than the MAX value).
Table 8- 64 ENO status
ENO
Description
1
No error
0
Real: If one or more of the values for MIN, IN and MAX is NaN (Not a Number), then NaN is returned.
0
If MIN is greater than MAX, the value IN is assigned to OUT.
SCL examples:
MyVal := LIMIT(MN:=10,IN:=53, MX:=40); //Result: MyVal = 40
MyVal := LIMIT(MN:=10,IN:=37, MX:=40); //Result: MyVal = 37
MyVal := LIMIT(MN:=10,IN:=8, MX:=40); //Result: MyVal = 10

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals