Receiving from a Port – ESDL

Note

This instruction applies only to SWCs specified in ESDL code.

If your software component uses a SenderReceiver or NVData interface as Rport, at least one runnable entity must receive data over the interface. Use one of the following possibilities to specify receiving 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 read:

    <variable> = <SRinterface>.<data element>;

    • <variable> is the element that reads the interface element
    • <SRinterface> is the SenderReceiver/NVData interface used as Rport
    • <data_element> is the SenderReceiver/NVData interface element you want to read

Explicit

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

    <SRinterface>.<data element>.explicitRead(<variable>);

    • <variable> is the element that reads the interface element
    • <SRinterface> is the SenderReceiver/NVData interface used as Rport
    • <data_element> is the SenderReceiver/NVData interface element you want to read

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 read procedure.

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

    <status_variable> = <SRinterface>.<data_element>.explicitRead(<variable>);

    • <status_variable> is the variable of type Std_ReturnType that holds the returned status
    • <SRinterface> is the SenderReceiver/NVData interface used as Rport
    • <data_element> is the SenderReceiver/NVData interface element you want to read
    • <variable> is the element that reads 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