beckhoff — 9.3.4.2 ReportEventEx

API The method can just be used to issue an alarm. A second call to reset the alarm is not possible with this method. To change the state of an already issued alarm we need the event object itself. For more convenience the method ITcEventLogC3 [ } 141] :: ReportEventEx [ } 143] directly returns the new created event object. Also see about this 2 TcEventHeader [ } 181] 9.3.4.2 ReportEventEx ITcEventLogC3 [ } 141] This method is used to issue an alarm from a COM client like the HMI program to the TcEventLogger.

HRESULTReportEventEx([in] TcEventHeader* pEventHead, [in] SAFEARRAY(VARIANT)* pEventData [out, retval] [out,retval] ITcEvent** pEvent ); Parameters pEventHead [in] Pointer to an object of the type TcEventHeader. The object represents the alarm configuration. eventData [in] A pointer to a safe array that represents the event arguments. In the configuration of the event formatter it's defined how to place the event arguments into the displayed event message. The following data types are supported by the standard formatter.

int (16bit), long (32bit), float(32bit), double(64bit), string(BSTR) pEvent [out, retval] A pointer to an ITcEvent pointer that receives the new logged event object Return Values S_OK Function was successfully called TCEVENTERR_ISSIGNALED the event with this source id and event id was already signaled. E_POINTER pEventHead or pEventData or pEvent were no valid pointers.

Visual Basic sample code ' get the one and only event logger Dim evtLogger As TCEVENTLOGGERLib.TcEventLog Set evtLogger = New TCEVENTLOGGERLib.TcEventLog ' cast to ITcEventLogC3 interface Dim evtLoggerC As TCEVENTLOGGERLib.ITcEventLogC3 Set evtLoggerC = evtLogger ' create event header Dim header As TcEventHeader header.nClass = TcEventClass.TCEVENTCLASS_ALARM ' event class header.nPriority = TcEventPriority.TCEVENTPRIO_IMPLICIT ' event priority header.dwFlags = TcEventFlags.TCEVENTFLAG_LOG ' event flags header.dwUserData = 0 'user data header.nId = 1 ' event id header.nInvokeId = 0 'invoke id header.fDate = Now ' event date and time header.nMs = 123 ' milli second part of the event date and time TcEventLogger 143 Version:

1.1