Main Content

PS Asynchronous Sample & Hold

Output sample-and-hold signal with external trigger

  • PS Asynchronous Sample & Hold block

Libraries:
Simscape / Foundation Library / Physical Signals / Discrete

Description

The PS Asynchronous Sample & Hold block sets the output signal, Y, equal to the input signal, U, when the rising edge of the trigger input becomes greater than zero. Use this block, in conjunction with other physical signal blocks, to model discrete and event-based behaviors.

The Asynchronous PWM Voltage Source example illustrates how you can use the PS Asynchronous Sample & Hold block to build components with more complex behaviors. For an alternative discrete-time implementation, see the Discrete-Time PWM Voltage Source example. The discrete-time version is better suited to fixed-step solvers and hardware-in-the-loop applications, whereas the asynchronous implementation is better suited to fast desktop simulation using variable-step solvers.

The signal unit at the output port is determined by unit propagation rules.

Examples

Ports

Input

expand all

Input 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.

Input physical signal that triggers the sample-and-hold action. In the block icon, this port is marked with the (rising edge) sign.

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 value and unit of the output signal at time zero. The first edit box represents the signal value. The output of the block remains at this value until the block is triggered by a rising trigger signal becoming positive.

The second combo box represents the signal unit. By default, the unit is 1 (unitless). Specify a unit that is commensurate with the signal unit at the input port U. You can select a unit from the drop-down list or type the desired unit name, such as rpm, or a valid expression, such as rad/s. 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 R2011b

expand all