Is there any Stateflow examples to detect the rising and falling edge of the input clock pulse ?

18 visualizaciones (últimos 30 días)
Example: State flow logic should increment the output only during rising edge of input clock pulse, and should decrement the output during falling edge of input clock. Also logic should supports for code generation.
This can be done using two State flow, but is there any ways to do this using only one State flow?

Respuestas (1)

Chetna Jain
Chetna Jain el 11 de Jun. de 2018
Hi Parashara,
There is no direct solution to detect rising/falling edge of an input in Stateflow,one needs to Implement the edge detection inside the Stateflow chart with local variables.
However, you can activate a Stateflow chart via a change in control signal (an edge-triggered input event) or a function call from a Simulink block (a function-call input event). you can find the details in below-mentioned link:
In Simulink it can be done easily using “Detect Increase” & “Detect Decrease” blocks !!

Categorías

Más información sobre Complex Logic en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by