SimulinkRealTime.crashInfo

Retrieve information about a target computer CPU exception

Description

Creates an object that reads a crash file from target computer

Some target computers contain hardware that can retain information in memory from before a software restart. If these computers also contain a hard drive, they can save crash data after a fatal error.

Caution

After a fatal error, do not restart the computer manually by using the boot or power switch. A manual restart prevents the computer from saving the crash data.

For Network, DOS Loader, and Removable Disk boot modes, twenty seconds after a fatal error, the target computer restarts itself and saves the crash data on the target computer hard drive.

For Stand Alone boot mode, twenty seconds after a fatal error, the target computer restarts itself, then you can use a manual standalone boot to make the target computer save the crash data on the target computer hard drive. For more information, see Standalone Boot Method.

When the computer is running again, you can call the display function from the development computer to retrieve the crash data.

Creation

cinfo_object = SimulinkRealTime.crashInfo(target_name) and cinfo_object = SimulinkRealTime.crashInfo(settings_object) create and return a crash information object.

If a CPU exception occurred, it calls update and display to print the crash information.

If a CPU exception did not occur, SimulinkRealTime.crashInfo produces an error message.

The SimulinkRealTime.crashInfo function accepts these arguments:

  • target_name — Name assigned to target computer (character vector or string scalar). For example, 'TargetPC1'.

  • target_object — Object representing target computer that had the CPU exception.

  • settings_object — Settings object representing target computer

    Object containing target computer environment settings.

  • cinfo_object — Object representing crash information

    Object that provides properties and functions for accessing crash information.

Properties

expand all

This property is read-only.

Structure with the following customer-relevant fields:

  • MATLABRelease — Version of MATLAB®

  • HasException1 if the CPU had an exception, otherwise 0

  • ModelName — Name of real-time application

  • MdlExecutionTime — Stop time of model

The remaining fields are for MathWorks® internal use only.

This property is read-only.

Structure with the following customer-relevant fields:

  • Found1 if the crash point was found, otherwise 0

  • Message — Message describing location, one of:

    • Found in model code

    • Failed to locate crash point in model code

    • Crash point is outside reachable address space

  • File — Name of crash source file

  • Line — Line number in source file

  • Function — Name of function that causes crash

The remaining field is for MathWorks internal use only.

The line number comes from the value that the program instruction pointer had when the kernel exception handler caught the fatal exception. The crash can come from a previous instruction and therefore from a previous line of code.

Structure with the following customer-relevant fields:

  • TargetTimeAtCrash — Time of crash, according to target computer clock

  • CurrentTargetTime — Time of call to get crash information, according to target computer clock

  • CurrentHostTime — Time of call to get crash information, according to development computer clock

Specifies the model build folder. If the current folder is not the build folder, you can set buildDir to a specific value. The object uses the build folder to locate the model files.

Object Functions

displayDisplay crash information
updateUpdate crash information object

Examples

collapse all

Create a SimulinkRealTime.crashInfo object, get its properties, display crash information.

Wait for the target computer to restart itself and display the error message.

Error: Target computer halted with an exception and restarted
automatically. To get information about the exception, call
SimulinkRealTime.crashInfo from MATLAB.

Create a SimulinkRealTime.crashInfo object.

cinfo_object = SimulinkRealTime.crashInfo('TargetPC1')
Crash information object saved as C:\Users\AppData\Local\...
    Temp\SLRTCrashInfo_2016_28_20_56_00_33.mat

--------------- Crash report ------------------
Crash time:        28-Jun-2016 20:56:00. Current target ...
    computer time: 28-Jun-2016 20:58:00
Model:             testmodel
Crash address:     2003B643
Model base:        20030000
File:              c:\pdbparsing\test_sfun.c, line 106
Function:          mdlOutputs
Message:           Found in model code

For technical support, send the SLRTCrashInfo*.mat file to MathWorks Support (www.mathworks.com/support).

Create a SimulinkRealTime.crashInfo object by name and display crash information.

Wait for the target computer to restart itself and display the error message.

Error: Target computer halted with an exception and restarted
automatically. To get information about the exception, call
SimulinkRealTime.crashInfo from MATLAB.

Create a SimulinkRealTime.crashInfo object.

cinfo_object = SimulinkRealTime.crashInfo('TargetPC1')
Crash information object saved as C:\Users\AppData\Local\...
    Temp\SLRTCrashInfo_2016_28_20_56_00_33.mat

--------------- Crash report ------------------
Crash time:        28-Jun-2016 20:56:00. Current target ...
    computer time: 28-Jun-2016 20:58:00
Model:             testmodel
Crash address:     2003B643
Model base:        20030000
File:              c:\pdbparsing\test_sfun.c, line 106
Function:          mdlOutputs
Message:           Found in model code

Create a simulinkRealTime.crashInfo object by target object and display crash information.

Create and display a SimulinkRealTime.crashInfo object.

target_object = slrt;
cinfo_object = SimulinkRealTime.crashInfo(target_object)
Crash information object saved as C:\Users\AppData\Local\...
    Temp\SLRTCrashInfo_2016_28_20_56_00_33.mat

--------------- Crash report ------------------
Crash time:        28-Jun-2016 20:56:00. Current target ...
    computer time: 28-Jun-2016 20:58:00
Model:             testmodel
Crash address:     2003B643
Model base:        20030000
File:              c:\pdbparsing\test_sfun.c, line 106
Function:          mdlOutputs
Message:           Found in model code

Create a SimulinkRealTime.crashInfo object by settings object and display crash information.

Create and display a SimulinkRealTime.crashInfo object.

settings_object = SimulinkRealTime.getTargetSettings('TargetPC1');
cinfo_object = SimulinkRealTime.crashInfo(settings_object)
Crash information object saved as C:\Users\AppData\Local\...
    Temp\SLRTCrashInfo_2016_28_20_56_00_33.mat

--------------- Crash report ------------------
Crash time:        28-Jun-2016 20:56:00. Current target ...
    computer time: 28-Jun-2016 20:58:00
Model:             testmodel
Crash address:     2003B643
Model base:        20030000
File:              c:\pdbparsing\test_sfun.c, line 106
Function:          mdlOutputs
Message:           Found in model code

Introduced in R2016b