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

 Respuesta aceptada

Sebastian Castro
Sebastian Castro el 17 de Abr. de 2017
Editada: Sebastian Castro el 17 de Abr. de 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

Más respuestas (0)

Categorías

Más información sobre Simulink en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de Abr. de 2017

Comentada:

el 18 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by