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. |
- In the specification editor, select the non-scalar element you want to use as explicit reference.
- Open the properties editor for the element.
- In the properties editor, activate the Reference option in the Attributes area.
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.
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.
Close the properties editor.
The reference must be initialized before it is used. If the initialization is missing, code generation returns an error message.
Initialize the reference via one of the following possibilities:
- Map the reference to a non-reference element.
- Use the reference without initialization.
- Edit the reference implementation.
See also