Event Logger

The Tc3_DALI library supports the TwinCAT Event Logger for the output of messages. This means that errors are displayed to the developer during runtime without having to explicitly extend the program for this purpose.

The output of the messages can be influenced by a variable. It is located in the Tc3_DALI library as a global variable:

  eEventTraceLevel    : TcEventSeverity := TcEventSeverity.Critical;

Each message is assigned to a level that indicates how serious it is. The levels Info, Warning, Error or Critical are available. The global variable eEventTraceLevel defines the level from which a message is displayed in the message window.

By default, the variable is initialized so that only messages that correspond to the Critical level are output. Since most messages of the Tc3_DALI library are assigned to the Error level, these messages are not displayed. The Critical level is rated more serious than the Error level.

Event Logger 1:

The output of messages via the TwinCAT Event Logger may only be active for a limited time, e.g. during troubleshooting or commissioning.

PLC

The following instruction, which you can insert into your PLC program, outputs all messages of all function blocks from the Tc3_DALI library. This is particularly helpful during development or commissioning.

  Tc3_DALI.GVL.eEventTraceLevel := TcEventSeverity.Verbose;

Watch List

In addition to the extension of the PLC program, you can create a watch list in which the global variable eEventTraceLevel can be changed.

1. Create the watch list.
Event Logger 2:
2. Select the global variable eEventTraceLevel.
Event Logger 3:
The default setting of the variable can be seen in the documentation area of the input assistant.
Event Logger 4:
After adding the variable to the watch list you can change its value via a drop-down menu.
Event Logger 5:

Displaying the messages

The messages are displayed in the TwinCAT Logged Events window (see chapter Event Logger).

Event Logger 6:

All messages are stored in a ring buffer in the TwinCAT controller. The size of the ring buffer can be adapted in the TwinCAT options. This has the advantage that messages are saved even if the TwinCAT project is not open in Visual Studio.

Event Logger 7:

In addition, the messages can also be displayed in the Output window.

Event Logger 8:

Make sure that Show output from is set to TwinCAT.