Example Listener

This example illustrates the use of the TwinCAT 3 EventLogger in relation to messages and alarms.

It consists of a module that can send a message and an alarm, and a module that receives these messages.

Download: Tc3EventLogger_ListenerCppSample.zip

Publisher module

Single BOOL variables are used in the Publisher module as triggers on the input data area:

In addition there is an option to set and to remove the JSON attribute in order to send it with both messages.

Listener module

The Listener module implements both the ITCMessageListener and the ITcAlarmListener interface. The methods specified as a result of this are called by the EventLogger as callback.

The Listener module thereby registers itself with the EventLogger for the corresponding event classes on starting in the method SetObjStateSO().