System Composer: Reading Stereotype Parameter from Component

Hello everyone,
assuming I have defined a component, assigned a stereotype and defined a stereotype parameter. Furthermore, I defined a Simulink behavior for that component. Now I want to define a Stateflow chart within the Simulink model and access the previously defined parameter. Is that possible?
Best regards,
Tim

답변 (1개)

Kirsten Hart
Kirsten Hart 2022년 10월 12일

2 개 추천

Stereotype information does not flow to the Simulink behavior model, however there is a way that you can implement this.
Rather than applying a stereotype to the system architecture component, you can add a parameter to the Simulink behavior model. Once this Simulink Parameter is added to the behavior model workspace and it is marked as a model argument, you will be able to access the parameter from the Property Insepector in System Composer. This parameter can also be accessed in the Simulink model by name just like other variables in the model workspace, and therefore is accessible from the Stateflow chart.
Here is an example of using parameters to store instance values for components: https://www.mathworks.com/help/releases/R2022a/systemcomposer/ug/use-parameters-store-instance-values-components.html

댓글 수: 2

Thanks for the quick response, Ms. Hart. I was able to implement the proposed solution; accessing the simulink parameter works from both simulink blocks and stateflow charts.
However, if possible, I also want to modify the parameter which I was not able to implement up to now.
My goal is to implement a "simulation engine" component, which is able to influence the behavior of all other components via modification of the respective parameters. The purpose is to implement a custom fault injection. Maybe there is a more sophisticated way of doing so? The model is mostly implemented with SimEvent components.
I've also seen that it is possible to to adjust the parameters via a SimulationInput. It is also possible to define external inputs that are applied during runtime. However, i did not see any possibility to realize a change of the block parameters at runtime.

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

카테고리

도움말 센터File Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 10월 11일

댓글:

2022년 10월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by