Receiving from a Port with Status Request

Note

This instruction applies only to implicit read access with status request. For an instruction to specify explicit read access with status information, see Receiving from a Port – Block Diagram or Receiving from a Port – ESDL.

If your software component uses a SenderReceiver interface as Rport, you can specify a request for status information, i.e. the generation of the Rte_IStatus access macro, of an implicit read access.

  1. In the ASCET options window, Operating System\RTE-AUTOSAR 4.* node, configure the capabilities of your RTE generator.
  2. Open the SWC you want to edit.
  3. In the block diagram editor for SWCs, proceed Closedas follows to specify the status request.

    1. Place the SenderReceiver interface Rport in the drawing area.
    2. In the Basic Blocks palette or toolbar, click the Communication Status button, then place the operator in the drawing area.
    3. Connect the left side of the operator to the SenderReceiver/NVData interface prototype.
    4. Create a literal and set its value to one of the error codes.
    5. Create a comparison operator.
    6. Connect the Communication Status element and the literal to the inputs of the comparison operator.
    7. Connect the output of the comparison operator to a logic variable.

    You can now specify appropriate behavior for the error case (see the Closedexample).

  4. In the ESDL editor for SWCs, Closedproceed as follows to specify the status request.

    1. Enter the code for the status request as follows:

      <log_variable> = (<SR_Rport>.<data_element>).status() == <error code value>;

      • <log_variable> is the logical element that reads the result of the status request
      • <SR_Rport> is the SenderReceiver interface used as Rport
      • <data_element> is the SenderReceiver interface element you want to read
      • <error code value> is one of the error codes

    You can now specify appropriate behavior for the error case (as in the Closedexample).

  5. In the implementation editor of your SWC, AUTOSAR tab, set the attributes that control the generation of the Rte_IStatus macro.
  6. In the implementation editor of the accessed scalar/array/matrix or record data element, specify if the value may become invalid.

See also

Rte_IStatus

Status of Explicit and Implicit Access

Sender-Receiver Communication

ASCET Options – Operating System Options

Communication Status Operator

Adding and Editing a Literal

RTE Access Macros – Error Codes

Implementation Editor – AUTOSAR Tab (SWC)

Implementation Editor – AUTOSAR Tab (Scalar Elements)

Implementation Editor for Component References

Using the Communication Status Operator