MATLAB: What does this build error about components not existing for a referenced model mean

simulink

What does this build error about components not existing for a referenced model mean?
The component 'SimEvents (Simulink.CustomCC)' of the model '__MODEL_NAME__' does not exist for the model '__REFERENCED_MODEL_NAME__'.

Best Answer

  • Configuration sets are built up of components. This can be almost exactly mapped to the panes on the left of the configuration parameters windows. Some of these component names include Solver, Data Import/Export, Optimizations, Diagnostics, etc.
    Now for the _MODEL_NAME_ model there is an additional component called 'SimEvents' which does not exist in the _REFERENCED_MODEL_NAME_. For a long time now, there has been the requirement that for model reference builds, the configuration sets need to match. So when the parent model has this component added and the referenced model does not, then we get the mismatch error that we see.
    If there are no SimEvents blocks in the models now, the easiest solution is to just remove the 'SimEvents' component from the config set. There are a few ways to go about doing this, but I think the easiest is to just get a handle to the active config set and detatch the component. The following commands should sort you out:
    >> csActive = getActiveConfigSet('__MODEL_NAME__');
    >> csActive.detachComponent('SimEvents');
    This will just remove the 'SimEvents' component from the active config set from _MODEL_NAME_. It will modify the model, so the model will need to be saved after this.