Is there any Stateflow examples to detect the rising and falling edge of the input clock pulse ?
15 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Chetna Jain
2018-6-11
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 !!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!