Main Content

PS Switch

Single-pole double-throw switch controlled by external physical signal

  • PS Switch block

Libraries:
Simscape / Foundation Library / Physical Signals / Nonlinear Operators

Description

The PS Switch block compares the value of the physical signal presented at the second (middle) input port to the threshold value:

  • If the control input value is greater than or equal to the threshold, the output is connected to the first input. This is the default connection shown in the block icon.

  • If the control input value is less than the threshold, the output is connected to the third input.

The second (middle) input port is the control port and it never connects to the output.

All the inputs and the output are physical signals. Untyped physical ports facilitate unit propagation. Physical signals at the first and third input ports must have commensurate units. The unit at the output port is determined by unit propagation rules. For more information, see Physical Signal Unit Propagation.

Ports

Input

expand all

First input physical signal. This signal is output if the control signal value at port I2 is greater than or equal to the Threshold parameter value.

The port name is not visible in the block icon, but you can see this name in the underlying source file by clicking the Source code link in the Description tab of the block dialog box.

Second input physical signal. This is the control signal for the switch.

The port name is not visible in the block icon, but you can see this name in the underlying source file by clicking the Source code link in the Description tab of the block dialog box.

Third input physical signal. This signal is output if the control signal value at port I2 is less than the Threshold parameter value.

The port name is not visible in the block icon, but you can see this name in the underlying source file by clicking the Source code link in the Description tab of the block dialog box.

Output

expand all

Output physical signal.

The port name is not visible in the block icon, but you can see this name in the underlying source file by clicking the Source code link in the Description tab of the block dialog box.

Parameters

expand all

The threshold value for opening and closing the switch. If the control physical signal, presented at the second (middle) input port I2, is greater than or equal to this value, then the output is connected to the first input. Otherwise, the output is connected to the third input.

The parameter unit must be commensurate with the unit of the control signal at port I2. You can select a unit from the drop-down list or type the desired unit name or expression. For more information and a list of unit abbreviations, see How to Specify Units in Block Dialogs and Unit Definitions.

Extended Capabilities

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

Version History

Introduced in R2009b

expand all