Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Stateflow event will start a new process?

조회 수: 2 (최근 30일)
Charles Wang
Charles Wang 2011년 10월 14일
마감: MATLAB Answer Bot 2021년 8월 20일
When adding code on a transit between two nodes in a stateflow chart, one can mix statements with events such as a trigger to a block outside the chart.
For pure statements I know that they will be executed sequencially. If a trigger inserted between two statements, will the next statement wait for its turn until the trigged block finishing execution?
Or the event will start a new process/thread (for the trigged block) which will run concurrently with the stateflow chart?
Thank you for your time!
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2011년 10월 15일
This is a good question. I remember we had to find this out when someone made a C code S-function accessing shared memory data. The S-function is triggered by an event during a transition. To be honest, I don't remember the conclusion any more. What I can suggest is that you make an example to test it out. Simulink has debug capability so you can actually run simulation step by step. You can find out the execution order. I think that will be the most convincing evidence that you can rest on.
Charles Wang
Charles Wang 2011년 10월 17일
Thank you Walter and Fangjun! I tested an example with two triggered blocks, one with 20 iterations and one with 1000,000. I did find that the second triggered block will wait for the first to finish.

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by