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

 Réponse acceptée

Sebastian Castro
Sebastian Castro le 17 Avr 2017
Modifié(e) : Sebastian Castro le 17 Avr 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

Plus de réponses (0)

Catégories

En savoir plus sur Modeling dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by