-
Open the
ExternalInterfaces library by searching for
it, see
Open with Search.
The
ExternalInterfaces library is added to the
list in the
Package Browser.
-
From the
Package Browser, expand
.
-
In the
tree
under
Export, right-click
toSimulink and select
Call Function.
The
ExternalInterfaces.Export.toSimulink dialog box
is displayed.
-
In the
Model name area of the dialog box:
-
Click
Edit
.
The
Select Model dialog box appears.
-
Select the model you want to export.
-
Click
OK.
The model name is added to the dialog box.
-
In the
Model version area of the dialog box, enter
"x.x" where
x.x is the version of the model. An example
could be
"3.2"
-
In the
Export directory area of the dialog box, enter
"E:/Export" (By default, the
default directory (cd) is
selected.)
In this example, the data for
Modelica.Mechanics.Rotational.Examples.CoupledClutches
model version
3.2 is exported to the
E:/Export folder.
-
Click the arrow on the right of a box to access the following
commands:
- Edit: to edit the box.
- Edit Text: to edit the box in a
separate dialog box.
- Copy Default: to copy the default
value (defined in the class) to the box.
-
Do one of the following:
- Click
OK: The export function is started and when
it has finished the dialog box closes.
- Click
Info: A dialog box is displayed which gives
a summary of the export parameters.
- Click
Execute: The export function is started and
when it has finished the dialog box remains open.
- Click
Copy Call: The export function and its
parameters are copied to the clipboard. You can then paste them into the
scripting command window or into a script (.mos) file.
- Click
Close: The export function is dismissed and
the dialog box closes.
If you click
OK or
Execute:
- The
Modelica Scripting Window dialog box is
displayed and shows the status of the function.
- The results are computed and exported.
The exported files are saved in the
Export directory you specified. Typical results
files are listed below:
- buildlog.txt
- dsin.txt
- dsmodel.c
- dymModelInfo.m
- dymosim.exe
- dymosim.exp
- dymosim.lib
- dymosimg.exe
Note:
The simulation run-time code added to
dsmodel.c when exporting for use in Simulink Coder
does not contain the most advanced routines from the binary link libraries. It
is therefore, for example, not possible to export models with dynamic state
selection for use on HILS platforms.