Manual Switch

Switch between two inputs

  • Library:
  • Simulink / Signal Routing

Description

The Manual Switch block is a toggle switch that selects one of its two inputs to pass through to the output. To toggle between inputs, double-click the block. You control the signal flow by setting the switch before you start the simulation or by changing the switch while the simulation is executing. The Manual Switch block retains its current state when you save the model.

Note

Double-clicking the Manual Switch block does not open the block dialog box. Instead, it toggles the input choice.

Ports

Input

expand all

First of two inputs to the Manual Switch block. The block propagates the selected input to the output. To select the input signal, toggle the switch by double-clicking the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Second of two inputs to the Manual Switch block. The block propagates the selected input to the output. To select the input signal, toggle the switch by double-clicking the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Output

expand all

Output signal progagated from either the first or second input signal.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Parameters

expand all

To view the block parameters, right-click the block and select Block Parameters (ManualSwitch).

Select this check box to allow inputs with different sizes. If you select the box, the block allows inputs with different sizes, and propagates the selected input signal size to the output signal. If you clear the box, the block expands scalar inputs to have the same dimensions as nonscalar inputs. See Scalar Expansion of Inputs and Parameters.

Programmatic Use

Parameter: varsize
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Specify the sample time as a value other than -1. For more information, see Specify Sample Time.

Dependencies

This parameter is not visible unless it is explicitly set to a value other than -1. To learn more, see Blocks for Which Sample Time Is Not Recommended.

Programmatic Use

Block Parameter: SampleTime
Type: character vector
Values: scalar or vector
Default: '-1'

Block Characteristics

Data Types

Boolean | bus | double | enumerated | fixed point | integer | single | string

Direct Feedthrough

yes

Multidimensional Signals

yes

Variable-Size Signals

yes

Zero-Crossing Detection

no

Extended Capabilities

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Introduced before R2006a