Introduction
The TcEventLogger is Beckhoffs standard alarm and event concept. It helps to trigger and visualize warnings, errors, information or status messages from the PLC. By using the TcEventlogger for your Alarm & Event implementation you are able to realize the following requiremets:
- Issue Alarms and Events from the PLC
- Manage events throug the TcEventLogger
- COM APIs for HMI development
- Fully featured ActiveX control for display of events
- Support for implementation of distributed systems: The HMI can easily display events of a remote PC
- Load language specific message texts from a database
The TwinCAT Message-Concept:
Messages (Events)
Each message is identified by a Source- and an Event ID. The Source ID is assigned to a machine and the Event ID is assigned to a certain event of that machine.
Source names and event messages are stored in a certain database file. When an event is issued, the TcEventLogger looks up the appropriate message in its database and provides it to its clients. Clients typically are applications like HMIs.
For each event additional "document links" may be stored in the database. Each DocLink is identified by its name and contains a link to a file. Processing of these links is up to the clients - the TcEventLogger only provides functionality to lookup the link itself (see 'message formatting' for details).
Message Triggering
You can use a simple Function Block to signal an event from the PLC. As soon as an event is issued (or its state changes) the TcEventLogger notifies its clients about this event. The client is called and a TcEvent COM object supplied. Using this event object, the client can access the event and e.g. query a completely formatted message string in the appropriate language from the database.
Message formatting
The TcEventLogger offers the TcEventFormatter concept to load message texts from a database. Beckhoff supplies default formatters e.g. for loading message texts from a xml file. Custom formatters can be implemented and injected into the system.
Default formatters supplied by Beckhoff:
Formatter | Description |
---|---|
TcEventFormatter | Loads data from the TwinCAT Project Storage (.tps). |
TcXMLFormatter | Loads data from XML files. |
The formatter to be used for an event is chosen in the PLC, when issuing the event.
Message Configuration
To load message texts from a database the events need to be configured. The TcEventConfigurator offers a GUI to do that. It supports both standard formatters and additional Plain Text or Excel format for translation purposes. Use the TcEventConfigurator used to do the entire event configuration:
- Configure messages
- Save data in different formats
- Generate PLC Sample Code
Visualizations
To reduce the effort of creating custom visualizations, a standard implementation is supplied with the TcEventLogger : The TcEventViewer.
The TcEventViewer is an extensive configurable ActiveX control for usage in customers HMIs.
The TcEventBar is an example implementation for displaying events. It utilizes the TcEventViewer ActiveX.
The TcEventBar can be found in the 'TwinCAT/EventLogger' directory.
Setting up the TcEventBar
The TcEventBar uses a registry key (HKEY_CURRENT_USER\Software\TwinCAT\TcEventBar
) for the properties (since v.2.9.0.11) . In the "ContextMenuFlags" value you can save the context menu settings of the TcEventBar.
The following flags can be set to disable the menu items.
TcEventView item: | Description |
---|---|
0x00000001 | "Clear active events" |
0x00000002 | "Clear logged events" |
0x00000004 | "Set filter" |
0x00000008 | "Confirm" |
0x00000010 | "Reset" |
0x00000020 | "Details" |
0x0000FFFF | Hide the complete context menu |
Main window context menu: | Description |
---|---|
0x00010000 | "Always on top" |
0x00020000 | "Autohide" |
0x00040000 | "Exit" |
0xFFFF0000 | Hide the complete context menu |
Connectivity
The TcEventLogger provides two ways for implementing distributed systems:
DCOM
DCOM is only supported on NT / XP Platforms. There are well known issues using DCOM connections in the scope of configuration and network timeouts.
ADS Stream Interface
The TcEventLogger supports a binary ADS Interface to implement distributed systems.
To keep programming efforts at a minimum, Beckoff provides a proxy implementation which wraps binary encoding and exchange of data. The TcEventLogAdsProxy class provides the whole set of the TcEventLogger COM API for client programming.