Logging

Various logging functions are available to enable extended diagnostics.

TwinCAT Output

The first point to consider is the TwinCAT Output. Information is written here depending on the Trace Level. In the event of an error, you can first look there for a message corresponding to the error:

Logging 1:

The Trace Level can be adjusted via the structures ST_OCPP1_Client_Param and ST_OCPP1_Server_Param. This is not only possible at the start of the application, but also at runtime. To do this, the value must be changed and the respective Init method must be called by the client or server. The following table shows the different TcTraceLevels and their effects:

TcTraceLevel

Effect

tlAlways

No messages are output via the TwinCAT Output.

tlError

Only error messages are output.

tlWarning

Warnings and error messages are output.

tlInfo

One-time status information, warnings, and error messages are output.

tlVerbose

All messages are output. This includes cyclic information, one-time status information, warnings and error messages.

Logfile

The second diagnostic option is to write a logfile. There are only two different options here, writing the logfile is either enabled or disabled. The Trace Level can be adjusted via the structures ST_OCPP1_Client_Param and ST_OCPP1_Server_Param.

The OCPP messages are logged in the logfile. The following shows an example of an activated logfile in the OCPP client.

Logging 2:

The logfiles are stored in the TwinCAT boot directory:

C:\ProgramData\Beckhoff\TwinCAT\3.1\Boot\

Logging 3:

Use of the logfile for debugging purposes only

The logfile should only be used for debugging purposes. All OCPP messages are logged in the file so that large logfile sizes can be created over long periods of time.