Main Content

autosar.api.validateModel

Validate AUTOSAR properties and mapping of Simulink model

Description

example

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

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

This function is equivalent to using the Validate button in 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 fails
try
    autosar.api.validateModel(hModel)
catch validationErr
    throw(validationErr)
end
Block 'autosar_model_with_unmapped_port/Input' is not mapped to an AUTOSAR port element.
% Map the unmapped port
slMap=autosar.api.getSimulinkMapping(hModel);
mapInport(slMap,'Input','Input','Input','ImplicitReceive');

% Second validation succeeds
autosar.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'

Introduced in R2016a