start portlet menu bar

HCLSoftware: Fueling the Digital+ Economy

Display portlet menu
end portlet menu bar
Select Page

Protocols in an RTist model are often binary, meaning that there are two connected ports typed by the protocol. The out-events for one of the ports are the in-events for the other port.

This is expressed by making one of the ports conjugated (denoted by ~). Hence, for a conjugated port the direction of protocol events is swapped so that the out-events can be sent in and the in-events sent out from it.

Conjugated Ports

A binary protocol MyProtocol typing two connected ports p1 and p2. The event that can be sent out from p1 (OutEvent1) can be sent in to p2, and the event that can be sent in to p1 (InEvent1) can be sent out from p2. The port p2 is therefore conjugated to swap the event directions specified in the protocol.

In the above example, it doesn’t matter which of the ports that are conjugated. However, when you are modeling a client-server design, a useful recommendation is to conjugate the server ports rather than the client ports.

Even if the opposite also works, you get two benefits by following this recommendation:

  1. All events that are sent from the client to the server are out-events, and all events that are sent from the server to the client are in-events. This makes send- and invoke-statements in the client capsule easy to read. Communication in client-server designs is usually initiated by clients rather than the server.
  2. There are typically more client ports than server ports, so by choosing to conjugate the server ports you save some clicking in the Properties view.


Client Server Design

A client-server design with 1 server port and 2 client ports. The client ports are named according to the server to make send- and invoke-statements in the client capsules easy to read.

If you want to change which ports that are conjugated, you also need to swap the directions of all events in the protocol of those ports. RTist provides a handy command for doing this. Select all events in the protocol, right-click and choose the command Change Event Direction. All in-events will become out-events and vice versa.

Comment wrap
Automation | March 26, 2024
Unlocking the Potential of Real-Time Development with HCL DevOpsCode RealTime 1.0.1
HCL DevOps Code RealTime 1.0.1 streamlines development with enhanced validation and clearer error reporting. New guide simplifies building & customizing real-time applications.
Secure DevOps | September 2, 2022
RTist 11.2 2022.34
HCL RTist is a rule-based code translator for C/C++. The main feature of RTist is to produce readable, maintainable, and portable code.
Secure DevOps | November 29, 2021
What's new in HCL RTist 11.1 2021.46
HCL release of HCL RTist: 11.1 2021.46. As usual, there are several new features and a few bug fixes. Read more to know some highlights.