I have done some experimentation with MBDT in Simulink models with Referenced Models. I have learned that each referenced model must include a MBDT configuration block or errors will be raised during Build. The configuration block must be included in the referenced model even if the referenced model does not contain any (other) MBDT functionality.
Are referenced models intentionally supported by MBDT? What are the limitations? Are there any other things I should know about using MBDT and referenced models?
Hi @mariuslucianand ,
It confuses me...
We have Matlab 2020b.
From the example model for S12Z, I changed only the PI-controller for Id-current into a referenced model (with referenced configuration set from top level) .
Both with and without the block "MCD_MC9S12ZVMx_Config_Information" in the referenced model, It could successfully build and load the model to EVB.
Hi @nofake_drstrang ,
On some of our toolboxes, we placed the required settings (target mcu, toolchain flags, etc.) for building the model inside the main config block. As a result, you had to add the main config block inside the referenced models otherwise, the build would fail because it can't retrieve these settings.
On S12Z, these settings are placed in the model configuration set. But another functionality of the main config block is to help you set up your model.
To build the model you need to select the system target file that corresponds to your mcu family, from the Model Configuration dialog (Ctrl+E) -> Code Generation panel. You can add the main config block, and it will do that automatically. Or you can skip adding this block and select the desired system target file by hand.
In your case it works with and without because the correct system target file is already selected in the model configuration set.
You can add the main config block only to set up the model and remove it, and your model will still build successfully.
The referenced models are intentionally supported by our toolbox, but we didn't test referenced models with referenced config set.
Hello @ranulf ,
The only limitation we know is that you have to include the Configuration block in the reference models as well. Adding Configuration block is not intentional. Adding our block in the reference models, should not affect the simulation.
@paulvlase, can you please comment on this?