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

bInitRetains

BOOL

if TRUE, the retain variables are initialized (warm start / cold start)

bInCopyCode

BOOL

if TRUE, the instance afterwards gets moved into the copy code (online change)

fInputMax

LREAL

Upper bound of the input range.

fInputMin

LREAL

Lower bound of the input range.

fOutputMax

LREAL

Upper bound of the output range.

fOutputMin

LREAL

Lower bound of the output range.

Run

Applies the linear scaling to the current input.