Intel: start bit is the LSB
Bits are numbered from the least significant bit of byte 0 and the signal grows upward, crossing into the next byte once a byte is full. Little endian.
Paste a payload, describe the signals the way your DBC does, and see every raw value, physical value and the exact bits each one uses. Edit a value and the payload follows.
Bytes separated by spaces, for example 00 00 40 1F
Raw range 0 to 65535
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|
| 0 | ||||||||
| 1 | ||||||||
| 2 | ||||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 |
| Signal | Raw value | Hex | Physical value | Unit |
|---|---|---|---|---|
| Engine_Speed | 1F40h | rpm | ||
| Coolant_Temp | 5Ah | °C | ||
| Throttle_Pos | 80h | % | ||
| Gear | 5h |
Four steps, and nothing leaves your browser.
Pick the byte order and value type, then enter the start bit, length, factor, offset and unit exactly as your DBC lists them.
Enter the data bytes of one frame in hex. Spaces, commas and 0x prefixes are all fine, and CAN FD payloads of up to 64 bytes work.
The table gives the raw integer, its hex form and the physical value of each signal. The bit layout shows which bits each one occupies.
Type a new raw or physical value, or click a bit, and the payload updates. Add more signals to see a whole message at once.
A CAN frame carries only bytes. The signal definition says which bits to pick, in what order, and how to turn the resulting integer into an engineering value.
The start bit, length and byte order select a run of bits in the payload. Bit 0 is the least significant bit of byte 0.
The selected bits are read as one integer. For a signed signal the top bit is the sign, so the integer is read as two's complement.
The raw integer is multiplied by the factor and the offset is added. The result is the value in the signal's unit.
# 0x1F40, factor 0.25, offset 0
raw = 0x1F40 # 8000
physical = raw * 0.25 + 0 # 2000# 3000 rpm back to bytes
raw = round((3000 - 0) / 0.25) # 12000
bytes = 0x2EE0 # E0 2E, IntelA signed 12-bit signal covers -2048 to 2047. When its top bit is set, subtract 2^12 from the unsigned reading: 0xF9C is 3996 unsigned, and 3996 - 4096 gives -100.
A DBC start bit means something different for each byte order, and mixing them up is the usual reason a decoded value looks wrong.
Bits are numbered from the least significant bit of byte 0 and the signal grows upward, crossing into the next byte once a byte is full. Little endian.
The start bit is the most significant bit. The signal runs down toward bit 0 of its byte, then jumps to bit 7 of the next byte. Big endian, written @0 in a DBC.
The vocabulary you meet in DBC files and CAN tools.
Every signal is one SG_ line. Read it left to right and you have every input the calculator asks for.
BO_ 416 EngineData: 8 ECU
SG_ Engine_Speed : 16|16@1+ (0.25,0) [0|16383.75] "rpm" Gateway| Part | Meaning |
|---|---|
| Engine_Speed | Signal name |
| 16|16 | Start bit | length in bits |
| @1 | Byte order: 1 is Intel, 0 is Motorola |
| + | Value type: + is unsigned, - is signed |
| (0.25,0) | Factor and offset |
| [0|16383.75] | Minimum and maximum physical value; informational, not used in the calculation |
| "rpm" | Unit |
| Gateway | Receiving node |
The BO_ line above the signals gives the message ID and length, for example BO_ 416 EngineData: 8 ECU. A DBC stores the ID in decimal, so 416 is 0x1A0.
Load any of these into the calculator to follow the arithmetic.
@1+ 16|16 (0.25,0)
00 00 40 1F 00 00 00 00
Intel, start 16, 16 bits. The bytes 40 1F read as 0x1F40, which is 8000 raw. At a factor of 0.25 that is 2000.
@0+ 7|12 (0.1,0)
12 34 00 00 00 00 00 00
Motorola, start 7, 12 bits. All of byte 0 (12) and the top nibble of byte 1 (3) make 0x123, or 291. At a factor of 0.1 that is 29.1.
@1- 0|12 (0.1,0)
9C FF 00 00 00 00 00 00
Intel, start 0, 12 bits, signed. The bytes 9C FF give 0xF9C, which is 3996 unsigned. The top bit is set, so subtract 4096 to get -100, or -10.0 at a factor of 0.1.
Almost every wrong value traces back to one of these.
A Motorola start bit points at the most significant bit and an Intel one at the least significant bit. Entering a Motorola signal as Intel selects other bits and gives a believable but wrong number.
Motorola bits are numbered inside each byte while the signal walks across bytes in network order. A tool that shows one flat bit index can disagree with the DBC start bit, so check the bit layout.
Reading a signed signal as unsigned turns -100 into 3996. When a value jumps to the top of its range, check the value type.
Temperatures are often stored as the value plus 40. Without the offset every reading is 40 degrees too high.
A signal that reaches byte 9 cannot be read from an 8-byte payload. Check the DLC, since the message may be a CAN FD frame.
The raw value is the integer sitting in the bits. The physical value is raw × factor + offset, which is what the DBC publishes as the engineering value, such as rpm or degrees Celsius.
The most common cause is the wrong byte order. A Motorola start bit points at the MSB, an Intel start bit at the LSB, so the same number selects different bits. Check signedness too: a set top bit is a negative number for a signed signal.
Pick the byte order from the DBC (@1 is Intel, @0 is Motorola) and enter the start bit exactly as the DBC lists it. The bit layout shows which bits of each byte are used, so you can check the signal covers the bytes you expect.
Yes. Paste up to 64 bytes. Signals up to 64 bits long are handled exactly, including values beyond 2^53 that plain JavaScript numbers would round.
Yes. Change the physical value and the calculator writes the nearest raw value into the payload, leaving every other bit alone. If the value falls outside what the signal can hold it is clamped and you are told.
No. The arithmetic runs in your browser, so the payload and definition never leave the page.
Not yet. Each signal is decoded as if it were always present. For a multiplexed message, enter only the signals that apply to the multiplexer value you are looking at.
Subtract the offset and divide by the factor, then round to the nearest integer: raw = round((physical - offset) / factor). Editing the physical value in the table does this and writes the bits into the payload.
From 1 to 64 bits, as in the DBC format. The raw value is handled as an exact integer, so 64-bit signals do not lose precision.
The next job after this one, each on its own page.