Mapping a Reference
Unless specified otherwise (see Initialization of Explicit References), explicit references must be mapped to non-reference elements to grant initialization of the reference.
Note |
|---|
Explicit references must not be mapped to arrays, matrices or records used as messages. If they are, an error (MMdl3024) is issued during code generation: Cannot use the address of a message object <name>. |
- Open the data editor for the component that contains the reference.
- In the data editor for the component. select the desired data set.
- In the "Locals" or "Globals" tab, select the reference.
Open the data editor for the reference.
The "Value" combo box lists all elements available for mapping. Initialization of Explicit References describes the rules for initialization via mapping.
- In the data editor for explicit references, select a non-reference element from the "Value" combo box.
Click OK to close the data editor for the reference.
In the data editor of the component, the name of the mapped element appears in the "Data" column of the reference.
Note
The mapping is stored with the currently selected data set of the component. If you change the data set, you must map the reference again.
As an alternative, you can open the data editor for the reference directly from the component editor, via the Data option in the Edit menu or the context menu. If you do so, the mapping belongs to the currently selected data set.
See also