OverviewΒΆ
This page presents a rough overview of the RabbitMQ FMU (RMQFMU). Note, that terminology related to the Functional Mock-up Interface 2.0 (FMI) and RabbitMQ is not described in detail. The internal workings are described in detail in Data Handling and a user manual is available in User Manual. It is adviced to read the user manual first.
The purpose of RMQFMU is to provide a tool (and approach) for briging external data from a RabbitMQ Server into an FMI-based co-simulation. It has certain properties related to timeliness of messages, timeout and precision of data.
In a nutshell, the RMQFMU steps in time if it has valid data for that time-step. If no data is available, the RMQFMU will wait until a cofigurable timeout parameter is reached, after which it will stop. A maxage parameter can be set to determine the validity of data with respect to its age. If the data complies with the maxage constraints, the RMQFMU will step and produce its output with that data.
The overall approach is depicted in the diagram below.
Invoking the function fmi2EnterInitializationMode
on RabbitMQ FMU causes it to a create a topic exchange (if it does not exist), a binding key and a queue. Furthermore, it begins to process messages until all outputs of the FMU has been defined.
When all outputs has been defined, the time stamp of the latest message (wct1 in the example) defines simulation Time 0 and thus establishes a mapping between wall-clock time (WCT) and simulation time. Any subsequent messages has WCT1 subtracted in order to map them to simulation Time.
Invoking fmi2DoStep
on RabbitMQ FMU causes it to process messages and update its output state until there is a message with a time stamp defined by: messageTimeStampInSimulationTime >= currentSimulationTime+simulationStepSize
. Such a message is stored in order to use it for the subsequent fmi2DoStep
operation.