Main Content

La traducción de esta página aún no se ha actualizado a la versión más reciente. Haga clic aquí para ver la última versión en inglés.

Referencias del modelo

Vuelva a utilizar los modelos como bloques en otros modelos

Una referencia de modelo es una referencia a otro modelo usando un bloque Model. Estas referencias crean la jerarquía del modelo. Cada modelo referenciado tiene una interfaz definida que especifica las propiedades de sus entradas y salidas. Dicha interfaz hace que el comportamiento del modelo referenciado sea independiente de su contexto en la jerarquía de modelos. Las referencias de modelo son ideales para reutilizar el código, las pruebas unitarias, las construcciones paralelas y los componentes de gran tamaño. También pueden reducir la contención de archivos y los problemas de fusión.

Para determinar si los modelos referenciados cumplen sus requisitos de modelado, consulte Component-Based Modeling Guidelines.

Para más información sobre la generación de código para las jerarquías de referencias de modelos, consulte Referenced Models (Simulink Coder).

Para crear un modelo protegido, consulte Model Protection (Simulink Coder).

Para realizar pruebas de SIL/PIL en una jerarquía de referencia de un modelo, consulte SIL and PIL Simulations (Embedded Coder).

Bloques

ModelReference another model to create model hierarchy
Variant ModelTemplate subsystem containing Subsystem blocks as variant choices

Funciones

expandir todo

depviewAnalyze and visualize model referencing dependencies with or without library dependencies
find_mdlrefsFind referenced models and Model blocks in model hierarchy
pathsToReferencedModelModel hierarchy path composed of referenced models and Model blocks (desde R2023b)
Simulink.BlockDiagram.refreshBlocksUpdate variants, linked blocks, and model references to reflect changes (desde R2023a)
Simulink.BlockPathFully specified Simulink block path
Simulink.fileGenControlSpecify root folders for files generated by diagram updates and model builds
Simulink.ModelReference.refreshForce update to Model block to reflect changes to referenced model (desde R2020a)
Simulink.SubSystem.convertToModelReferenceConvert subsystems to models
slbuildBuild standalone executable file or model reference target for model
slxcinfoQuery contents of Simulink cache files (desde R2020b)
slxcunpackUnpack simulation and code generation targets from Simulink cache file (desde R2020b)
Simulink.ProtectedModel.createHarnessCreate harness model that provides isolated environment for testing protected model (desde R2020b)
Simulink.ProtectedModel.getPublisherReturn information about publisher that signed the protected model (desde R2020a)
Simulink.ProtectedModel.verifySignatureVerify digital signature on protected model (desde R2020a)
Simulink.ProtectedModel.suppressSignatureVerificationSuppress digital signature verification of protected models (desde R2020b)

Ajustes de modelos

expandir todo

RebuildOption to conditionally, always, or never rebuild model reference targets
Never rebuild diagnosticDiagnostic action to take when model reference target must be rebuilt
Enable parallel model reference buildsOption to build a model reference hierarchy in parallel whenever possible
MATLAB worker initialization for buildsOptions for how to initialize MATLAB workers for parallel builds
Enable strict scheduling checks for referenced modelsOption to check consistency of scheduling and sample time in referenced models
Total number of instances allowed per top modelNumber of references to this model that can occur in another model
Propagate sizes of variable-size signalsOption to specify how variable-size signals propagate through referenced models
Minimize algebraic loop occurrencesOption to try to eliminate artificial algebraic loops related to referenced model
Propagate all signal labels out of the modelOption to pass propagated signal names out of referenced model
Use local solver when referencing modelOption to use local solver to solve referenced model as separate system of equations (desde R2022a)
Model dependenciesUser-created files and data that potentially impact simulation results
Perform consistency check on parallel poolOption to perform checks on parallel pool before starting parallel build (desde R2021a)
Include custom code for referenced modelsOption to use custom code in model reference simulation target
Pass fixed-size scalar root inputs by value for code generationOption to pass scalar input to model by reference or value
Model block version mismatchDiagnostic action to take when Model block does not represent current version of referenced model
Port and parameter mismatchDiagnostic action to take when port or parameter does not match between Model block and referenced model
Unsupported data loggingDiagnostic action to take when data logging is unsupported
No explicit final value for model argumentsDiagnostic action to take for model argument with default value at top-level model reference (desde R2020b)
Insufficient maximum identifier lengthDiagnostic action to take when maximum identifier length is too short to ensure unique global identifiers

Herramientas

Model Reference Conversion AdvisorConvert subsystems to referenced models
Referenced Files PaneView, save, and close referenced subsystems and models (desde R2020b)

Temas

Determinar cuándo referenciar los modelos

Crear referencias de modelos

Configurar referencias de modelos

Simular jerarquías de modelos

Ejemplos destacados