Bus Assignment creates new copy of variable in generated code ?

Hi,
I have created one bus using Bus Creator and the output has been written to 'My_Signal' (Simulink.Signal object). That signal is fed to another subsystem through port.
I am using Bus Assignment to update one field of bus. Generated code looks like this,
My_Signal.Field_1= 5;
My_Signal.Field_2= 6;
...
...
...
% Subsystem2
rtb_My_Signal=My_Signal;
rtb_My_Signal.Field_2=10;
...
..
I do not understand why Embedded coder is creating new parameter ? Is it possible to reduce the unneccasry bus copy ?
I want the generated code looks like below
My_Signal.Field_1= 5;
My_Signal.Field_2= 6;
...
...
...
% Subsystem 2
My_Signal.Field_2=10;

3 件のコメント

Shivaputra Narke
Shivaputra Narke 2019 年 2 月 7 日
Looking for the in-built solution. I was able to generate required code using tlc files. But it's good to have a built in solution.
Helia Pouyllau
Helia Pouyllau 2019 年 5 月 10 日
Hello, I am facing the same issue, do you have some documentation about how to use tlc files to avoid the copy ?
Shivaputra Narke
Shivaputra Narke 2019 年 5 月 15 日
Have you tried using Data Store Read and Data Store Write blocks ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

製品

リリース

R2015b

質問済み:

2019 年 2 月 7 日

コメント済み:

2019 年 5 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by