Import ICDs
Import the messages of an ICD from a DBC, CSV, or XLSX file.
Import a DBC file, or a CSV or XLSX file with one line for each field, into an ICD. Each message that the file describes becomes a binary message, such as a CAN frame.
Import a file
Console
Python
TypeScript
- Create the ICD, or open one.
- Click Import at the top of the ICD’s tab. You can also right-click the ICD in the ICDs toolbar and select Import.
- Select a
.dbc,.csv, or.xlsxfile. The extension of the file selects its format.
from pathlib import Path
oven = client.icds.import_file(oven.key, Path("oven.dbc").read_bytes(), "dbc")The format is "dbc", "csv", or "xlsx".
import { readFile } from "node:fs/promises";
const imported = await client.icds.import(oven.key, await readFile("oven.dbc"), "dbc");The format is "dbc", "csv", or "xlsx".
What an import changes
An import replaces all the messages of the ICD with the messages in the file:
- A message in the file with the name of a message in the ICD keeps the key of that message. Each of its fields keeps the key of the field with its name. Tasks that read them continue to work.
- A message or field that the file does not hold is removed from the ICD.
A file that Synnax cannot read stops the import, and the ICD does not change. So does a value that breaks a rule of the ICD’s schema, such as a field with no name. Other problems that a check finds do not stop an import.
DBC files
Synnax makes one message for each BO_ definition in the file, with its CAN ID, and one
field for each signal of the message. It skips VECTOR__INDEPENDENT_SIG_MSG, which
holds the signals that no message sends.
The mask of a J1939 message leaves out the priority and the source address, and for a PDU1 group the destination address. When two messages share a parameter group, the mask keeps the source address. When two PDU1 messages also share a source address, the mask keeps the destination address too.
Synnax skips value tables and value descriptions (VAL_TABLE_, VAL_).
CSV and XLSX files
The first line holds the names of the columns, in any order. Each line after it is one
field. Lines with the same message make one message, with their fields in file order.
Synnax reads the first sheet of an XLSX workbook, and skips empty lines.
message,id,length,field,start_bit,bit_length,kind,scale,units
Status,0x101,8,state,0,8,,,
Status,0x101,8,temperature,8,16,integer,0.1,degC
Engine,0x200,8,rpm,0,16,unsigned,1,rpmColumns
Column names are not case sensitive. message, field, start_bit, and bit_length
are required.
id, extended, and length belong to the message. When more than one line of a
message gives one of them, the lines must agree.
Problems
Most errors name the row or line of the file. In the Console, an error shows under “Failed to import ICD”. Fix the file and import it again.
- Cause
- The first line does not name a required column.
- Fix
- Add the column to the first line.
- Cause
The first line names a column that Synnax does not know, or names a column twice.
- Fix
- Rename or remove the column.
- Cause
- A line leaves a required cell empty.
- Fix
- Fill in the cell.
- Cause
- A cell holds a value that its column does not accept.
- Fix
- Change the value to one that the column accepts.
- Cause
Two lines of one message give different values for
id,extended, orlength.- Fix
Give each line of the message the same value, or leave the cell empty.
- Cause
- A message has an
extendedvalue but noid. - Fix
- Add the
id, or clearextended.
- Cause
A DBC signal ends after the last byte of its message, or its start bit is more than 65535.
- Fix
Correct the start bit and size of the signal, or the size of the message.
- Cause
The size of a DBC signal is 0 or more than 64 bits, or a float signal is not 32 or 64 bits.
- Fix
Correct the size of the signal, or the value type of a float signal.