OnShutdown

_ITcEventLogEvents

This event method is called when the operating system shuts down. This could be used by DCOM clients to release the connection.

HRESULTOnShutdown([in] VARIANT
shutdownParm);

Parameters

shutdownParm

[in] A variant that describes the shutdown reason (in our case always REASON_SYSSHUTDOWN).

The items of the array are explained in the following table.

Requirements

index

TcEventHeader item

Description

0

REASON_INVALID

Invalid

1

REASON_TCSTOP

The TwinCAT system shuts down

2

REASON_SYSSHUTDOWN

The operating systems shuts down

S_OK

Function was successfully called

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_OnShutdown(ByVal shutdownParm As Variant)
  Debug.Print shutdownParm
End Sub