Hauptinhalt

Modellreferenzen

R2026b
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 in Simulink.

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

Näheres zum Erstellen einer sofort lauffähigen Version eines Simulink®-Modells, bei der Prüfungen auf erneutes Erstellen übersprungen werden, finden Sie unter Model Publishing (Simulink Coder).

Näheres zum Verbergen des geistigen Eigentums in einem Modell finden Sie unter 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

Model blockModelReference another model to create model hierarchy
Variant Subsystem blockVariant SubsystemTemplate subsystem containing Subsystem blocks as variant choices

Funktionen

alle erweitern

depviewAnalyze and visualize model reference 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.refreshRefresh Model block to reflect changes to referenced model
Simulink.SubSystem.convertToModelReferenceConvert subsystems to models
slbuildGenerate and compile standalone or model reference code from model
slxcinfoQuery contents of Simulink cache files
slxcmergeMerge Simulink cache files in new file (Seit R2026a)
slxcunpackUnpack simulation and code generation targets from Simulink cache file
createExternalParametersAlternateSourceCreate alternate value source for published model external parameters (Seit R2026b)
slxpinfoHigh-level information about published or protected model (Seit R2024b)
unpackPublishedModelDataSourcesUnpack original data sources from published model (Seit R2026b)
unpackPublishedModelSupplementalFilesUnpack supplemental files from published model (Seit R2026b)
slxpinfoHigh-level information about published or 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

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 artificial 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 (Seit R2022a)
Include custom code for referenced modelsOption to use custom code in model reference simulation target
Model dependenciesData and design files that potentially impact simulation results
Perform consistency check on parallel poolOption to perform checks on parallel pool before starting parallel build
Pass fixed-size scalar root inputs by value for code generationOption to pass scalar input to model by reference or value
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
Insufficient maximum 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 Files PaneView, save, and close referenced subsystems and models

Themen

Festlegung, wann Modelle referenziert werden

Erstellung von Modellreferenzen

Konfiguration von Modellreferenzen

Simulation von Modellhierarchien

Verwandte Informationen

Enthaltene Beispiele