Package: AUTOSAR
Superclasses:
Specify computation method, calibration value, data type, and other properties of AUTOSAR dual-scaled parameter
For run-time calibration of AUTOSAR component data, R2018b and R2019a introduced graphical mapping of model workspace parameters and internal signals, states, and data stores to AUTOSAR component internal parameters and variables by using the Code Mappings editor. For more information, see Map AUTOSAR Elements for Code Generation.
This class extends the AUTOSAR.Parameter
class so that you can define
an object that stores two scaled values of the same physical value. For example, for
temperature measurement, you can store a Fahrenheit scale and a Celsius scale with conversion
defined by a computation method that you provide. Given one scaled value, the
AUTOSAR.DualScaledParameter
can compute the other scaled value using the
computation method.
A dual-scaled parameter has:
A calibration value. The value that you prefer to use.
A main value. The real-world value that Simulink® uses.
An internal stored integer value. The value that is used in the embedded code.
You can use AUTOSAR.DualScaledParameter
objects in your model for both
simulation and code generation. The parameter computes the internal value before code
generation via the computation method. This offline computation results in leaner generated
code.
If you provide the calibration value, the parameter computes the main value using the computation method. This method can be a first-order rational function.
x
is the calibration value.
y
is the main value.
a
and b
are the coefficients of the CalToMain
compute numerator.
c
and d
are the coefficients of the CalToMain
compute denominator.
If you provide the calibration minimum and maximum values, the parameter computes minimum and maximum values of the main value. Simulink performs range checking of parameter values. The software alerts you when the parameter object value lies outside a range that corresponds to its specified minimum and maximum values and data type.
To define an AUTOSAR.DualScaledParameter
object, in the MATLAB® Command Window, instantiate the object and assign it a name.
param = AUTOSAR.DualScaledParameter;
Open the workspace object to view and modify its properties.
This tab shows the properties inherited from the AUTOSAR.Parameter
class. For more information, see AUTOSAR.Parameter
.
Calibration value of the parameter. The value that you prefer to use. The default
value is []
(unspecified). Specify a finite, real, double
value.
Before specifying Calibration value, you must specify CalToMain numerator and CalToMain denominator to define the computation method. The parameter uses the computation method and the calibration value to calculate the real-world value that Simulink uses.
Minimum value for the calibration parameter. The default value is
[]
(unspecified). Specify a finite, real, double scalar
value.
Before specifying Calibration minimum, you must specify CalToMain numerator and CalToMain denominator to define the computation method. The parameter uses the computation method and the calibration minimum value to calculate the minimum or maximum value that Simulink uses. A first order rational function is strictly monotonic, either increasing or decreasing. If it is increasing, setting the calibration minimum sets the main minimum value. If it is decreasing, setting the calibration minimum sets the main maximum.
If the parameter value is less than the minimum value or if the minimum value is outside the range of the parameter data type, Simulink generates a warning. In these cases, when updating the diagram or starting a simulation, Simulink generates an error.
Maximum value for the calibration parameter can have. The default value is
[]
(unspecified). Specify a finite, real double scalar
value.
Before specifying Calibration maximum, you must specify CalToMain numerator and CalToMain denominator to define the computation method. The parameter uses the computation method and the calibration maximum value to calculate the corresponding maximum or minimum value that Simulink uses. A first order rational function is strictly monotonic, either increasing or decreasing. If it is increasing, setting the calibration maximum sets the main maximum value. If it is decreasing, setting the calibration maximum sets the main minimum.
If the parameter value is less than the minimum value or if the minimum value is outside the range of the parameter data type, Simulink generates a warning. In these cases, when updating the diagram or starting a simulation, Simulink generates an error.
Specify the numerator coefficients a
and b
of the first-order linear equation:
The default value is []
(unspecified). Specify finite, real
double scalar values for a
and b
. For example,
[1 1]
or, for reciprocal scaling, 1
.
Once you have applied CalToMain compute numerator, you cannot change it.
Specify the denominator coefficients c
and c
of the first-order linear equation:
The default value is []
(unspecified). Specify finite, real,
double scalar values for c
and d
. For example,
[1 1]
.
Once you have applied CalToMain compute denominator, you cannot change it.
Specify the name of the calibration parameter. The default value is
''
. Specify a text value, for example,
'T1'
.
Specify the measurement units for this calibration value. This field is intended
for use in documenting this parameter. The default value is ''
.
Specify a text value, for example, 'Seconds'
.
Simulink indicates whether the configuration is valid. The default value is
true
. If Simulink detects an issue with the configuration, it sets this field to
false
and provides information in the Diagnostic
message field. You cannot set this field.
If you specify invalid parameter settings, Simulink displays a message in this field. Use the diagnostic information to help you fix an invalid configuration issue. You cannot set this field.
Name | Access | Description |
---|---|---|
|
| Calibration value of this parameter. (See Calibration Attributes Tab > Calibration value.) |
|
| Calibration minimum value of this parameter. (See Calibration Attributes Tab > Calibration minimum.) |
|
| Calibration maximum value of this parameter. (See Calibration Attributes Tab > Calibration maximum.) |
|
| Numerator coefficients of the computation method. (See Calibration Attributes Tab > CalToMain compute numerator.) Once you have applied
|
|
| Denominator coefficients of the computation method. (See Calibration Attributes Tab > CalToMain compute denominator.) Once you have applied
|
|
| Name of the calibration parameter. (See Calibration Attributes Tab > Calibration name.) |
|
| Measurement units for this calibration parameter's value. (See Calibration Attributes Tab > Calibration units.) |
|
| Information about validity of configuration. (See Calibration Attributes Tab > Is configuration valid.) |
|
| If the configuration is invalid, diagnostic information to help you fix the issue. (See Calibration Attributes Tab > Diagnostic message.) |