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

 Akzeptierte Antwort

Sebastian Castro
Sebastian Castro am 17 Apr. 2017
Bearbeitet: Sebastian Castro am 17 Apr. 2017
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

Weitere Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by