This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Manual Variant Source

Switch between multiple variant choices at input

  • Library:
  • Simulink / Signal Routing

Description

The Manual Variant Source block is a toggle switch that activates one of its variant choices at the input to pass through to the output.

A Manual Variant Source block can have two or more input ports and has one output port. Each input port is associated with a variant control. To change the number of input ports, right-click the block and select Mask Parameters, then type a value in the Number of choices box.

To toggle between the variant choices at input, double-click the block. The block displays the active choice with a line connecting the input to the output. The block propagates the active variant choice at input directly to the output and discards the blocks connected to inactive input ports during simulation.

Note

Double-clicking the Manual Variant Source block does not open the block dialog box instead it toggles the output choice.

Ports

Input

expand all

First variant input signal. The block passes this input signal to the output port when you connect the toggle switch to this port.

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

nth variant input signal. The block passes this input signal to the output port when you connect the toggle switch to this port.

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

Output

expand all

Output signal passed from the active variant input signal.

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

Parameters

expand all

To access the block parameter, right-click the block and select Mask > Mask Parameters.

Specify the number of variant input ports.

Programmatic Use

Block Parameter: NumChoices
Type: character vector
Value: integer
Default: '2'

Block Characteristics

Data Types

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

Direct Feedthrough

No

Multidimensional Signals

No

Variable-Size Signals

No

Zero-Crossing Detection

No

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

Introduced in R2016b