beckhoff — 10.4.2 Displaying Active Events in C#

Samples { caseTcEventClass.TCEVENTCLASS_ALARM: return"Alarm"; caseTcEventClass.TCEVENTCLASS_HINT: return"Hint"; caseTcEventClass.TCEVENTCLASS_INSTRUCTION: return"Instruction"; caseTcEventClass.TCEVENTCLASS_MAINTENANCE: return"Maintenance"; caseTcEventClass.TCEVENTCLASS_MESSAGE: return"Message"; caseTcEventClass.TCEVENTCLASS_PARAMERROR: return"Paramerror"; caseTcEventClass.TCEVENTCLASS_STATEINFO: return"State info"; caseTcEventClass.TCEVENTCLASS_WARNING: return"Warning"; default: return"?"; } } 8. Finally, in Form1_Load, read the list of active alarms from the TcEventLogger foreach(TcEvent evt in tcEventLogger.EnumLoggedEventsEx() ) AddEvent(evt); 9. Start a PLC program to issue some events.

10.4.2 Displaying Active 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 active events. This sample builds on the sample ' Displaying Logged Events in C# [ } 193] ' To implement a program capable of displaying active events we will need to extend the previous sample with the folowing features:

◦Add events dynamically as they occur ◦Remove inactive events from the listview. ◦Associate an event with one entry in the listview. TcEventLogger 195 Version: 1.1 Language / IDE Source code Visual Studio 2005 https://infosys.beckhoff.com/content/1033/ TcEventLogger/Resources/12333057163/.zip