Error analysis with core dump

A core dump is a dump of the PLC project data.

Error analysis with core dump 1:

Available from TC3.1 Build 4024.11

Error analysis with core dump 2:

Core dump usable only with associated compile info file

If you archive or save a core dump file, please note that the associated project and associated compile info file (*.compileinfo file, which is stored, for example when creating the project, in the "_CompileInfo" folder) must be present in order to load a core dump. If this is not the case, TwinCAT cannot use the dump later.

Please also note here the setting options on the Settings tab. With the help of the Core Dump setting, you can configure whether the core dump file, which may be located in the project directory, is to be saved together with the available compile info files in a TwinCAT file archive.

Creating a Core Dump

1) Automatic generation

In case of an exception error, runtime systems automatically store a core dump on the target system if the associated PLC project is not currently logged in to a development environment. This core dump is stored as a *.core file in the boot folder of the target system (by default under C:\TwinCAT\3.1\Boot\Plc). The automatic generation of a core dump also occurs if the exception error occurs within the code of an FB_init/FB_reinit/FB_Exit method (from TC3.1 Build 4024.25).

Error analysis with core dump 3:

Warning message when core dump is available on target system

If you login a PLC project and there is a core dump on the selected target system, a warning is displayed in the message window indicating that a core dump is available on the device.

If the warning is no longer to be displayed when logging in the project (e.g. because you have completed the analysis of this core dump file or because you have archived the file somewhere else), you can delete the respective core dump file from the target system (by default under < TC3.1.4026.0: C:\TwinCAT\3.1\Boot\Plc; >=TC3.1.4026.0: C:\ProgramData\Beckhoff\TwinCAT\3.1\Boot?Plc).

2) Manual generation

In online mode, you can also explicitly generate a core dump if the PLC project is currently at a breakpoint or an exception has occurred. In this case TwinCAT stores the core dump file only in the project directory and not on the target system. The core dump file generated is saved directly in the PLC project directory (<PLC_project_name>.<PLC_project_GUID>.core).

Loading a core dump

You can load the core dump from the target system into the project directory in online mode (using the Command Generate core dump). In addition, you can load a core dump from the project directory into the project in offline mode (using the Command Load core dump). You will then receive an online view of the PLC project with the data and values at the time of the exception or at the time of generating the core dump file.

Error analysis with core dump 4:

In the online view that TwinCAT generates when loading the core dump into the project, menu commands appear as available that are not effective in this state. If you select such a command, you will receive a corresponding message.

In addition, you can only close the core dump view using the command Close core dump. The Logout command is not effective in this view.

Archiving

If the core dump file located in the project directory is to be contained in the project archive, activate the "Core Dump" option during the configuration of the file archive content (see documentation Reference User Interface > Project > PLC project settings > Settings tab).

Two exemplary workflows are described below.

Load core dump from target system to project for analysis

Requirement:

With the development environment, you have opened the project that produced an exception error on the target system. The PLC project is in online mode in the development environment.
1. Use the Command Generate core dump to load the core dump from the target system.
⇒ TwinCAT copies the core dump file with the name <PLC project name>.<PLC project GUID>.core into the local PLC project directory.
2. Log the PLC project out.
3. Use the Command Load core dump to load the desired core dump into the project.
⇒ TwinCAT displays an online view of the PLC project. You can see the variable values and call stack at the time of the error.
4. After completing the core dump analysis, select the Command Close core dump.
TwinCAT closes the core dump view of the PLC project. The development environment reappears with the views of normal offline operation.

Manual generation of a core dump of the logged-in PLC project

Requirement:

A PLC project is in online mode in the development environment. The PLC project is currently at a breakpoint or an exception error has occurred.
1. Select the Command Generate core dump.
TwinCAT generates a new core dump and creates the file with the name <PLC_project_name>.<PLC_project_GUID>.core in the local PLC project directory.

See also: