Skip to main content

Diagnostic codes (Faults)

When adding diagnostic to you Simulink model, you are able to read and delete them using the Web UI. To use this mechanism, it is important to implement Diagnostic Trouble Codes (DTC’s) in your model using the library blocks that comes with the GOcontroll blockset. The Web UI retrieves the stored fault codes from memory and visualize them. The diagnostic codes in the dedicated Simulink blocks are stored in the SAE J1939 DTC standard.


Add diagnostic to your Simulink model

  • Search for Diagnostic block in the library browser
  • Add the diagnostic block to your Simulink model
  • Choose the Suspect Parameter Number (SPN)
  • Select the Failure Mode Indicator (FMI)

When your compiled Simulink binary is running on the controller, DTC’s are stored in the folder /usr/mem-diag/.


Read and delete fault codes from Web UI

  • Open your Web UI
  • Navigate to the Faults tab
  • Select the codes you want to delete or delete all the codes

Add code descriptions to improve readability

The SAE J1939 DTC standard is not very readable. It is possible to add fault descriptions to your codes based on SPN. In this case, only the SPN needs to be described. The FMI is automatically added according the SAE standard.

To change the description of the fault codes, a configuration file needs to be edited. This can be done on the controller using a file editor in the terminal or it can be done offline using FileZilla.

When changing the file on the controller, nano is the editor that is installed by default. This example shows the way to edit code_descriptor.json using nano in the SSH terminal.

Command:

nano /usr/mem-diag/code_descriptor.json

Simply add your SPN’s to the file followed by the signal descriptor. Be aware to follow the JSON layout. When you are ready editing the file:

  • CTRL+X to exit the file editor
  • Y to save the modified file

To change the file using FileZilla, navigate to the file code_descriptor.json in:

/usr/mem-diag/

When the file is downloaded, you can edit using your preferred editor like e.g. Notepad++ or Microsoft Visual Code. Be aware to follow the JSON layout. After editing, don’t forget to upload the file back to your controller.

Go to Top