How to make stateflow sample simevents' entity's attributes when the function call happens?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,all!
I have a problem when interacting stateflow with simevents.
For example, I use simevents to generate an entity every 1s. This entity has its attribute which works as an input data to stateflow. The entity also evoke the stateflow chart at the time it is generated. What I find out is that the function call is captured without any problem, but the input-type data in the stateflow remains the initial value, which is different from the entity's attribute. It will only become the same as the attribute when the next event happens. Anyone knows how to solve this problem?
Looking forwards to your answer and thank you in advance!
댓글 수: 0
채택된 답변
Devdatt Lad
2011년 5월 31일
The one-event delay is usually caused by the absence of a Single Server block with zero service time that causes operations to be ordered correctly. Insert this block after the Get Attribute block that is feeding attributes to Stateflow chart, but before the block that is sending the function-call to the Stateflow chart. This will ensure that by the time the function-call reaches Stateflow, the attribute values are available.
Note that there is some configuration you have to do to your Stateflow chart in order for it to behave in event-driven fashion with SimEvents. More on that is here: Using Stateflow Charts in SimEvents Models
Hope this helps.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!