Sei sulla pagina 1di 16

Referencing Models

.
model
simulink

Ports & subsystems


instance

.
S-function
the referenced model's simulation target
.

simulation target .
Referencing Referencing
root model
- model parent
parent Referencing

Global data
global data

.
Model Referencing Subsystems
Model Referencing Subsystems .
1- Modular development

2- Inclusion by reference

.
3- Incremental loading

.
4- Incremental code generation
Real-Time Workshop
stand-alone applications
binaries binaries

.
Subsystems Model
Referencing .

Model Reference
Creating a Model Reference

set path
::

Inline parameters optimization

simulation
configuration parameters
optimization Inline

parameters

model

: ref1

:: model

ref1
solver
Fixed step

model reference parameters edit

:: scope step



global tunable parameters


global tunable parameters.
.

Using Model Arguments


Model Arguments
reference
reference Counter
:
1- Declare model workspace variables that determine the model's behavior as
model arguments
workspace workspace
global nontunable parameters
global tunable parameters
2- Assign values to the model arguments in each reference to the
parameterized model

Model Arguments
model view
explorer
::

:: model workspace

workspace workspace
MATLAB variable add

counter

::

Model Arguments
::

edit Model block's parameter


:: Model Argument

::
counter

Model Block Sample Times


simulation
target

- ) (
-
-
- fixed-step solver fixed step size
-
sample time propagation triggered sample time
-


Triggered subsystem
Function call
iterator subsystem

.
Blocks That Preclude Sample-Time Inheritance


simulation target
simulation target default

Discrete-Time Integrator

)From Workspace (if it has input data that contains time

)Probe (if probing sample time

Rate Limiter

Sine Wave

::
model

Referenced Model I/O
model:
Bus I/O Limitations
bus
1 bus object2 bus object workspace 3 bus Bus Creator blockIndex I/O Limitations

0 - or 1- based indexing

for
:

0- or 1-based indexing


Matching I/O Rates
rate
Building Simulation Targets
Simulation Targets S-function
simulation targets updating the
model's diagram edit slbuild .

.
targets .

slprj Simulink AcceleratorReal-
Time Workshop

Function-Call Models

Function-Call Generator
function-call model.

trigger trigger function call
Model
function call controller
ports & subsystem
model
simulation configure parameters
solver fixed step
Periodic sample time constraint
Ensure sample time independent
scalar
:

Browsing Model Reference Dependencies


Tools
Model Reference Graph
view_mdlrefs

Converting Subsystems to Model References



Convert to Model Block atomic subsystem

Potrebbero piacerti anche