API 9.3.5.1 OnNewEvent _ITcEventLogEvents [ } 144] This event method is called on all clients that implement and connect this event interface when a new event is issued. The event had been issued from the PLC function block ADSLOGEVENT by setting the flag from FALSE to TRUE (or other ADS device) or the from a call to a Report Event Function like IT [ } 137]cEventLogC [ } 137] :: ReportEvent [ } 138] , ITcEventC3 [ } 141] :: ReportEventEx [ } 143] or ITcEventLog [ } 129] :: ReportEvent [ } 129] . HRESULT OnNewEvent([in] IDispatch* evtObj); Parameters evtObj [in] IDispatch pointer to a new event object of the class TvEvent [ } 128] .
The event object provides the full access to the new issue event. Each client receives a reference to the event object and no copy. Return Values S_OK Function was successfully called E_POINTER evtObj was no valid pointer. Visual Basic sample code Option Explicit Dim WithEvents evtLogger As TCEVENTLOGGERLib.TcEventLog ' form load Private Sub Form_Load() ' get the one and only event logger Set evtLogger = New TcEventLog End Sub ' event method Private Sub evtLogger_OnNewEvent(ByVal evtObj As Object) Dim evt As TcEvent Set evt = evtObj ' print the message string in English Debug.Print evt.GetMsgString(1033) End Sub 9.3.5.2 OnConfirmEvent _ITcEventLogEvents [ } 144] TcEventLogger 145 Version:
1.1 ITcEventLog Methods Description OnShutdown [} 149] This event method is called when the operating system shuts down. On [} 149] NewEventConfiguration [} 150] This event method is called when a new configuration was loaded due to a call to ITcEventLog::Reset.