Record Raw CAN Bus Data and Decode Offline!

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

(view in My Videos)

 

obd.pngReady to do a CAN Bus acquisition but don’t have a .dbc file to decode the data? No problem!

 

In Simcenter Testlab (previously called LMS Test.Lab) Version 16A and later it is possible to record the raw CANBUS stream and decode with the .dbc file offline.

 

To record the raw CAN stream:

 

1. Open Simcenter Testlab Signature. In the Channel Setup workbook, choose the “CAN Settings” view from the dropdown in the upper right.   

 

1.pngFigure 1: Go to the “CAN Settings” view.

 2. Setup the raw acquisition as shown in Figure 2:

     A: Select the Can Device used for the acquisition.

     B: Enter a baud rate, for most vehicles this is 500000

     C: Set the device to “Passive”

     D: Click “Apply” to apply the settings. 

     E: Go back to the standard “Channel Setup” view.

 2.pngFigure 2: The “CAN Settings” workbook.

3. Back in the standard “Channel Setup” view, you will notice a new pane: “Digital Bus Channels” in the lower left of the screen.

 

In this area, there is an option to “Save Raw Data”. Check on this option. The raw CAN stream will be acquired.

 

3.pngFigure 3: The “Digital Bus Channels” pane appears in the Channel Setup workbook.

NOTE: Most SCADAS hardware is able to record raw CAN data for later decoding. However, Vector boxes will not support the recording of raw CAN streams. Vector boxes were primarily used with the Scadas III hardware before CAN was embedded in the XSI of the SCADAS Mobile / Recorder units, or the SYSCON, the CN4 card, or the SCADAS XS. Measuring OBDII channels is also not supported with Vector boxes. 

 

Decode the raw CAN offline:

 

1. Replace the entire run into the Input Basket (replacing just the LDSF or RDDF is not sufficient). Right click on the run name and choose “Replace in Input Basket”.

 

4.pngFigure 4: Replace the entire run in the Input Basket.

NOTE: The LDSF contains the raw time data from the run. The RDDF contains the raw CAN Bus stream. The RDDF and LDSF are separate files, though they are stored in the same directory.

 

5.pngFigure 5: The raw CAN stream will be stored in an XSI-CAN file like the one shown above.

NOTE: If there is no RDDF called “Digital Bus Data” it means the raw CAN Bus was not recorded.

 

2. Time Data Selection workbook (see Figure 6):

     A: Ensure the “Data Source” is set to “Input Basket”. Click “Replace” to import data.

     B: Click the “Import digital bus channels” button (black arrow and two yellow lines).

     C: Select the .dbc file corresponding to the CAN device.

     D: It is recommended to change “Interpolation” from “Sample and Hold” to “Linear”.

     E: Click “OK”.

     F: New channels are created for all decoded CAN signals.

     G: Save the decoded CAN Bus channels into the project by pressing the “Save As…” button.               The data will be stored in the project and can be viewed in the Navigator workbook.

 

6.pngFigure 6: Create new channels for all decoded CAN signals.

3. The decoded CAN Bus data is saved into the throughput file of a new folder in the Navigator workbook.

 

7.pngFigure 7: The data is saved into the Throughput folder.

 

NOTE: Legislated OBDII signals do not get recorded in the raw can stream. They must be actively requested during acquisition. They are not broadcast on the CAN Bus by default.

 

Note that this feature is supported on the built-in CAN Bus interface on Simcenter SCADAS Mobile, Simcenter SCADAS Lab, and Simcenter SCADAS XS.  

 

ScadasMobileCAN.pngFigure 8: CANBUS interface on SCADAS Mobile

Recording raw CAN Bus is not available with the USB based Vector box used with SCADAS3. 

 

 

That’s it! Enjoy the convenience of being able to save and decode the raw CAN stream!

 

Questions? Email jacklyn.kinsler@siemens.com or contact Siemens PLM GTAC support.

 

Simcenter Testlab Data Acquisition Links:

Simcenter SCADAS:

Comments
Siemens Phenom Siemens Phenom
Siemens Phenom

If you ever need to view a raw binary canbus file (extension *.rddf), there is a RDDF Conversion tool that comes with Testlab, located here:

 

C:\Program Files (x86)\Simcenter\Testlab 18\bin\RDDFConverterToolGUI.exe

 

This tool converts the binary *.rddf into a ASCII file that can be viewed with Notepad. It can be useful for troubleshooting a raw canbus file to understand if a recording was being made, etc. It has been made to debug CAN measurement. It has not been made for commercial usage.

 

Using the Converter

 

After you start it, the interface looks like this:

 

RDDF_to_ASCII.png

 

Select a RDDF to convert to ASCII using the "Select File" button:

 

Select_File.png

 

Then press the “Convert to ASC” button:

 

Convert_to_ASCII.png

 

When finished, there should be message “File Correctly Converted”. 

 

ASCII File Content

 

It can now be viewed by pressing the “Open ASC File”.  The ASCII file will be opened in Notepad.  It is also possible to view the file using Notepad directly from the Windows file system.  Even though there is a “Open ASC file” button, it is not always necessary to use the converter program to view the data.

 

ASCII_Content.png

 

Each row in the ASCII file is one CAN frame of data, consisting of:

  1. Time Stamp (1st column, highlighted in blue above) when the frame was sent. The time values correspond to the Throughput Time annotated in the LDSF measured simultaneously.
  2. CAN Device (2nd column, highlighted in green above) the SCADAS device used in communication (XS1 is SCADAS XS, CN4 would be a SCADAS CAN4 card, etc). Remark: this column is not always present depending of the type of hardware or the version of the RDDF conversion tool.
  3. The CAN ID (3rd column, highlighted in orange above) is the name of the CAN signal. For example, if the engine rpm has the id “8CF00400”, anytime it sends some data, this column will contain the id “8CF00400”.  As a result, you may see the same id number repeated multiple times. In this example, the CAN ID is coded on 29 bits. Depending on the CAN bus configuration, the CAN ID can be coded on 11 bits or 29 bits.
  4. Message Length (5th column, highlighted in red above) is the length of the message being sent. Classical CAN buses delivers messages up to 8 bytes. With CAN-FD, the message length can go up to 64 bytes. Messages of different length can coexist on the same bus.
  5. Message (6th column, highlighted in purple above) is the actual message. The number of bytes composing the message payload is defined by the message length.

Below is an example of an 8 byte versus a 4 byte message.  In this case, if the raw file (*.rddf) file contained 8 byte messages (top left), it would work with the DBC file shown (bottom).  If the raw file contained 4 byte messages (top right), it would not work with the DBC file.

 

8vs4_DBC_CAN.png

 

In the header of the converter raw CAN file, there is a line “no internal events logged”. This comment is always present in the file. It means that only the payload is logged. Error and warning info is not shown.

 

Example 1: Working CAN

 

The thermocouple TCK8 card works with CANbus on Simcenter SCADAS.  Below is an example of the how results from this card might look when viewing with the converter tool.

  1. The DBC file (picture below) describes four messages.
    • TCK8A_11, CAN ID = 11 = 0xB defines 4 temperature signals.
    • TCK8A_12, CAN ID = 12 = 0xC defines 4 temperature signals.
    • TCK8B_13, CAN ID = 13 = 0xD defines 4 temperature signals.
    • TCK8B_14, CAN ID = 14 = 0xE defines 4 temperature signals.

 

DBC.png

 

2. Messages B, C, D and E are consecutively measured in the RDDF file. The measurement after 10 seconds is shown below.It is 43.25 Celsius.

 

temp.png

 

3. The same position is highlighted in the ASCII conversion file below. After 10.0077 seconds, the signals TCK8A_1 has a value of 0x927C (Signed Integer) = -28036. Using the scale factor and the offset it gives a temperature of 43.25degC = (-28036 * 0.02182) + 655.01

 

temp_can.png

 

Example 2: CAN not Recording

 

If there was a problem recording the raw CAN bus signal, the first indicator is the size of the rddf file.  If the file is 1 KB or less when viewing in Windows explorer.

 

good_vs_bad.png

 

After converting it to ASCII, the file will be empty, except for the header:

empty.png

 

Dreamer
Dreamer

In your article, Version 16A and later it is possible to do. Actually, I have a LMS Test.Lab Version 15A.
Is it possible to record the raw CANBUS stream and decode it even if I don't have a specific CAN bus DBC file and I have a only 15A ver ?