beckhoff — 10.6.4 View active alarms in user defined ListView

Samples 10.6.4 View active alarms in user defined ListView System requirements: CodeGear C++Builder 2009; TwinCAT v2.11 B2228 or higher; Import the library TcEventLogger.exe (TCEVENTLOGGERLib_OCX.h); The sample shows the active alarms in a user-defined C++Builder list view (TListView-Control). The following steps are needed to create the sample: 1. Create a new VCL form application 2. Move the TTcEventLog and TStatusBar activeX components from the component palette to the form. 3. Implement the methods: FormCreate(), FormClose(). With FormCreate() the connection to EventLog- ger is configurated / created. With FormClose() the connection is separated; 4. Implement the event routines:

OnNewEvent, OnResetEvent. The example project supports thereby alarms without acknowledgement. To receive alarms with achnowlegde you have to implement further event routines: OnSignalEvent() and OnConfirmEvent(); 5. Implement the event routine OnShutdown(). This routine is called if the last instamce of the Eventlog- gers (e.g. at shutdown of the system) is discharged completely; 6. Implement the help methods: AddNewEvent() and DisplayActiveAlarms(). These methods are used to read the active messages and to show them in the list; 7. Implement the help method: GetEventPosByID().

These method searchs in the list view for a specific message with the help of the SourceId and ID and supplies in case of success the rowe number (ite- mIndex). You can delete the message from the list with the help of the row number; //--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit2.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "TCEVENTLOGGERLib_OCX" #pragma resource "*.dfm" TForm2 *Form2; //--------------------------------------------------------------------------- __fastcall TForm2::TForm2(TComponent* Owner) TcEventLogger 211 Version: 1.1