Main Content

autosar.api.validateModel

Validate AUTOSAR properties and mapping of金宝appmodel

Description

example

autosar.api.validateModel(model)validates the AUTOSAR properties and Simulink®to AUTOSAR mapping ofmodel.

IfSimulink Coder™and Embedded Coder®are not licensed on your system, the function validates only the Simulink to AUTOSAR mapping ofmodel.

This function is equivalent to using theValidatebuttonin the Code Mappings editor view of an AUTOSAR component model.

Examples

collapse all

This example opens a model in which a Simulink inport is not mapped to an AUTOSAR port and data element. Initial validation reports the error and fails. After the inport is mapped, validation succeeds.

hModel ='autosar_model_with_unmapped_port'; load_system(hModel);% Initial validation failstryautosar.api.validateModel(hModel)catchvalidationErr throw(validationErr)end
Block 'autosar_model_with_unmapped_port/Input' is not mapped to an AUTOSAR port element.
% Map the unmapped portslMap=autosar.api.getSimulinkMapping(hModel); mapInport(slMap,'Input','Input','Input','ImplicitReceive');% Second validation succeedsautosar.api.validateModel(hModel)

Input Arguments

collapse all

Loaded or open model for which to validate AUTOSAR properties and Simulink to AUTOSAR mapping, specified as a handle, character vector, or string scalar representing the model name.

Example:'my_model'

Version History

Introduced in R2016a