How to convert custom simulink blocks (with inports and outports created for accessing hardware interfaces) inside a subsystem into non-virtual blocks?

64 ビュー (過去 30 日間)
I'm working on a project which has custom simulink blocks (with inports and outports created for accessing hardware interfaces) within subsystem. But embedded coder didn't generate code for it stating its a virtual block. So how to convert these virtual blocks (Inports and Outports) inside a subsystem into non-virtual blocks? Or is there any other way so that embedded coder will generate code for it.

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2024 年 4 月 3 日 19:06
Select the Subsystem block, right click, select "Block Parameters (Subsystem)", check "Treat as atomic unit".
This is one of the ways to change between virtual and non-virtual.
  6 件のコメント
Harshal Pawar
Harshal Pawar 2024 年 4 月 10 日 16:54
Hi..Attached is the one of the Custom Block library file and as suggested below is the snap of the same block where "Treat as atomic unit" is alredy checked. But still issue is there.
Fangjun Jiang
Fangjun Jiang 2024 年 4 月 10 日 17:56
This block is an empty Subsystem block. There are no Port blocks inside. The port icon and label are from the "mask" of the Subsystem block. Select the block, right click, select Mask, Edit Mask, look at the Icon panel.
Thare are nothing there.
There are some codes related to the mask initialization but nothing indicates anything related to the embedded code generation.

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

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by