Configure Simulink® model workspace parameters and signals for AUTOSAR run-time calibration and measurement.
Open the example model autosar_swc_counter.slx
.
open_system('autosar_swc_counter')
From the Apps tab, open the AUTOSAR Component Designer app. Open the Code Mappings editor and the Property Inspector. In the Code Mappings editor, select the Parameters tab. Expand the list of available model parameters and select INC
. In the Mapped To drop-down list, select ConstantMemory
.
Selecting a parameter displays the parameter attributes in the Property Inspector. Use the Property Inspector to modify the parameter attributes. For more information about parameter code and calibration attributes, see Map Model Workspace Parameters to AUTOSAR Component Parameters.
If you have Simulink Coder and Embedded Coder software, you can generate algorithmic C code and AUTOSAR XML (ARXML) component descriptions. You can test the generated code in Simulink or integrate the code and descriptions into an AUTOSAR run-time environment.
When you generate code:
Exported ARXML files contain CONSTANT-MEMORYS
descriptions for parameters that you configured as ConstantMemory
. In the AUTOSAR run-time environment, calibration tools can access AUTOSAR ConstantMemory
blocks for measurement and calibration.
Generated C code declares and references the constant memory parameters.
Open the example model autosar_swc_counter.slx
, if it is not already open.
From the Apps tab, open the AUTOSAR Component Designer app. Open the Code Mappings editor and the Property Inspector. In the Code Mappings editor, select the Signals/States tab. Expand the list of available signals and select equal_to_count
. In the Mapped To drop-down list, select StaticMemory
.
Selecting a signal highlights the signal in the model diagram and displays the signal attributes in the Property Inspector. Use the Property Inspector to modify the signal attributes. For more information about signal code and calibration attributes, see Map Block Signals and States to AUTOSAR Variables.
If you have Simulink Coder and Embedded Coder software, you can generate algorithmic C code and AUTOSAR XML (ARXML) component descriptions. You can test the generated code in Simulink or integrate the code and descriptions into an AUTOSAR run-time environment.
When you generate code:
Exported ARXML files contain STATIC-MEMORYS
descriptions for signals and states that you configured as StaticMemory
. In the AUTOSAR run-time environment, calibration tools can access AUTOSAR StaticMemory
blocks for measurement and calibration.
Generated C code declares and references the static memory variables.