beckhoff — 9.3.1.3 GetLastEvent

API arrHeader(5) = 0 'invoke id arrHeader(6) = Now ' event date and time arrHeader(7) = 123 ' millisecond part of the event date and time arrHeader(8) = 1 ' event soruce id arrHeader(9) = "TcEventFormatter.TcXmlFormatter" ' XML formatter ProgId ' create event parameters Dim arrParam(0 To 1) As Variant arrParam(0) = 1234 ' first parameter as long arrParam(1) = 1234.777 ' second parameter as double ' log the event Call evtLogger.ReportEvent(arrHeader, arrParam) Remarks After this method call the Event Logger will raise the event OnNewEvent [ } 145] on all client that implements the event interface _ITcEventLogEvents [ } 144] (VB: Dim WithEvents).

For C++ and Visual Basic programmers it's more convenient to use the method ITcEventLogC [ } 137] :: ReportEvent [ } 138] or ITcEventC3 [ } 141] :: ReportEventEx [ } 143] . 9.3.1.2 ClearActiveEvents ITcEventLog [ } 129] This method is used to reset all active events.

HRESULT ClearActiveEvents(); Parameters Return Values S_OK Function was successfully called Visual Basic sample code ' get the one and only event logger Dim evtLogger As TCEVENTLOGGERLib.TcEventLog Set evtLogger = New TCEVENTLOGGERLib.TcEventLog ' clear all active alarms evtLogger.ClearActiveEvents Remarks After this method call the Event Logger will raise the event OnActiveEventsCleared [ } 148] on all client that implements the event interface _ITcEventLogEvents [ } 144] (VB: Dim WithEvents). 9.3.1.3 GetLastEvent ITcEventLog [ } 129] This method returns the most recent active event. HRESULTGetLastEvent([out,retval] IDispatch** lastEvent); Parameters lastEvent TcEventLogger 131 Version: 1.1