179
ifm
Programming Manual BasicDisplay CR0452 v03.02
05 / 2018
ifm function elements
ifm function elements for the device CR0452
NORM_DINT
13240
Unit type = function block (FB)
Unit is contained in the library
ifm_PDMsmart_UTIL_Vxxyyzz.LIB
Symbol in CODESYS:
>
Description
3307
NORM_DINT normalises a value within defined limits to a value with new limits.
The FB normalises a value of type DINT, 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 DINT
(-2 147 483 648...2 147 483 647)!
>
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
3308
Parameter
Data type
Description
X
DINT
current input value
XH
DINT
upper limit of input value range
XL
DINT
lower limit of input value range
YH
DINT
upper limit of output value range
YL
DINT
lower limit of output value range
>
Parameters of the outputs
3309
Parameter
Data type
Description
Y
DINT
output value
X_OUT_OF_RANGE
BOOL
Error: X is beyond the limits of XH and XL