I am developing a Simulink model that makes use of model referencing. The application is an automotive engine controller, making use of code generation.
Because of the requirements of the development platform, all of my model blocks need to be inside function-call subsystems, which are executed periodically by third-party code. I want to use model referencing inside these function-call subsystems.
This presents an issue when I use, e.g., the Discrete-Time Integrator block inside the referenced model. The referenced model is a discrete-time model and the Discrete-Time Integrator block requires absolute time. But the referenced model cannot inherit its sample time , so code generation fails when the Discrete-Time Integrator block is used.
The referenced model will be run periodically at a specified rate, so it would be completely acceptable to specify a sample time for the model. But if I specify a sample time for the referenced model as described in , code generation fails because referenced models are not allowed to specify their sample time priority.
It is possible to use the Discrete-Time Integrator block inside the function-call subsystem if it is not inside a referenced model, so it seems technically possible to achieve this goal -- perhaps I am missing some configuration.
How can I use the Discrete-Time Integrator block inside a referenced model in a function-call subsystem? Is there any documentation available that would help me understand the concepts and limitations more clearly?
Thank you in advance for your assistance.