Sending to a Port – Block Diagram
Note |
|---|
This topic applies only to SWCs specified as block diagrams. |
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:
- Open the SWC you want to edit.
- Place the SenderReceiver interface prototype in the drawing area.
Connect a suitable output (of, e.g., an operation or a variable) directly to the SenderReceiver interface prototype.
Rules and restrictions are listed here: Sender-Receiver Communication – Rules
- Edit the Pport sequence call manually or automatically.
Implicit with RTE Access Operator
- Open the SWC you want to edit.
- Place the SenderReceiver 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.
- Right-click the RTE Access operator, open the Access context menu and select Implicit.
Connect the right side of the operator to the SenderReceiver interface prototype and the left 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 Pport sequence call manually or automatically.
- Open the SWC you want to edit.
- Place the SenderReceiver 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 right side of the operator to the SenderReceiver interface prototype and the left side to an appropriate diagram element.
Edit the Pport 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