180
ifm
Programming Manual BasicDisplay CR0452 v03.02
05 / 2018
ifm function elements
ifm function elements for the device CR0452
NORM_REAL
13244
Unit type = function block (FB)
Unit is contained in the library
ifm_PDMsmart_UTIL_Vxxyyzz.LIB
Symbol in CODESYS:
>
Description
3310
NORM_REAL normalises a value within defined limits to a value with new limits.
The FB normalises a value of type REAL, which is within the limits of XH and XL, to an output value
within the limits of YH and YL. This FB is for example used to generate PWM values from analogue
input values.
NOTE
► The value for X must be in the defined input range between XL and XH!
There is no internal plausibility check of the value X.
Outside this value range the output X_OUT_OF_RANGE is set.
► The result of the calculation (XH-XL)•(YH-YL) must remain in the value range of data type REAL
(-
3,402823466•10
38
...3,402823466•10
38
)!
>
Due to rounding errors the normalised value can deviate by 1.
>
If the limits (XH/XL or YH/YL) are defined in an inverted manner, normalisation is also done in an
inverted manner.
>
Parameters of the inputs
3311
Parameter
Data type
Description
X
REAL
Input value
XH
REAL
Upper limit of output value range
XL
REAL
Lower limit of the input value range
YH
REAL
Upper limit of the output value range
YL
REAL
Lower limit of output value range
>
Parameters of the outputs
3312
Parameter
Data type
Description
Y
REAL
Output value
X_OUT_OF_RANGE
BOOL
Error: X is beyond the limits of XH and XL