If-Else inside Stateflow Chart

조회 수: 48 (최근 30일)
Rashmi Bharadwaja
Rashmi Bharadwaja 2017년 8월 18일
댓글: Rashmi Bharadwaja 2017년 8월 22일
Hello all, I am using if-else conditions indside a stateflow chart. When I try to simulate the chart, I get model and coder error. The error says "Chart input data 'signal_name' on left hand side of an expression. I am not able to figure the problem. If anyone knows a solution to this, please let me know.
Thanks in advance.
Cheers, Rashmi

채택된 답변

ES
ES 2017년 8월 21일
In that case You have to implement a new output variable (output to Simulink). And to this output variable, you can assign the input variable's value.
You can't set value to an input variable.
  댓글 수: 1
Rashmi Bharadwaja
Rashmi Bharadwaja 2017년 8월 22일
This worked. Thanks a lot!

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

추가 답변 (1개)

ES
ES 2017년 8월 18일
From the error, I think you are trying to assign value to an input signal example {signal_name = xyz}. This is not possible.
What is the exact error message? and when do you get it?
  댓글 수: 1
Rashmi Bharadwaja
Rashmi Bharadwaja 2017년 8월 21일
The signals used as inputs to the stateflow chart are also used as conditions and should also be output from the statechart with changing values. The changing ouputs are due to some if-else loops in the chart. At each condition, the output value is different. Do you have any idea how this could be done? I get the above error when I try to simulate the chart. There is a "model error and coder error".

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

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by