There are two different ways to create new parameters. You can either:
To create a new formal parameter, you must ensure that the Model Properties plane is activated in the Property Editor window by clicking on the model background. Open the context menu in the Property Editor. Select New Parameter to create a new parameter entry in the model property list. MLDesigner creates a default collapsed entry that shows the new parameter name and a default value. MLDesigner generates a unique name for the new parameter that can be changed later.
By selecting a model instance, the property editor will show entries for all parameters defined by the referenced model component. Click with the right mouse button on any of these parameter entries to open the context menu. Then you can select menu items Export or Export as to create a new formal parameter for the model with the same parameter properties.
The difference between Export and Export as is that you can define the name of the exported parameter in the latter case. If a parameter with the name already exists MLDesigner generates a unique one by extending the specified name with an integer.
Exporting an instance parameter automatically links the actual instance parameter to the exported formal model parameter (see Linking Parameters).
The property editor can be used to change the properties of formal parameter definitions. The figure on the right shows the expanded parameter entry.
Activate the Module Properties plane in the property editor by clicking the background of the model. Then right-click on the parameter entry in the Property Editor window to open the context menu shown on the right. Select the Delete Parameter context menu option to delete the parameter.
Type name |
Description |
Example |
---|---|---|
int |
integer |
10 |
float |
floating point number |
0.2/PI |
complex |
pair specified as (real-part, imag-part) |
(1.0,2.0) |
string |
string |
this is a string |
fix |
fixed point numbers |
(2.546,3.5) |
intarray |
array of integers |
1 2 3 4 5 6 7 |
floatarray |
array of floating point numbers |
0.0 [10] 1.0 0.0 [10] |
complexarray |
array of complex numbers |
(0.1,0.2) (0.3,0.4) (0.5,0.6) |
stringarray |
array of strings |
this string array "has five" elements |
fixarray |
array of fixed point numbers |
41.78 2.546 [2] -3.5 |
precision |
precision for fixed point numbers |
3.5 |
boolean |
enumeration with values FALSE and TRUE |
FALSE |
enum |
enumeration with user-defined values |
|
expression |
an expression of constant values, parameters, ports and memories |
$Input+$Memory*$Parameter-3.2 |
file |
filename (obsolete) |
/tmp/input.txt |
filename |
filename |
$MLD_USER/output.txt |
filenamelist |
a list (array) of filenames |
|
datastruct |
data structure instance |
Root |
datastructname |
data structure name |
Root |
datastructmembername |
name of a composite data structure's member |
Byte1 |
modelname |
an XML or OCT model |
$MLD_USER/M/M.mml |
integrator |
an array describing continuous states |
see floatarray |
stateevent |
continuous state variable used by ODE solver |
see floatarray |