IS_LIMIT block

Short summary

Name

IS_LIMIT

→POU type

→function

Category

IEC-block, SelectEnh

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/add.svg not defined in IEC-standard

Graphical interface

images/download/thumbnails/414782269/IS_LIMIT-version-1-modificationdate-1535099208083-api-v2.png

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

→Data type

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.

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.