Limits
Block name
B82_LIMITS
ST call
PROGRAM TEST2_B82 VAR FB : LIB.CORE.V1_2.B82_LIMITS; IN_V:REAL; MAXIMUM_V:REAL:=20; MINIMUM_V:REAL:=0; OUT_V:REAL; END_VAR FB(IN:=IN_V, MAXIMUM:=MAXIMUM_V, MINIMUM:=MINIMUM_V); OUT_V:=FB.OUT; END_PROGRAM
Library
LIB\CORE
Version
V1.2
Description
The block is limitating the input signal by upper and lower bounds. Using one limit only is possible, the other limit is infinite or -infinite.
Inputs
Input | Type | Description | Default value |
IN | REAL | Input signal | 0 |
MAXIMUM | REAL | Upper signal limit | 1 |
MINIMUM | REAL | Lower signal limit | 0 |
MAXON | BOOL | Enable upper limit | True |
MINON | BOOL | Enable lower limit | True |
Outputs
Output | Type | Description |
OUT | REAL | Limited output signal |
SIGN | BOOL | Sign of the output signal |
Function
The block limits the input signal x by upper and lower limit.
- When minon=true, the signal x is limited by the lower bound minimum.
- When minon=false, the low limit is not used.
- When maxon=true, the signal x is limited by the upper bound maximum.
- When maxon=false, the high limit is not used.
Output sign is the sign of the output y. If y>= 0 then sign=true, otherwise sign=false.
Function in case of incorrect setting
When minon=maxon=true and maximum<minimum then y=maximum (lower value of both).
Application example
Older version
Version V1.0 was defined as a function. V1.1 is defined as a function block, therefore it can bes added to graphs and it can be set tu manual mode. Functionality remains without change.