FB_Quantizer (Function Block)

Rounds the input signal to the nearest multiple of StepSize.

Useful for simulating ADC resolution, modelling actuators with discrete positions, or testing controller behaviour under quantisation.

A StepSize of zero passes the input through unchanged.

Note

The block is FINAL and must be instantiated, not extended. Use FB_init to set fStepSize at declaration time.

Extends: FB_SisoComponent

Properties

StepSize

Type: LREAL

Gets or sets the quantisation step size.

The output is rounded to the nearest multiple of this value. For example, a step size of 0.5 rounds the input to the nearest 0.5. A value of zero passes the input through unchanged.

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)

fStepSize

LREAL

Quantisation step size. Zero passes the input through unchanged.

Run

Applies quantisation to the current input.