Skip to content

FixPt Relay

Switch output between two constants.

Description

The FixPt Relay block is a masked S-function that allows the output to switch between two specified values.

When the relay is on, it remains on until the input drops below the switch-off value. When the relay is off, it remains off until the input exceeds the switch-on value. The block accepts one input and generates one output.

Dialog Box Parameters

  • Switch on point - The "on" threshold for the relay. The value must be greater than or equal to the Switch off point. Specifying a value greater than the Switch off point value models hysteresis, whereas specifying equal values models a switch with a threshold at that value.
  • Switch off point - The "off" threshold for the relay.
  • Output when on - The output when the relay is on.
  • Output when off - The output when the relay is off.
  • Output data type and scaling - Specify the output data type and scaling via the dialog box, or inherit the data type and scaling by back propagation.
  • Output data type - Any data type supported by the Fixed-Point Blockset.
  • Output scaling - Radix point-only or slope/bias scaling. You can scale the Output when on and Output when off parameters using the constant vector scaling mode for maximizing precision. These scaling modes are available only for generalized fixed-point data types.
  • Override with doubles - If checked, the Output data type is overridden with doubles.

Output Scaling

If the output data type is a generalized fixed-point number such as sfix(16), the Output scaling parameter list provides you with these scaling modes:

  • Use Specified Scaling - Uses the slope/bias or radix point-only scaling specified for the editable Output scaling parameter (for example, \(2^{-10}\)).
  • Best Precision: Vector-wise - Produces the best precision based on the Output when on and Output when off parameters.

Characteristics

Characteristic Description
Input Port Any data type supported by the blockset
Output Port Any data type supported by the blockset
Direct Feedthrough Yes
Sample Time Inherited
Scalar Expansion Yes
States 0
Vectorized Yes