Analysing Errors with Core Dump

A core dump is a memory snapshot of the application data. In case of an exception error, runtime systems that support this feature automatically store a core dump file (<application name>.core) in the application directory and on the controller.

In online mode, you can also generate a core dump explicitly if the application is currently stopped at breakpoint or if an exception has occurred. In this case, CODESYS stores the core dump file in the project directory and not on the controller.

In offline mode, you can load the core dump from the controller to the project. An online view of the application is then displayed with the data and values at the time of the exception.

In addition, you can call a project view of the controller log file at the time of generating the core dump.

Attention

The runtime system must completely support the functionality to assure a correct display of variable values in the core dump view.

In the online view of the application that CODESYS created when loading the core dump into the project, menu commands are displayed as available but do not have any effect in this status. When selecting one of these commands, a message is displayed.

Caution

Restriction (CDS-37572): Exception handling in the runtime system may overwrite parts of the variable values in the call stack. Therefore, the original values are lost and important information may no longer be displayed for variables in functions and methods at the time of monitoring.

Note

When creating project archives: If you created a core dump explicitly by clicking Create Core Dump, then this option is available automatically in the archive configuration. On the other hand, if you copied the core dump from the PLC, then you can add it to a project archive only by selecting Additional files. Important: A project archive with a core dump must necessarily include the download information. If it does not, then CODESYS cannot use the core dump.

Loading the core dump and device log into the project for analysis

Requirement: You have a project open with an application that has produced an exception on the controller. The runtime system is able to create core dumps. The application in the project is in offline mode.

  1. Load the required core dump from the controller by clicking Debug ‣ Load Core Dump.

    CODESYS shows an online view of the application. You see the variable values and call stack from the time of error (see below). This includes also the values of the I/O variables in the mapping dialog box of the device configurator and the task configuration. “Core dump loaded” appears in the status line. CODESYS copies the core dump file as <project name>.<device name>.<application name>.<application Guid>.core to the local project directory.

  2. Click Debug ‣ Load device log from Core Dump to load the device log from the time of error into the project.

    The log view opens (as in online mode of the device editor) with the events at the time of the core dump.

  3. After completing the core dump analysis, click Debug ‣ Close Core Dump.

    CODESYS closes the core dump view of the application. The project returns to the normal offline mode with its views.

Creating the core dump of the running application manually

Requirement: A CODESYS application is in online mode. The runtime system supports core dump functionality.

  1. Click Debug ‣ Create Core Dump.

    CODESYS starts generating a new core dump. A progress bar appears in the status line and a button to cancel the process.

    CODESYS saves a core dump file to the local project directory as <project name>.<device name>.<application name>.<application Guid>.core.

See also