function block (FB) type is used in the MVCD framework to provide a time-stamped log of
diagnostic messages and their sources. The time stamp provided by
records the local time at which an event occurs at its
input to report the diagnostic message. This leads to multiple
possible sources of significant error:
- The time at which the message is logged will always be later than the time at which the message is generated.
- The delay between message generation and its logging may be variable, especially in distributed systems.
- As a result, messages from different devices in a distributed system may even be logged in the reverse order of their occurrence, making it impossible to perform correct higher-level sequence-of-events analysis.
The purpose of this design pattern is to remove the above sources of error by time-stamping the message and source identification associated with an event, immediately upon the occurrence of the event, before passing this information on to the logging function.
The structured data type
TS_MSGis used to transport a message of type
WSTRING, along with a timestamp of type
WSTRINGidentifier of the source of the data.
In response to an event at its
REQinput, an instance of the
STAMP_MSGFB type transfers the values of its
MSGinputs to the corresponding fields of its
TS_MSG-valued output, and adds a time stamp corresponding to the current date and time.
MSG_LOGFB type provides the capability of logging events reported by variables of the
TS_MSGtype, in a manner similar to that of the
This framework also provides the convenience FB types
E_TO_PRIM2for the generation of messages in the format of IEC 61499 service primitives.
The FBDK support for the Tagged Data and Local Multicast patterns can be used effectively in conjunction with this pattern when a system configuration is being edited.
This design pattern and framework, in conjunction with the Tagged Data and Local Multicast patterns, can be used in several ways in the design, implementation, debugging and monitoring of embedded and distributed systems.
- It can be used to improve the accuracy of time-stamping of diagnostic messages in the Diagnostics and Distribution phases of the MVCD methodology.
As illustrated in the
AGENTS_LOGRsystem configurations, it can be used to debug the operation of FB instances by logging their outputs as sequences of service primitives, using the
- This pattern could also be used by software agents in holonic systems to exchange time-tagged messages with source identification within a cooperation domain whose name is given by the channel ID of a Tagged Data item.