Hauptinhalt

Die Übersetzung dieser Seite ist veraltet. Klicken Sie hier, um die neueste Version auf Englisch zu sehen.

Modellreferenzen

Wiederverwendung von Modellen als Blöcke in anderen Modellen

Eine Modellreferenz ist eine Referenz auf ein anderes Modell mithilfe eines Model-Blocks. Diese Referenzen schaffen eine Modellhierarchie. Jedes referenzierte Modell hat eine definierte Schnittstelle, die die Eigenschaften seiner Eingaben und Ausgaben festlegt. Die definierte Schnittstelle macht das Verhalten des referenzierten Modells unabhängig von seinem Kontext in der Modellhierarchie. Modellreferenzen sind ideal für die Wiederverwendung von Code, Unit-Tests, parallele Builds und große Komponenten. Sie können auch Dateikonflikte reduzieren und Probleme zusammenführen.

Um festzustellen, ob referenzierte Modelle Ihre Modellierungs-Anforderungen erfüllen, siehe Component-Based Modeling Guidelines.

Informationen über die Codegenerierung für Modellreferenzhierarchien finden Sie unter Referenced Models (Simulink Coder).

Um ein geschütztes Modell zu erstellen, siehe Model Protection (Simulink Coder).

Wie Sie SIL/PIL-Tests für eine Modellreferenzhierarchie durchführen, erfahren Sie unter SIL and PIL Simulations (Embedded Coder).

Blöcke

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

Funktionen

alle erweitern

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 (Seit R2023b)
Simulink.BlockDiagram.refreshBlocksUpdate variants, linked blocks, and model references to reflect changes (Seit 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
Simulink.SubSystem.convertToModelReferenceConvert subsystems to models
slbuildBuild standalone executable file or model reference target for model
slxcinfoQuery contents of Simulink cache files
slxcunpackUnpack simulation and code generation targets from Simulink cache file
slxpinfoHigh-level information about protected model (Seit R2024b)
Simulink.ProtectedModel.createHarnessCreate harness model that provides isolated environment for testing protected model
Simulink.ProtectedModel.getPublisherReturn information about publisher that signed the protected model
Simulink.ProtectedModel.verifySignatureVerify digital signature on protected model
Simulink.ProtectedModel.suppressSignatureVerificationSuppress digital signature verification of protected models

Modelleinstellungen

alle erweitern

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 referencedmodelsOption to check consistency of scheduling and sample time in referenced models
Total number of instances allowed per topmodelNumber 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 themodelOption to pass propagated signal names out of referenced model
Use local solver whenreferencing modelOption to use local solver to solve referenced model as separate system of equations (Seit R2022a)
Model dependenciesUser-created files and data that potentially impact simulation results
Perform consistencycheck on parallel poolOption to perform checks on parallel pool before starting parallel build (Seit R2021a)
Include custom code forreferenced modelsOption to use custom code in model reference simulation target
Pass fixed-size scalar root inputs by value for codegenerationOption 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 explicitfinal value for model argumentsDiagnostic action to take for model argument with default value at top-level model reference
Insufficientmaximum identifier lengthDiagnostic action to take when maximum identifier length is too short to ensure unique global identifiers

Tools

Model Reference Conversion AdvisorConvert subsystems to referenced models
Referenced FilesPaneView, save, and close referenced subsystems and models

Themen

Festlegung, wann Modelle referenziert werden

Erstellung von Modellreferenzen

Konfiguration von Modellreferenzen

Simulation von Modellhierarchien

Enthaltene Beispiele