FB_LinearScaler (Function Block)
Maps the input signal from one range to another using linear interpolation.
The input range [InputMin, InputMax] is mapped to the output
range [OutputMin, OutputMax]. Values outside the input range
are extrapolated linearly.
If InputMin equals InputMax the output is set to OutputMin.
Note
The block is FINAL and must be instantiated, not extended.
Use FB_init to set fInputMax, fInputMin, fOutputMin,
fOutputMax and fOutputMin at declaration time.
Extends: FB_SisoComponent
Properties
InputMax
Type: LREAL
Gets or sets the upper bound of the input range.
InputMin
Type: LREAL
Gets or sets the lower bound of the input range.
OutputMax
Type: LREAL
Gets or sets the upper bound of the output range.
OutputMin
Type: LREAL
Gets or sets the lower bound of the output range.
Methods
FB_init
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
if TRUE, the retain variables are initialized (warm start / cold start) |
|
|
if TRUE, the instance afterwards gets moved into the copy code (online change) |
|
|
Upper bound of the input range. |
|
|
Lower bound of the input range. |
|
|
Upper bound of the output range. |
|
|
Lower bound of the output range. |
Run
Applies the linear scaling to the current input.