How do I reference a value from a bus within a Stateflow chart? (coder error in Stateflow)
이전 댓글 표시
I've created a test Stateflow chart (with an embedded PID controller in the chart). Within my model, I have defined a bus type SIGNALBUS to bus together some inputs to the PID controller chart. I also created the bus SIGNALBUS in the base workspace with matching inputs.
Within the chart, I reference a component/value within the bus with the syntax "busname.busfield". When I run the model, however, I get the error "Referencing a component from array of non-scalar values is not supported for code generation." See attachment for model. The attached file SIGNALBUS must be loaded to the bus editor before running the model.
Snapshot of chart and error:

If I look at the "sfbus_demo" example, though, it uses that same syntax that I've used. See below link for description of sfbus_demo:
http://www.mathworks.com/help/stateflow/ug/connect-structures-in-charts-to-external-bus-signals.html
Any thoughts on what I'm doing wrong? Thanks for the help.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Stateflow에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!