How can I Programmatically add CAN Pack block to a Simulink Model?

I trying to add CAN Pack block to simulink model using matlab commands Can you please help me

 採用された回答

Sebastian Castro
Sebastian Castro 2017 年 4 月 17 日
編集済み: Sebastian Castro 2017 年 4 月 17 日

0 投票

If you open the source block library for the CAN Pack block, select the block, and then type gcb at the MATLAB Command Window, you'll see the name of the block to work with it programmatically.
I did it with my Vehicle Network Toolbox library and got the following. Note that there are other CAN Pack blocks in other toolboxes, so depends on which you are using.
'canlib/CAN Pack'
So you can take that and add it to your model with add_block as follows
add_block('canlib/CAN Pack','my_model/my_block_name');
Sebastian

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by