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.
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)
model — Model to validate handle | character vector | string scalar
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.