.DESLib.DEVSLib.SRC.DevelopersGuide.Communication

Information

Communication between DEVSLib models

The interfaces for model communication are arranged in the package Interfaces.

Input Ports

The inPort model represents the interface for input messages.
It contains two variables, the event and the queue.
The event represents that a new message or messages have been received at the port. It is a flow variable because multiple models can send messages to the same port, so the total number of messages must be summed up.
The queue represents a reference to the storage space for the incoming messages.

Output Ports

The outPort model represents the interface for output messages.
It contains two variables, the event and the queue.
The event represents that a new message or messages have been sent through the port. It is a flow variable because multiple models can send messages to the same port, so the total number of messages must be summed up.
The queue represents a reference to the storage space for the outgoing messages.

Messages

The communication between models is performed as a message passing mechanism. The output function of one model generates a message that is sent to the input port of a connected model. The model that receives the message executes an external transition.

Due to the restrictions of the Modelica language, this message pasing mechanism has been implemented using external functions that store messages in dynamic memory. Only references to the messages and the data structures that store the messages (queues, lists, etc) are stored in the Modelica variables. The implementation of these external functions is included in the file events.c.

Message Management Functions

Several functions for message and queue management have been included in the library:
Generated at 2024-12-22T19:25:51Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos