beckhoff — 10.4.1 Displaying Logged Events in C#

Samples 10.4 Visual Studio C# 10.4.1 Displaying Logged Events in C# This sample applies to Visual Studio 2005 TcEventLogger 2.9.0.90 and above (Shipped since TwinCAT 2.10. Build1244) Before starting with the sample be aware that the TcEventViewer ActiveX does provide a fully featured implementation of an event HMI which can easily be added to your application. If you have special needs that cant be realized using the standard TcEventViewer proceed with the sample to display a list of logged events. 1. Create a Win32 C# Application. 2. Add a reference to the Beckhoff TcEventLogger: 3. On top of the Form1.cs add usingTCEVENTLOGGERLib; 4. Create a global instance on the TcEventlogger.

TcEventLogtcEventLogger =newTcEventLog(); 5. Add a ListView control to your Main Form and name it eventView1 6. In Form1_Load initialize the ListView: eventView1.View =View.Details; eventView1.Columns.Add("Time","Time"); eventView1.Columns.Add("Type","Type"); eventView1.Columns.Add("Source","Source"); eventView1.Columns.Add("Message","Message"); 7. Add code to display events in the ListView control: /// ///Display an event on top of the ListView control TcEventLogger 193 Version: 1.1