Event Logger

The framework uses the Event Logger for its Alarms. While this provides a great deal of flexibility, it also provides some complexity. At a minimum there are 2 separate parts of this system that must be configured. The Type System, and the PLC Code.

The Type System holds items that are available globally to the entire TwinCAT system, each of which have a globally unique identifier or GUID. For example, under ‘Data Types’ we find the data format of the AMS Address, FSoE Structures, IP Address format, and even the NCTOPLC_AXIS_REF. These are all items used by the system that are fixed and do not change. Under the ‘Event Classes’ tab are some TwinCAT and Windows based events and errors. There are Router events, Real Time events, and ADS events; some of which you may have seen in the past. This list of events exists so that the internal system can refer to each event by its GUID, and not have to be concerned with the details of the event, but only deal with the GUID and what we want to happen (Raise, Clear, etc.).

Tip

An additional feature of these events is the ability to provide language translation and select the language to be displayed based on a single global selection.

There is the possibility to create a custom event for any messages or alarms that you wish to be able to add to the event logger. Once an event has been added to the event logger it can be easily exchanged with both TwinCAT and non-TwinCAT components.

Event Logger connections

For example, the XAE can be used to create an Event Class, the XAR will Raise the event, the HMI will display the event, and then there is the possibility to send the event to some other component to log the event.

When adding events, it is recommended to add a new tmc file that will hold those events separate from the TwinCAT System. This will allow the events to be modified and held in revision control. Additionally, this will allow for the tmc files to be portable and able to be reused on multiple projects. Because of these options it is also recommended that each EM and Component have their own tmc file.

Ideally an event or alarm will be created for every possible condition, this will allow for language translation to be created and used in the HMI; however, to get started you can simply create a single event of each severity type and populate the text from the PLC, and then add specific events later.