Setup

 

Log TwinCAT System errors

It is possible since TwinCAT 2.8 to log NC errors and I/O errors with the TcEventLogger.

This can be controlled with the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\System[LogMessageType]

Possible values for LogMesssageType are:

Value

Description

0

TwinCAT System message logged into the operating system.

1

TwinCAT System message logged into the TcEventLogger. They available for Custom programs and the HMI in the list of logged events. System messages use the TcXmlFormatter.

2

Default mode. TwinCAT system message will be logged into the operating system and the TcEventLogger.

 

Message sources, database organisation, and the prompt on a TwinCAT System:

Messages on a TwinCAT (PC) System 

source

message text as xml file

database

prompt

TcEventLogger (TwinCAT *.tps - File)

event viewer of the OS

TcEventViewer-Client e.g. TcEventBar.exe

event viewer of the OS

TwinCAT System Manager Logger

 OS

-

-

X

-

X

-

ADSLOGSTR, ADSLOGDINT, ADSLOGLREAL functions

-

-

X

-

X

X

ADSLOGEVENT module

X*

X

-

X

-

-

TwinCAT System NC and  IO-messages

X

TwinCAT 2.8 or newer

X**

only at LogMessageType 1 or 2

X

only at LogMessageType 0 or 2

X**

only at LogMessageType 1 or 2

X

only at LogMessageType 0 or 2

X

- : not possible

X : possible

* only with the TcXmlFormatter.

** Not all messages will be logged to reduce the system load.

 

 

Disable log

The TcEventLogger has a small log with 128 messages max. The TcEventlogger saves this log together with its configuration in the project storage. To disable this and switch to temporary log files you can set a value in the registry:


HKLM\SYSTEM\CurrentControlSet\Services\TcEventLogger\LogToTcStg (REG_BINARY)

- not there or value = 0x1 log in the storage

- there and value = 0x0 disable log in the storage

DCOM Security

From TwinCAT 2.11. TcEventLogger implicitly sets default access rights. To set access rights explicitly via dcomcnfg or registry (e.g. for remote access) set the following value in the registry:

HKLM\SYSTEM\CurrentControlSet\Services\TcEventLogger\UseAppIdSecurity (REG_DWORD)