Using Simulink Clock as a Chart Transition Condition

After bringing in the clock I am using its value as a relational operand in a transition condition (t > x). Upon reaching the state with the outbound transition, the clock's value magically jumps from t < x to t > x which makes the condition always true. This is unexpected. I want it to monotonically increase (as usual) until the condition becomes true. How can I make the clock behave differently?

1 Comment

Not clear. Are you using a "Clock" block in Simulink and make it as an input to your Stateflow chart, or do you have a counter/timer within the chart?

Sign in to comment.

Answers (4)

Sorry, I am bringing in the clock from a clock block and want to use its value in a transition condtion. The clock monotonically increases until it gets to the state with the transition and then it jumps so the condition is always true. I want it to continue to behave as a monotonicly increasing clock instead of jumping ahead.

1 Comment

It should not happen like that. Make a simple example showing the problem so you can be helped.

Sign in to comment.

I am workiing with matlab support and will post the solution. Thanks!
No solution. That is how the clock in implemented.
Can you help us understand the usecase better? Most clock mechanisms could be implemented with absolute time temporal logic, to take transition after certain time interval.

Categories

Find more on Modeling in Help Center and File Exchange

Products

Release

R2017b

Tags

Asked:

on 29 Mar 2019

Answered:

on 1 Apr 2019

Community Treasure Hunt

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

Start Hunting!