Limit (Set Limit Value) Instruction - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents
7.5.8

LIMIT (Set limit value) instruction

Table 7- 56
LIMIT (set limit value) instruction
LAD / FBD
SCL
LIMIT(MN:=_variant_in_,
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
Table 7- 57
Data types for the parameters
Parameter
MN, IN, and MX
OUT
The MN, IN, MX, and OUT parameters must be the same data type.
1
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 7- 58
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
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
IN:=_variant_in_,
MX:=_variant_in_,
OUT:=_variant_out_);
Data type
1
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Constant
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal
Description
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.
Basic instructions
7.5 Math functions
Description
Math operation inputs
Math operation output
235
Table of Contents
loading

Table of Contents