Adding a Return Value to an SWC Method

  1. Open the signature editor for the method.
  2. Go to the Return tab of the signature editor.
  3. Activate the Return Value option, if the method is to have a return value.
  4. Specify the data type of the return value.

    Note

    Since ASCET V6.3, composite and complex return values are always explicit references, even though they are not marked with the overlay icon .

  5. If you selected an array or matrix of enumeration or record type, Closedthe following happens.

    The Choose a enumeration type or Choose a record type window opens.

    • In the "Database"/"Workspace" field, select the enumeration or record you want to use, then click OK.
  6. To edit the size of an array or matrix selected as return value, Closeddo the following.

    1. Open the Return menu or the context menu and select Edit Max Size.

      The Max and Variant Size for: <argument> window opens.

    2. In the Max Size x (and Max Size y) field(s), enter the array or matrix size.
    3. To specify a variant size, use the Variant Size x (and Variant Size y) field(s) to select the system constants you want to use as dimension values.

      Both normal and user-defined system constants can be used. The value of a system constant should be in the range 1 ... X (or 1 ... Y).

    4. To specify a variable size, use the Variant Size x (and Variant Size y) field(s) to select *.

      The Max Size x (and Max Size y) field(s) are disabled.

    5. Click OK to close the window and accept your settings.
  7. Type in a comment and a unit.
  8. If you selected an array, matrix, or component as type, use the Read for Referenced Element and Write for Referenced Element options to set internal access to the referenced element to Read, Write, or both.

Note

If you use matrices as interrunnable variables, make sure that the Number of dimensions for fixed matrixestarget option is set to Two-dimensional.

Otherwise, a warning WMdl653 is issued during AUTOSAR code generation. By default, this warning is promoted to an error.

See also

Editing the Signature of a Runnable or Method

Introduction – Variant Size of Arrays and Matrices

Introduction – Variable Size for Arrays and Matrices

Introduction – Explicit References

Introduction – Constants and System Constants