Main Content

Manual Switch

在两个输入之间切换

  • 图书馆:
  • Simulink / Signal Routing

  • 手动开关块

描述

Manual Switch块是一个切换开关,它选择其两个输入之一以传递到输出。要在输入之间切换,请双击块。您可以通过在启动仿真之前设置开关来控制信号流,或者在执行模拟时通过更改开关。这Manual Switch保存模型时,块将保留其当前状态。

To programmatically toggle the switch, set theset_paramSW财产为'0'or'1'。For example, to connect the second input to the output:

set_param(gcb,'sw','0')

To connect the first input to the output:

set_param(gcb,'sw','1')

笔记

双击Manual Switch块不打开“块”对话框。相反,它可以切换输入选择。

Ports

Input

展开全部

两个输入中的第一个Manual Switch堵塞。该块将所选输入传播到输出。要选择输入信号,请双击块来切换开关。

数据类型:单身的|双倍的|一半|int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|布尔|fixed point|enumerated|公共汽车

两个输入中的第二个Manual Switch堵塞。该块将所选输入传播到输出。要选择输入信号,请双击块来切换开关。

数据类型:单身的|双倍的|一半|int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|布尔|fixed point|enumerated|公共汽车

输出

展开全部

从第一个或输出信号传播second input signal.

数据类型:单身的|双倍的|一半|int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|布尔|fixed point|enumerated|公共汽车

参数

展开全部

To view the block parameters, right-click the block and select块参数(手动开关)

选择此复选框以允许具有不同尺寸的输入,并将选定的输入信号大小传播到输出信号。如果清除框,则块会扩展标量输入,具有与非尺度输入相同的尺寸。看输入和参数的标量扩展

程序化使用

Parameter:varsize
类型:角色向量
价值:'上'|'off'
默认:'off'

Specify the sample time as a value other than -1. For more information, see指定样本时间

依赖性

This parameter is not visible unless it is explicitly set to a value other than-1。要了解更多,请参阅不建议使用样品时间的块

程序化使用

Block Parameter:采样时间
类型:角色向量
值:标量或矢量
默认:'-1'

Block Characteristics

数据类型

布尔|公共汽车|双倍的|enumerated|fixed point|一半|integer|单身的|细绳

Direct Feedthrough

是的

多维信号

是的

可变大小信号

是的

零交叉检测

no

扩展功能

定点转换
Design and simulate fixed-point systems using Fixed-Point Designer™.

Introduced before R2006a