Main Content

Configure AUTOSAR Calibration Component

An AUTOSAR calibration parameter component (ParameterSwComponent) contains calibration parameters that can be accessed by AUTOSAR software components (SWCs) using an associated provider port. You can import a calibration component from ARXML code into Simulink® or use AUTOSAR.Parameter data objects to create a calibration component in Simulink.

To create a calibration component in Simulink, open the AUTOSAR parameters in your model and configure them for export in a calibration component. For example:

  1. Open a model configured for AUTOSAR that has AUTOSAR.Parameter data objects in the base workspace or data dictionary, or to which you can add AUTOSAR.Parameter data objects.

  2. Open an AUTOSAR parameter from the base workspace or data dictionary. In the AUTOSAR.Parameter dialog box, set Storage class to CalPrm. Use these attributes to configure the parameter for export in a calibration component:

    • HeaderFile — Optionally specify the name of the AUTOSAR software component header file that declares the calibration parameter.

    • ElementName, PortName, and InterfacePath — Associate the calibration parameter with a specific AUTOSAR element, AUTOSAR port, and AUTOSAR interface. Specify an element name, a port name, and an interface path.

    • CalibrationComponent — Qualified name of the calibration component to be exported, containing this parameter.

    • ProviderPortName — Short name of the provider port associated with the calibration component.

  3. Apply changes and save the model.

When you generate code from the model:

  • The software exports the calibration components specified for the AUTOSAR calibration parameters. For example, here is an excerpt of ParameterSwComponent XML exported based on the configuration of the calibration parameter K.

    <AR-PACKAGE>
      <SHORT-NAME>counter_swc</SHORT-NAME>
      <ELEMENTS>
        <PARAMETER-SW-COMPONENT-TYPE UUID="...">
          <SHORT-NAME>counter</SHORT-NAME>
          <PORTS>
            <P-PORT-PROTOTYPE UUID="...">
              <SHORT-NAME>pCounter</SHORT-NAME>
              <PROVIDED-COM-SPECS>
    ...
                <PARAMETER-PROVIDE-COM-SPEC>
                  <INIT-VALUE>
                    <CONSTANT-REFERENCE>
                      <SHORT-LABEL>K</SHORT-LABEL>
                      <CONSTANT-REF DEST="CONSTANT-SPECIFICATION">/Company/Powertrain/
                                                       DataTypes/Ground/K</CONSTANT-REF>
                    </CONSTANT-REFERENCE>
                  </INIT-VALUE>
                  <PARAMETER-REF DEST="PARAMETER-DATA-PROTOTYPE">/CalibrationComponents/
                                                            counter_if/K</PARAMETER-REF>
                </PARAMETER-PROVIDE-COM-SPEC>
    ...
              </PROVIDED-COM-SPECS>
              <PROVIDED-INTERFACE-TREF DEST="PARAMETER-INTERFACE">/CalibrationComponents/
                                                     counter_if</PROVIDED-INTERFACE-TREF>
            </P-PORT-PROTOTYPE>
          </PORTS>
        </PARAMETER-SW-COMPONENT-TYPE>
      </ELEMENTS>
    </AR-PACKAGE>
  • Parameter initial values are exported on the ParameterProvideComSpec in the ParameterSwComponent and the ParameterRequireComSpec in the ApplicationSwComponent. Here is an excerpt of the exported ParameterRequireComSpec XML.

    <R-PORT-PROTOTYPE UUID="...">
      <SHORT-NAME>rCounter</SHORT-NAME>
      <REQUIRED-COM-SPECS>
    ...
        <PARAMETER-REQUIRE-COM-SPEC>
          <INIT-VALUE>
            <CONSTANT-REFERENCE>
              <SHORT-LABEL>K</SHORT-LABEL>
              <CONSTANT-REF DEST="CONSTANT-SPECIFICATION">/Company/Powertrain/DataTypes/
                                                                 Ground/K</CONSTANT-REF>
            </CONSTANT-REFERENCE>
          </INIT-VALUE>
          <PARAMETER-REF DEST="PARAMETER-DATA-PROTOTYPE">/CalibrationComponents/counter_if/
                                                                          K</PARAMETER-REF>
        </PARAMETER-REQUIRE-COM-SPEC>
    ...
      </REQUIRED-COM-SPECS>
      <REQUIRED-INTERFACE-TREF DEST="PARAMETER-INTERFACE">/CalibrationComponents/counter_if
                                                                 </REQUIRED-INTERFACE-TREF>
    </R-PORT-PROTOTYPE>

For calibration component parameters, after you export your AUTOSAR components, you must include your calibration interface definition XML file to import the parameters into an authoring tool.

Note

Use the CalPrm CSC attributes CalibrationComponent and ProviderPortName only to originate a calibration component in Simulink, not for a calibration component originated in an AUTOSAR authoring tool.

See Also