IS_LIMIT block
Short summary
Name |
IS_LIMIT |
→POU type |
|
Category |
|
Conform to →IEC-standard |
not defined in IEC-standard |
Graphical interface |
|
Available since |
version 1.35.0 (for logi.CAD 3) |
Functionality
The block checks whether a value would be limited to defined limits (minimum and maximum value): MIN(MAX(IN, MN),MX) != IN Hence, this block informs whether the LIMIT block would limit the value.
You connect a value at input IN. If the LIMIT block would limit this value, the block IS_LIMIT returns the value TRUE (or an equivalent). The LIMIT block would limit the value, if the value of IN is > than the maximum value connected at input MX or if value of IN is < than the minimum value connected at input MN.
If the value of IN is within the defined limits or it is equal to one of the limits, the block IS_LIMIT returns the value FALSE (or an equivalent).
Special cases (see under "Example for usage within ST-editor" ) : If the minimum value is > than the maximum value, the block IS_LIMIT always returns the value TRUE (or an equivalent).
Inputs, return value
|
Identifier |
Description |
|
Inputs: |
MN |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, DATE_AND_TIME, DATE or TIME_OF_DAY |
minimum value |
IN |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, DATE_AND_TIME, DATE or TIME_OF_DAY |
value |
|
MX |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, DATE_AND_TIME, DATE or TIME_OF_DAY |
maximum value |
|
Return value: |
– |
BOOL |
|
Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
See:
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic .
Example for usage within ST-editor
PROGRAM Test
VAR
result1, result2, result3, result4 : BOOL;
END_VAR
result1 := IS_LIMIT(MN :=
5
, IN :=
99
, MX :=
100
); (* The variable
'result1'
evaluates to
'FALSE'
. *)
result2 := IS_LIMIT(MN :=
5
, IN :=
2
, MX :=
100
); (* The variable
'result2'
evaluates to
'TRUE'
. *)
result3 := IS_LIMIT(MN :=
5
, IN :=
105
, MX :=
100
); (* The variable
'result3'
evaluates to
'TRUE'
. *)
result4 := IS_LIMIT(MN :=
100
, IN :=
2
, MX :=
5
); (* The variable
'result3'
evaluates to
'TRUE'
. Reason: value
for
'MN'
> value
for
'MX'
*)
END_PROGRAM
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.