Sending to a Port – ESDL

Note

This instruction applies only to SWCs specified in ESDL code.

If your software component uses a SenderReceiver interface as Pport, at least one runnable entity must send data over the interface. Use one of the following possibilities to specify sending data:

Rules and restrictions are listed here: Sender-Receiver Communication -Rules

Implicit

  1. Open the SWC you want to edit.
  2. Enter the following code to use implicit write:

    <SRinterface>.<data_element> = <expression>;

    • <SRinterface> is the SenderReceiver interface used as Pport
    • <data_element> is the SenderReceiver interface element you want to write
    • <expression> is the expression or element you want to assign to the interface element

Explicit

  1. Open the SWC you want to edit.
  2. Enter the following code to use explicit write:

    <SRinterface>.<data_element>.explicitWrite(<expression>);

    • <SRinterface> is the SenderReceiver interface used as Pport
    • <data_element> is the SenderReceiver interface element you want to write
    • <expression> is the expression or element you want to assign to the interface element

Explicit with Status

  1. Open the SWC you want to edit.
  2. Declare a method-/runnable-local variable of type Std_ReturnType

    This variable will hold the status from the explicit write procedure.

  3. Enter the following code to use explicit write with status information:

    <status_variable> = <SRinterface>.<data_element>.explicitWrite(<expression>);

    • <status_variable> is the variable of type Std_ReturnType that holds the returned status
    • <SRinterface> is the SenderReceiver interface used as Pport
    • <data_element> is the SenderReceiver interface element you want to write
    • <expression> is the expression or element you want to assign to the interface element
  4. Specify the status inquiry as follows:

    if (<status_variable> != RTE_E_OK)

    {

    ... // your statement or statement block

    }

See also

Sender-Receiver Communication

Specifying a SenderReceiver or NVData Interface Prototype

RTE Access Macros – Error Codes

Sending to a Port – Block Diagram