Change Detector

Boolean signal change detector

  • Library:
  • Simscape / Electrical / Control / General Control

Description

The Change Detector block outputs a Boolean response of true when it detects a change in the Boolean input signal that meets one of these change criteria:

  • Rising edge — The input goes from false to true.

  • Falling edge — The input goes from true to false.

  • Either edge — The input goes from true to false or from false to true.

Ports

Input

expand all

Input Boolean signal. If false, 0. If true, 1.

Data Types: Boolean

Output

expand all

Output is true, 1, when the block detects a change that corresponds to the specified criteria (rising, falling, or either edge). Otherwise, output is false, 0.

Data Types: Boolean

Parameters

expand all

Criteria for change detection.

Initial value of the previous input. If the input at the start of simulation is different from the intial condition value, the block detects an edge.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? (Simulink) and Specify Sample Time (Simulink).

For inherited discrete-time operation, specify -1. For discrete-time operation, specify a positive integer. For continuous-time operation, specify 0.

If this block is in a masked subsystem, or other variant subsystem that allows you to switch between continuous operation and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures correct switching between the continuous and discrete implementations of the block. For more information, see Promote Parameter to Mask (Simulink).

Extended Capabilities

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

Introduced in R2018b