La traduction de cette page n'est pas à jour. Cliquez ici pour voir la dernière version en anglais.
Références de modèle
Une référence de modèle est une référence à un autre modèle via un bloc Model. Ces références créent une hiérarchie de modèle. Chaque modèle référencé possède une interface définie qui spécifie les propriétés de ses entrées et sorties. Grâce à cette interface définie, le comportement du modèle référencé est indépendant de son contexte dans la hiérarchie de modèle. Les références de modèle sont idéales pour la réutilisation du code, les tests unitaires, les compilations en parallèle et les composants volumineux. Elles peuvent également minimiser les conflits d'accès et les problèmes de fusion de fichiers.
Pour déterminer si les modèles référencés répondent à vos exigences de modélisation, consultez la rubrique Component-Based Modeling Guidelines.
Pour en savoir plus sur la génération de code pour les hiérarchies de modèles de référence, consultez la rubrique Referenced Models (Simulink Coder).
Pour créer un modèle protégé, consultez la rubrique Model Protection (Simulink Coder).
Pour effectuer des tests en mode SIL/PIL avec une hiérarchie de de références de modèle, consultez la rubrique SIL and PIL Simulations (Embedded Coder).
Blocs
Model | Reference another model to create model hierarchy |
Variant Model | Template subsystem containing Subsystem blocks as variant choices |
Fonctions
Paramètres du modèle
Outils
Model Reference Conversion Advisor | Convert subsystems to referenced models |
Referenced Files Pane | View, save, and close referenced subsystems and models (depuis R2020b) |
Rubriques
Déterminer quand référencer des modèles
- Component-Based Modeling Guidelines
Consider componentization for large models and multiuser development teams. - Model Reference Basics
Decide whether to reference one model in another model. - Model Reference Requirements and Limitations
Model references have requirements and limitations relating to features such as reusability, simulation modes, masking, and debugging.
Créer des références de modèle
- Reference Existing Models
Include a model in another model. - Reference Protected Models from Third Parties
Use a protected model that you received from a third party. - Convert Subsystems to Referenced Models
Prepare a subsystem for conversion, convert the subsystem to a model, and compare simulation results before and after conversion. - Define Model Reference Interfaces
Ports in the referenced model correspond with ports at the model reference. Signals that cross the model boundary must meet certain requirements. - Inspect Model Hierarchies
Examine the contents, structure, model versions, and logged signals in a model hierarchy.
Configurer des références de modèle
- Set Configuration Parameters for Model Hierarchies
Configuration parameter values can be different in top models and referenced models. Some configuration parameter values have special requirements or behavior with model referencing. - Conditionally Execute Referenced Models
Execute referenced models conditionally, similar to conditionally executed subsystems. - Referenced Model Sample Times
A referenced model can inherit sample times from the model that references it. - Configure Instance-Specific Values for Block Parameters in a Referenced Model
When you model a reusable component as a referenced model, to configure each instance of the component to use different values for block parameters, create model arguments. - Parameterize a Referenced Model Programmatically
This example shows how to programmatically configure multiple instances of a referenced model to use different values for the same block parameter. - Group Multiple Model Arguments into a Single Structure
This example shows how to programmatically configure multiple instances of a referenced model to use different values for the same block parameter by using structures. - Configure Instance-Specific Data for Lookup Tables Programmatically
When you useSimulink.LookupTable
objects to store and configure lookup table data for ASAP2 or AUTOSAR code generation (for example, STD_AXIS or CURVE), you can configure the objects as model arguments.
Simuler des hiérarchies de modèles
- Choose Simulation Modes for Model Hierarchies
Select the simulation mode for models in a model hierarchy. - Manage Simulation Targets for Referenced Models
A simulation target, or SIM target, is a MEX-file that implements a referenced model that executes in accelerator mode. - Share Simulink Cache Files for Faster Simulation
Use Simulink cache files to share build artifacts that let you avoid the cost of a first-time build. - Override Model Reference Simulation Modes
When a top model simulates in normal mode, you can override the simulation mode used for model references without dirtying their parent models. - Reduce Update Time for Referenced Models by Using Parallel Builds
Reduce diagram update time for large model reference hierarchies by using parallel builds. - Simulate Conditionally Executed Referenced Models
Run a standalone simulation of a conditionally executed referenced model. - Simulate Multiple Referenced Model Instances in Normal Mode
Simulate a model that contains multiple instances of a referenced model.
Informations connexes
- Modélisation basée sur les composants
- Modélisation collaborative
- Systèmes variants
- Referenced Models (Simulink Coder)
- Model Protection (Simulink Coder)