CANedge MF4 decoders overview

The MF4 decoders, take a set of input-files[1] (containing encoded records), a set of DBC database-files (containing decoding rules), and produce a set of output-files (containing decoded signals).

Additional information common for all decoders can be found here:

The specific decoders can be found in the menu to the left.


Command line interface

All MF4 decoders are designed as command-line-interface (CLI) tools. Each decoder can output a list of supported arguments by supplying the --help argument. Below is an example of a help text.

--help                                display this help and exit
-v, --version                         display tool version and exit
--verbosity=<n>                       verbosity level (0 to 4, 0=disable, 4=verbose, default=2)
--non-interactive                     does not print any progress output
-d, --delete-converted                deletes files after conversion if specified
-X, --no-append-root                  do not add "_out" when converting folders
-b, --buffer=<n>                      buffer size in bytes. 0 disables and -1 takes entire file
-p, --password-file=<file>            path to decryption passwords file (default=passwords.json)
--concat                              concatenate output when possible (default)
--no-concat                           do not concatenate output
--pgn-src-merge                       merge PGN source addresses
--no-pgn-src-merge                    do not merge PGN source addresses (default)
--pgn-dst-merge                       merge PGN destination addresses (default)
--no-pgn-dst-merge                    do not merge PGN destination addresses
--dbdump                              dump DBs as json (in working dir)
--no-dbdump                           do not dump DBs as json (default)
--dbc-can*=<file>                     path to DBC file for CAN (e.g. for channel 1 --dbc-can1=<path>)
--dbc-lin*=<file>                     path to DBC file for LIN (e.g. for channel 1 --dbc-lin1=<path>)
-O, --output-directory=<file>         path to output files
-i, --input-files=<file(s)/folder(s)> paths to input files/folders (must have common root)

Warning

The --dbc-* input arguments can be repeated to assign multiple DBC-files to one interface/channel. When multiple DBC-files are assigned to the same interface/channel, it is the responsibility of the user to avoid ID-collisions.


J1939 PGN behavior

Bus IDs using (J1939) PGN format, contain node-source and (potentially) node-destination addresses. The decoders can be configured how to handle these addresses using below input arguments:

  • PGN source address:
    • --pgn-src-merge: All source addresses are merged to generate one output

    • --no-pgn-src-merge: Each source-address generates a separate output

  • PGN destination address:
    • --pgn-dst-merge: All destination addresses are merged to generate one output

    • --no-pgn-dst-merge: Each destination-address generates a separate output


Result summary

On completion, the MF4 decoders displays a result summary similar to below example.

-------------------------------------------------------------------------------
Reader summary
- Files: 1
- Messages: 21312
- Size: 8 MB
-------------------------------------------------------------------------------
Transport protocol summary
- Successful sessions: 21312
- Failed sessions: 0
- Unfinished sessions: 0
-------------------------------------------------------------------------------
Writer summary
- Files: 8
- Messages: 21312
- Signals: 85248
-------------------------------------------------------------------------------
Execution time: 4 s
-------------------------------------------------------------------------------

Reader summary

Summary of processed input MF4 files.

Transport protocol summary

Summary of transport protocol sessions.

Note

Transport protocol transmissions can fail (e.g. if the receiving node is not ready). Expect some failed session.

Writer summary

Summary of generated output files including the number of decoded messages and signals.


Tips & tricks

Below follows a collection of tips and tricks on how to use the decoders.

Alternative way of providing DBC-files

If no DBC-file paths are provided via the --dbc-* input arguments, the decoder searches the working directory[2] for DBC-files matching the following pattern: ^(can|lin)(\d+)-(\S*)\.dbc$

Examples:

  • CAN channel 1: can1-obd.dbc

  • CAN channel 2: can2-canmod-gnss.dbc

  • CAN channel 9: can9-internal.dbc

  • LIN channel 1: lin1-truck.dbc

  • CAN channel 1: can1-obd.dbc, can1-canmod-gnss.dbc (two DBC-files associated with CAN channel 1)


Alternative way of providing password-file

If no password-file path is provided via -p / --password-file input argument, the decoder searches the working directory[2] for a file named passwords.json.

For more information on the password file see Information on encrypted input-files.


Drag-and-drop (Windows only)

When dropping files/folders on an executable on Windows, the executable is executed with the full paths of the dropped elements appended as the final input arguments. The decoders take the input files (-i / --input-files) as the final argument(s). Organizing the input arguments this way enables support for drag-and-drop decoding of single file/folder or multiple files/folders using the default decoder settings.

When using drag-and-drop, DBC-files should be provided as explained here: Alternative way of providing DBC-files.

Dragging and dropping the input directory AABBCCDD onto the executable effectively executes the decoder with:

mdf2csv_decode.exe [FULL-PATH]/AABBCCDD

It is possible to use drag-and-drop with custom arguments. This can be done by creating a Windows shortcut to the executable and adding the custom arguments to the shortcut target. E.g. a shortcut can be created to always output files to a specific directory and to not append the _out prefix with:

"C:\decoder\mdf2csv_decode.exe" -X -O "C:\decoder\static_output_dir"


Reduce output-size

Specific messages or signals can be ignored in the output using the custom DBC-attributes described here:

Note

If specific messages are irrelevant, consider applying filters directly on the CANedge device


Output concatenation

When the --concat option is enabled (default), the decoders attempt to concatenate output-files (as explained in detail here: Output concatenation). Concatenation of output-files can in some cases greatly reduce the number of output-files, which in turn can reduce post-processing time significantly.

Note

When running the decoders for one input-file at a time, it becomes impossible to concatenate output-files. Consider re-running decoders on a full set of input files to optimize concatenation.


Database dump to json

The --dbdump input argument can be used to dump the internal interpretation of the loaded databases as json files. This can be useful for troubleshooting.


Limit on open files

The decoders potentially generate a large number of output files. During decoding, multiple files can be open at the same time. In extreme cases (with huge databases), the system limit of open file handles (for a specific process) can be reached - preventing the decoders from creating new files.

On Linux, the limit of allowed open files can be set with ulimit -n, e.g.:

Change max allowed open files from 1024 to 2048
$ ulimit -n
1024
$ ulimit -n 2048
$ ulimit -n
2048

Note

If ulimit -n <value> returns Operation not permitted, then the requested new limit is too high