API Return Values S_OK Function was successfully called E_POINTER data was no valid pointer. Visual Basic sample code ' get the one and only event logger Dim evtLogger As TCEVENTLOGGERLib.TcEventLog Set evtLogger = New TCEVENTLOGGERLib.TcEventLog ' get the most recent active event Dim evt As TcEvent Set evt = evtLogger.GetLastEvent ' get the event data Dim data() As Variant Call evt.GetData(data) ' loop though the list of data Dim i As Long For i = LBound(data) To UBound(data) Debug.Print data(i) Next i 9.3.8.13 GetHeader ITcEvent [ } 157] The property returns a safearray that represents the same information as TcEventHeader [ } 181] .
The header data was append when the event was issued from the PLC function block (or other ADS device) or 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 GetHeader([in,out] SAFEARRAY(VARIANT)* data); Parameters data [in] Pointer to a safearray with the bounds 0 to 9 that represents the event header. The array represents the same information as TcEventHeader. The items of the array are explained in the following table. TcEventLogger 166 Version:
1.1 index TcEventHeader [} 181] item DataType Description 0 nClass TcEventClass [} 179] The class of the alarm, like alarm, warning, hint 1 nPriority TcEventPriority [} 180] (long) The event priority. Since now the priority is always: TcEventPriority.TCEVENTPRIO IMPLICIT=0 _ 2 dwFlags TcEventFlags [} 180] (long) The flags control the behavior of the alarm. That could be combined by a OR junction. 3 dwUserData long A spare variable that can be used by the user. 4 nId long The event id, that unique represents this type of event for this one Event Source. 5 nInvokeId long 6 fDate VARIANT-DATE The date and time when this event occur 7 nMs long The millisecond part of the event date