Inputting frame-based signals to Stateflow Chart

조회 수: 6 (최근 30일)
Jim Clay
Jim Clay 2012년 11월 20일
My Stateflow chart has only one input- "signal". It is a [64 1] frame-based signal. When I do Display->Signals & Ports->Signal Dimensions from the Simulink model I get the following error-
Cannot propagate frame-based signal through input 'signal' because this input expects a sample-based signal.
I have set the dimensions of "signal" to [64 1] in Model Explorer, but that doesn't fix the problem. How can I input a frame-based signal to the Chart?

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 11월 20일
편집: Kaustubha Govind 2012년 11월 20일
I'm not 100% sure, but seeing the error message, it looks like Stateflow charts don't support frame-based signals at this point. You might need to use the Unbuffer and Buffer blocks to convert your frame-based signals to sample-based signals, and vice-versa to attain the interface. Please see Buffering and Frame-Based Processing for more information.
I think this line from the Stateflow documentation may be key:
Note: Charts cannot inherit frame-based data sizes from Simulink signals.
  댓글 수: 2
Jim Clay
Jim Clay 2012년 11월 20일
That's terrible. That makes Stateflow next to useless for me. Regardless, thank you for the information.
Jim Clay
Jim Clay 2012년 11월 20일
Is this not true of the other Stateflow blocks (e.g. State Transition Table)?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Guy Rouleau
Guy Rouleau 2012년 11월 21일
As mentioned in the link provided by Kaustubha, it is important to realize that since R2010b, the concept of "frame-based" changed.
When you think about that, a frame is just a vector of data.
In the old way of thinking, the "frame-based" property was associated to signals.
The new way of thinking is to let the block decide if they process the data they receive in a frame-based manner or in a sample-based manner.
I introduced this change here:
In your case, you could try inserting a Reshape block or a Frame to Vector block before the chart. That way, the chart will receive the same data and you will be able to process it the way you want inside the chart.

카테고리

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