Examining dump files using WinDbg
![]() | TwinCAT 3.1 Build 4026.21 required The function described here requires at least TwinCAT 3.1 4026.21 |
For analyzing dump files, additional information is added to task dumps and kernel dumps from Windows to facilitate the analysis.
The analysis can be carried out using the WinDbg tool, for which an extension is provided that can extract the following information:
- Listing the loaded TMX drivers
- Reloading the symbols of all loaded TMX modules
- Restoring the crash location of a TwinCAT real-time task
- Export of logging data for the real-time monitor.
The recording of this data must be activated in the System Manager via
System/Real-Time /Debugging/Realtime Logging.
Beckhoff recommends using the classic WinDbg version from Microsoft, as undesirable behavior has occasionally been observed with the newer version (e.g. from the Windows AppStore): https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools
The extension can be installed using the following command:
tcpkg install TwinCAT.XAE.WinDbgExtension
It is installed appropriately so that WinDbg recognizes it directly.
After starting WinDbg, the extension is loaded by entering it in WinDbg: .load TcDbgExt
The command!tc
is then available, which outputs a help text with the functions described above.
Sample output
kd> .load TcDbgExt
kd> !tc
Beckhoff TwinCAT WinDBG Extension:
available commands:
!tc list modules
Lists the above elements of runtime.
Use -h to get specific information for list.
!tc reload
Reloads the symbols of all loaded TwinCAT modules.
The command can operate without XAR debug symbols,
if TwinCAT.XAR.Realtime 2.0.60 or later is used.
!tc ctx
restore twincat exception context for twincat bugchecks
(code=BE00XXXX)
the command can operate without symbols for XAR-Runtime,
if TwinCAT.XAR.Realtime 2.0.60 or later is used.
!tc wrlog <project name> [--path <path>]
Save TE1010 TwinCAT 3 Realtime Monitor project with
recorded data to file(s) with name <project name> TwinCAT.XAR.Realtime 2.1.1 or above is required
for this command to work.
!tc help <cmd>
Print this help text. If <cmd> is set, the help request is forwared to the given command.
