Model advisor warning for local data in stateflow

조회 수: 3 (최근 30일)
Varun Nayyar
Varun Nayyar 2023년 10월 18일
댓글: akshatsood 2023년 10월 19일
What is the resolution for this model advisor warning on usage of local data in stateflow?
Check that the chart uses no local data
Simulink Code Inspector does not support local data in Stateflow charts
Warning
The following Stateflow data is local data:
...........

답변 (1개)

akshatsood
akshatsood 2023년 10월 19일
Hi Varun,
The Model Advisor warning indicates that the Stateflow chart contains local data, which is not supported by Simulink Code Inspector. To resolve this warning, you need to modify the chart and eliminate the usage of local data. The warning message provides a list of the specific local data variables that need attention.
Further, have a look at the following points
  1. Evaluate the necessity of using local data in the Stateflow chart. Consider whether it is essential for the chart's functionality. If not, it is recommended to remove the local data.
  2. Refactor the Stateflow chart to utilize input and output data instead of local data. By using input and output data, you can pass information between different parts of the model without relying on local data variables.
I hope this helps.
  댓글 수: 2
Varun Nayyar
Varun Nayyar 2023년 10월 19일
Thanks for your response. Unfortunately i am at a juncture in the program where there is no scope to modify the stateflow. Is this a limitation of Code inspector,becase I was unable to find this in Bugreport of 2012b?
In case If I need to reatain the local elements i believe the workaround would be to justify why it is acceptable to have the local elements in the design is that correct?
akshatsood
akshatsood 2023년 10월 19일
Yes, you are correct. If you are unable to modify the Stateflow chart and need to retain the local elements, you can provide a rationale explaining why the local data is necessary for the functionality of the chart and how it contributes to the overall design.
Regarding the limitation of Code Inspector, it is possible that the lack of support for local data in Stateflow charts is a known limitation. However, since you mentioned that you were unable to find it in the bug report of 2012b, it would be advisable to reach out to MathWorks support for further clarification on this matter.

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

카테고리

Help CenterFile Exchange에서 Model Compatibility에 대해 자세히 알아보기

제품


릴리스

R2012b

Community Treasure Hunt

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

Start Hunting!

Translated by