Specifying a Reference

Note

Arrays, matrices and records used as messages must not be specified as explicit references. If they are, an error (MMdl794) is issued during code generation:

Element <name> is a message and a reference, but the combination is not allowed.

  1. In the specification editor, select the non-scalar element you want to use as explicit reference.
  2. Open the properties editor for the element.
  3. In the properties editor, activate the Reference option in the Attributes area.
  4. Activate the necessary access options in the Internal Access field.

    You can activate either Write for Referenced Element or Read for Referenced Element or both; you cannot deactivate both options.

    Note

    When Write for Referenced Element is enabled, the reference cannot be mapped to a parameter.

  5. Activate the necessary access options in the External Access field.

    Note

    The External Access field is not available for explicit references in AUTOSAR software components and projects.

    You can activate either Set() Method or Get() Method or both; or you can deactivate both.

  6. Close the properties editor.

    The reference must be initialized before it is used. If the initialization is missing, code generation returns an error message.

  7. Initialize the reference via one of the following possibilities:

  8. Edit the reference implementation.

See also

Opening the Properties Editor

Mapping a Reference

Using References Without Initialization

Implementing References

Explicit References