Simulink Reference | ![]() ![]() |
Switch output between two constants
Library
Simulink Discontinuities and Fixed-Point Blockset Nonlinear
Description
The Relay block allows its output to switch between two specified values. When the relay is on, it remains on until the input drops below the value of the Switch off point parameter. When the relay is off, it remains off until the input exceeds the value of the Switch on point parameter. The block accepts one input and generates one output.
The Switch on point value must be greater than or equal to the Switch off point. Specifying a Switch on point value greater than the Switch off point value models hysteresis, whereas specifying equal values models a switch with a threshold at that value.
When the Show additional parameters check box is selected, some of the parameters that become visible are common to many blocks. For a detailed description of these parameters, refer to Block Parameters in the Fixed-Point Blockset documentation.
Data Type Support
This block supports any data type, including fixed-point, except int64
and uint64
.
Parameters and Dialog Box
Specify via dialog
, the Output data type, Output scaling value, and Parameter Scaling parameters become visible.Specify via dialog
is selected for the Output data type mode parameter.Specify via dialog
is selected for the Output data type mode parameter, and is only enabled if Use specified scaling
is selected for the Parameter Scaling parameter.Use Specified Scaling
--This mode allows you to specify the output scaling in the Output scaling value parameter
Best Precision: Vector-wise
--This mode produces a common radix point for each element of the output vector based on the best precision for the largest value of the vector.
Specify via dialog
is selected for the Output data type mode parameter.Conversions and Operations
The Switch on point and Switch off point parameters are converted to the input data type offline using round-to-nearest and saturation.
Characteristics
Dimensionalized |
Yes |
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving block |
Scalar Expansion |
Yes |
![]() | Relational Operator | Repeating Sequence | ![]() |