- Define the structure data type and create a Simulink bus object in the base workspace
- Add a data object to the chart
- Set the Scope property for the structure.
How to use nonvirtual bus as Stateflow Output-Signal?
11 次查看(过去 30 天)
显示 更早的评论
Hello, for my Simulink-model of a flight-guidance controller for a quadrotor, I want to use a Stateflow Chart to decide whether the quadrotor is taking off, following a trajectory or hovering etc.
For this Stateflow, I want to use a nonvirtual bus-signal as output-signal. I created a Simulink Bus Object in base workspace and specified it and I used bus-creator to include the signals and set its output to nonvirtual, but when I connect the bus to the output of the Stateflow Chart and update my model, it get´s me this error:
"Unable to assign structure value to non-structure output 'ControlCommands' of chart 'Guidance_Model/Chart'."
"ControlCommands" is the output of the Stateflow Chart.
Hopefully somebody can explain to me, what I´m missing here, thanks!
0 个评论
回答(1 个)
ag
2023-12-1
Hi Leonard,
I understand that you are having trouble using the output from a bus, as input to the Stateflow chart.
To do so, you can access bus singals by defining a Stateflow structure as described in the below steps,
For more details on how to define and use Stateflow structures please refer to the following documentation, https://www.mathworks.com/help/stateflow/ug/about-stateflow-structures.html#mw_f5c437a0-9cd0-4980-a865-e7415eb14b0c:~:text=and%20lower_saturation_limit.-,Define%20Stateflow%20Structures,-To%20define%20the
Hope this helps!
Best Regards,
Aryan Gupta
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!