AUTOSAR.DualScaledParameter
Specify computation method, calibration value, data type, and other properties of AUTOSAR dual-scaled parameter
For run-time calibration of AUTOSAR data, R2018b and R2019a introduced graphical mapping of model elements to AUTOSAR component parameters and variables. In the Code Mappings editor, you select a Simulink® model-workspace parameter or internal signal, state, or data store. You map the selected element to an AUTOSAR component parameter or variable and modify its AUTOSAR calibration attributes. If you currently model AUTOSAR parameters or variables by using AUTOSAR parameter or signal objects in the base workspace, consider migrating to the Code Mappings editor workflow. For more information, see Map AUTOSAR Elements for Code Generation.
Description
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
andb
are the coefficients of the CalToMain compute numerator.c
andd
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.
Creation
Create an AUTOSAR.DualScaledParameter
object by using the
AUTOSAR.DualScaledParameter
function described below.
Description
DSParam = AUTOSAR.DualScaledParameter
returns an
AUTOSAR.DualScaledParameter
object with default property values.
Open the workspace object to view and modify its properties.
Properties
The Main Attributes tab shows the properties inherited from the
AUTOSAR.Parameter
class. For more information, see AUTOSAR.Parameter
.
The Calibration Attributes tab shows calibration properties for the dual-scaled parameter.
- Calibration value
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 compute numerator and CalToMain compute 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.
- Calibration minimum
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 compute numerator and CalToMain compute 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.
- Calibration maximum
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 compute numerator and CalToMain compute 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.
- CalToMain compute numerator
Specify the numerator coefficients
a
andb
of the first-order linear equation:The default value is
[]
(unspecified). Specify finite, real double scalar values fora
andb
. For example,[1 1]
or, for reciprocal scaling,1
.Once you have applied CalToMain compute numerator, you cannot change it.
- CalToMain compute denominator
Specify the denominator coefficients
c
andc
of the first-order linear equation:The default value is
[]
(unspecified). Specify finite, real, double scalar values forc
andd
. For example,[1 1]
.Once you have applied CalToMain compute denominator, you cannot change it.
- Calibration name
Specify the name of the calibration parameter. The default value is
''
. Specify a text value, for example,'T1'
.- Calibration units
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'
.- Is configuration valid
Simulink indicates whether the configuration is valid. The default value is
true
. If Simulink detects an issue with the configuration, it sets this field tofalse
and provides information in the Diagnostic message field. You cannot set this field.- Diagnostic message
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.
This table shows command-line information for the calibration properties.
Name | Access | Description |
---|---|---|
|
| Calibration value of this parameter. See Calibration value. |
|
| Calibration minimum value of this parameter. See Calibration minimum. |
|
| Calibration maximum value of this parameter. See Calibration maximum. |
|
| Numerator coefficients of the computation method. See CalToMain compute numerator. Once you have applied
|
|
| Denominator coefficients of the computation method. See CalToMain compute denominator. Once you have applied
|
|
| Name of the calibration parameter. See Calibration name. |
|
| Measurement units for this calibration parameter's value. See Calibration units. |
|
| Information about validity of configuration. See Is configuration valid. |
|
| If the configuration is invalid, diagnostic information to help you fix the issue. See Diagnostic message. |
Examples
Version History
Introduced in R2013b