StateFlow: Temporal Logic After

조회 수: 4 (최근 30일)
Joan Sanz
Joan Sanz 2015년 7월 7일
답변: Sebastian Castro 2015년 7월 7일
Hello,
Under demanding of our Customer, we need implement between 2 states; first of all, check if X condition is true, when is confirmed, then launch a timer of X seconds and finally the states will be reached. I've attached an example.
The condition is a==1 and then after(2,sec) on the same tick.
But we have observed Timer(After) is launched even a!=1. Could you give some solution for this?.

답변 (1개)

Sebastian Castro
Sebastian Castro 2015년 7월 7일
If you use transitions and nodes, you don't get the benefits of states "remembering" their previous location.
Like you described, that "after(2,sec)" starts being tested as soon as you enter the "ON" state, and not as soon as "a" becomes 1.
I would recommend using substates inside "ON" to do this logic. For example, try the following:
- Sebastian

카테고리

Help CenterFile Exchange에서 Decision Logic에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by