Table of Contents
Model Argument
Outputs the value of a model command-line argument.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Sources/Signals')Description
When a model is executed, it is passed command-line arguments. These arguments are called the model arguments. The model arguments passed when connecting to a model from the Simulink diagram are specified in the MEX-file arguments entered on the Code Generation/Interface Pane. When running a model from Windows Explorer, the model arguments may be specified by right-clicking on the model executable and selecting Run on target from the context menu.
The Model Argument block allows additional arguments to be specified of the form:
-<name> [<value>]
where <name> is the name of the option, such as "threshold" and <value> is a value associated with the option. An explicit value is optional. Arguments which do not have an associated value are treated as Boolean quantities, where the implicit value is true if the option is present and false otherwise.
Explicit values are parsed and interpreted according to the datatype selected for the output of the block. The datatype is chosen
on the Signal Data Types tab. For instance, if the datatype is double
then a value such as 3.14 may be specified
in the model arguments. Likewise, if the datatype is int16
then only integer values in the range -32,768 to 32,767 may be entered.
The default value of a numeric argument may be specified in the Default value parameter.
The Model Argument block also supports strings. Strings are output as a null-terminated vector of uint8
quantities.
The String Display may be used to
display the value of a string as text. Double quotes surrounding the value in the model arguments are automatically removed.
The default value of a string argument may be specified in the Default string parameter.
Note that double quotes (") are not allowed in the model arguments because they are not understood by the MATLAB interpreter. To enter a double
quote, use the "%q" format specifier instead. For example, use %qmy directory with spaces in it%q
to specify a directory containing spaces.
Input Ports
This block has no input ports.
Output Ports
value
The value of the model argument.
Data Type Support
This block supports any of the standard Simulink built-in datatypes. Fixed-point is not supported. It also supports strings. Strings are output as
a null-terminated vector of uint8
values.
Parameters and Dialog Box
Main Pane
The Main pane of the dialog appears as follows:
Argument name
The name to give the argument. Argument names are case-sensitive and are not limited to a single character.
Has associated value
Whether this argument has an associated value. If this option is not checked then the argument is treated as a Boolean quantity, in which the implicit value is true if the argument is present and false otherwise. If this option is checked then a value must be explicitly specified for this argument.
Default value
The default value to use when the model argument is not provided. This parameter is only present when the Data type parameter is a numeric type or the data type is inherited by back propagation. The value is evaluated as a MATLAB expression.
Default string
The default string to use when the model argument is not provided. This parameter is only present when the Data type parameter is specified in the dialog and is the character type. The string is taken literally and is not evaluated.
Signal Data Types Pane
The Signal Data Types pane of the dialog appears as follows:
Data type mode
Sets the data type of the output to be inherited by back propagation or to be specified explicitly in the dialog.
Data type
Sets the data type of the output explicitly. If the datatype is set to char then the output will be a null-terminated
vector of uint8
values. In this case, the maximum length of this string must be specified in the
Maximum string length parameter.
Maximum string length
The maximum length of the string argument in code units (bytes), including the null-terminator. The output will be a vector of this length. This field is only used if the datatype is explicitly set to char.
Use variable-size output
Enabling this option causes the value output to be variable-size. In this case, as the string constant is modified, the size of the output varies dynamically. If this option is not checked then the output is a fixed-size vector. Refer to Variable-Size Signals for more information on variable-size signals.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
No |
||
Yes |
No |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
No |
||
Yes |
Yes |
||
Yes |
No |
||
Yes |
No |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
No |
|
S-Function Target |
No |
N/A |
|
Normal simulation |
Yes |
No |
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.