Receiving from a Port – Block Diagram
Note |
|---|
This topic applies only to SWCs specified as block diagrams. |
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:
- Open the SWC you want to edit.
- Place the SenderReceiver/NVData interface prototype in the drawing area.
Connect a suitable input (of, e.g., an operation or a variable) directly to the SenderReceiver/NVData interface prototype.
Rules and restrictions are listed here: Sender-Receiver Communication -Rules
- Edit the Rport sequence call manually or automatically.
Implicit with RTE Access Operator
- In the Basic Blocks palette or toolbar, click the
RTE Access button to add an RTE Access operator. Place the operator in the drawing area.
The operator can be used for explicit (with or without status information) and implicit access. By default, explicit access without status information is selected.
Right-click the RTE Access operator, open the Access context menu and select Implicit.
Connect the left side of the operator to the SenderReceiver/NVData inter-face prototype and the right side to an appropriate diagram element.
Note
Connecting an implicit RTE Access operator to a queued element is not allowed. If you do so, an error MMdl1132 is issued during code generation.
- Edit the Rport sequence call manually or automatically.
- Open the SWC you want to edit.
- Place the SenderReceiver/NVData interface prototype in the drawing area.
- In the Basic Blocks palette or toolbar, click the
RTE Access button to add an RTE Access operator. Place the operator in the drawing area.
The operator can be used for explicit (with or without status information) and implicit access. By default, explicit access without status information is selected.
Connect the left side of the operator to the SenderReceiver/NVData interface prototype and the right side to an appropriate diagram element, e.g., an operator input (explicit without status only) or a variable.
Edit the Rport sequence call manually or automatically.
To select explicit access with status information, right-click the RTE Access operator, open the Access context menu and select Explicit with Status.
A status pin is added to the operator.
Specify the status inquiry as follows:
- In the Basic Blocks palette or toolbar, click the
RTE Status button to add an RTE Status element. - Create a literal and set its value to one of the error codes.
- Create a comparison operator.
- Connect the RTE Status element and the literal to the inputs of the comparison operator.
- Connect the output of the comparison operator to a logic variable.
- Right-click the sequence call of the variable and select Connector from the context menu.
- Connect the status pin to the connector.
- In the Basic Blocks palette or toolbar, click the
See also
Editing a Sequence Call in the Sequence Editor
Automatically Assigning Individual Sequence Calls
Specifying a SenderReceiver or NVData Interface Prototype