Main Content

validate

Validate AUTOSAR properties and mappings for Software Composition block or AUTOSAR architecture model

Since R2023b

    Description

    validate(archObj) validates the AUTOSAR properties and mappings contained within the composition or architecture model specified by argName.

    example

    Examples

    collapse all

    Load an AUTOSAR composition or AUTOSAR architecture model. This example uses the AUTOSAR architecture model autosar_tpc_composition, which contains the composition Sensors.

    openExample("autosar_tpc_composition");
    archModel = autosar.arch.loadModel("autosar_tpc_composition");

    Validate the architecture model.

    validate(archModel);

    Validate the composition Sensors contained within the architecture model.

    sensors = archModel.Compositions;
    validate(sensors);

    If the composition or model fails validation an error is thrown.

    Error using autosar.arch.Composition/validate
    Composition export failed because of the following errors:
    Caused by:
        Models ('autosar_tpc_actuator', 'autosar_tpc_composition') 
        have inconsistent AUTOSAR schema version settings ('4.2', '4.1').

    Input Arguments

    collapse all

    Name of the composition or architecture model, specified as an autosar.arch.Model object or autosar.arch.Composition object.

    Example: archModel.Compositions(1)

    Example: myArchModel

    Version History

    Introduced in R2023b