0
votes

I have a huge Simulink model and I am testing some options to improve its performance. The model is implemented using a library for reusable components and subsystem for the hierarchy and organization. I was wondering if converting some subsystems to model reference will improve performance, besides other advantages. The problem is that every single library component is a masked subsystem itself, and so far I couldn't figure out how to convert a masked subsystem to a model reference. A error message appears when trying to convert:

Invalid usage of convertToModelReference. The subsystem to be converted must be an atomic, or triggered subsystem block. Cannot convert a virtual subsystem to a model

Reading simulink documentation did not help.

My questions is:

  1. Is it possible to convert a masked subsystem to a model reference?
  2. If yes, do I need to make some adjustments in every masked subsystem/library block through the whole hierarchy? (Or only in the reespective top tier block that I am trying to convert?)
  3. What is this error message about?
2

2 Answers

1
votes

In addition to what Phil said, you can only convert an atomic subsystem into a referenced model. An atomic subsystem means that the subsystem executes as a whole rather than the hierarchy of the model being flattened during compilation, as with virtual subsystems. For more details, see the documentation. You can have library components within referenced models, but there are a number of limitations, see Simulink Model Referencing Requirements and Model Referencing Limitations.

Despite the constraints, model referencing is generally advised as the way to approach large-scale modelling and it should give you performance improvements, as the referenced models run in accelerated mode (unless otherwise configured), and are rebuilt only when structural changes are made to the model. See Componentization Guidelines in the documentation for more details.

1
votes

In my experience that's a catch all error message, which basically means that something is wrong (but not necessary the obvious virtual subsystem problem that it seems to indicate), but the converter doesn't have enough "smarts" to give a very specific fix to the problem.

Sometimes the problem is that parameters needed by the reference block aren't being passed through the mask to it correctly. But you most likely need to look at various of the limitations of model referencing and work through the potential issues.

Depending on how many conversions you have to do you might find manually converting the subsystems (by copying them into new models and configuring the new models manually) is less frustrating that trying to figure out why the automatic conversion is not working.