Add/edit Protocols for Software Interfaces

by Marco Wuelser

 

A Protocol defines the interface between software components. When one component sends a message to another, both must know the Protocol. A Protocol has a unique identifier and a number of fields. The fields are serialized in the given order without any padding bytes. Fields can be scalar types (integer, Boolean, floating point) or arrays of scalar types. Fields can also be Enumerations (see above) or other Protocols. In that way, complex data types can be created.

Create Protocol/Signal from Output Port

To create a new protocol or signal from an output port, right-click the output port and select "Create Protocol" from the context menu.

image-102.png

image-103.png

Figure 1 - Create Protocol/Signal from Port

 

Assign Protocol/Signal to output Port

To assign a protocol or signal to an output port, drag the protocol/signal from the toolbox to the port. The protocol must be first created in the Protocol Explorer. The protocol is located in the same subdirectory that was created there.

The lines at both sides of the port will turn black to indicate that a protocol/signal is assigned.

image-104.png

image-105.png

Figure 2 - Assign Protocol/Signal

NOTE

Protocols can only be assigned to output ports in the Active Part and Interrupt components. To affect the output port of an Active Container, the protocol must be assigned to the connected output port in the child diagram.

 

Protocol Explorer

To create a Protocol in the Protocol Explorer, follow this step-by-step guide:

  1. Select the group in the Protocol Explorer that should contain it.
  2. Press the add button and select Protocol, or select ‘Add Protocol’ from the context menu.
  3. Fill in the name of the Protocol
  4. Fill in the description of the Protocol.
  5. Add fields by dropping types from the Protocol Explorer to the field list in the Protocol Editor.
  6. Double-click the fields to edit the field name.

Step 1-2                                                                              Step 3-6

image-118.png

Figure 3 - Create Protocol


Signal

When a Protocol is created that has no fields, it is called a signal. The runtime will then only send the protocol identifier without any additional data and there is no code generated except for the identifier constant.

 

To create a signal, follow this step-by-step guide:

  1. Select the group in the Protocol Explorer that should contain it.
  2. Press the add button and select Protocol or select ‘Add Protocol’ from the context menu.
  3. Fill in the name of the signal.
  4. Fill in the description of the signal.

NOTE

It is recommended to add a postfix to the name of all signals, such as “Signal” or “Event”.

Step 1-2                                                                           Step 3-4
image-119.png

Figure 4 - Create Signal

 

Enumeration

An Enumeration can be used to define a data type that can only have a limited number of values. These values are called enumerators. The Enumeration is represented as an integer number in the program code. The number of bytes can be selected by the user but must be large enough to represent all defined enumerator values. Values can also be negative if a signed base type is selected.

 

To create an enumeration, follow this step-by-step guide:

  1. Select the group in the Protocol Explorer that should contain it.
  2. Press the add button and select Enumeration or select Add Enumeration from the context menu.
  3. Fill in the name of the Enumeration.
  4. Fill in the description of the Enumeration.
  5. Select a base type using the drop-down menu.
  6. Add Enumerators by entering the name and value for each enumerator.

Step 1-2                                                                        Step 3-6
image-117.png

Figure 5 - Create Enumeration

 

 


Further Articles

How To - Define Data Flow Channels
How To - Define Software Architecture
How To - Design a System - System Architecture
How To - System Decomposition - Sub-System-Architecture

Go back