How to create union in simulink
20 ビュー (過去 30 日間)
古いコメントを表示
Hellow.
I have a question about how to union in simulink in simulink coder.
I know how to create the bus of struct using the 'Simulink bus' in dictionary file. (*.sldd)
However, i can't see the part that creates the union.
Does Mathoworks support the method of generating code an union as shown below?
If so, could you tell me how?
thank you
**************************************************************************************
typedef union
{
uint32 R;
uint16 H;
} Test_u;
**************************************************************************************
0 件のコメント
回答 (2 件)
Anurag Ojha
2024 年 5 月 8 日
Hello
You can refer to following file exchange link to get more information:
I hope this helps you resolve your query
3 件のコメント
Meghna
2024 年 7 月 16 日
Hello,
Following up on this as well, how is the header supposed to look/are there any examples?
Thanks!
Angelo Yeo
2024 年 5 月 8 日
Current Simulink bus does not support union. Could we get a clearer understanding of why you want to realize the Simulink.Bus object as a union in the generated code? Is there any particular use case for this request?
2 件のコメント
rikro
2025 年 2 月 13 日 21:15
I am looking for the same purpose for fault flags . Is there a way we can use Union ?
参考
カテゴリ
Help Center および File Exchange で Deployment, Integration, and Supported Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!