- Don't use subsystem references. Use customized library instead. Or,
- Ask your vendor to support subsystem references.
How To Include One Instance Of A Block In A Model
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am working on a SIMULINK model that is used with a vendor provided toolchain. The top level of the model has a target definition block (provided by the vendor) that specifies the hardware the model will run on. There are other blocks in the vendor toolchain that are used to interface with the hardware (send CAN messages, read from GPIO, etc) and those blocks also require the target defintion block exist in the model in order for the right settings to show up.
This is fine when I have the top level model open, but I also make use of a lot of subsystem references, so its very common for a subsystem reference to contain a "Read CAN Message" block but no target definition block. This is painful for comparing code between changes because if I open the subsystem reference by itself I don't see any of the mask settings.
I tried just putting a target definition block in every subsystem reference but when I try to compile the model it throws an error because the model isn't allowed to have more than one target definition block. I am talking with the vendor to see if they can make any improvements to their toolchain to solve this issue, but I also wanted to ask if there was any way to handle this in Simulink myself.
The only idea I have is to make a block that acts as a wrapper to the target definition block. The wrapper block would have a callback function that gets called before compiling the model. The callback would find the target definition block at the top level of the model and comment out all of the other wrapper blocks to prevent errors. Is this a good way to do this or is there some SIMULINK functionality I am not aware of that would do this for me?
Thanks!
0 comentarios
Respuestas (1)
Fangjun Jiang
el 9 de En. de 2024
I don't see a solution other than, either
0 comentarios
Ver también
Categorías
Más información sobre Event Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!