# DBC parameter conversion to RealDash CAN format

**URL:** <https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962>\
**Category:** RealDash CAN\
**Created:** [October 18, 2023, 4:18am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962 "2023-10-18T04:18:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 18, 2023, 4:18am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/1 "2023-10-18T04:18:08Z")

</div>

Hi, I am looking for some guidance regarding translation of DBC parameters into RealDash CAN equivalent. I have been using Python with cantools library to achieve this, but recently noticed an anomaly, which I cannot rationalise other than there being some error in the Python translation although I have many working signals / values already.

720\_B2 is the gear shift (P, R, N, D) and 720\_B3 is the manual selection (4, 3, 2, L).

For 720\_B2 using RealDash CAN Monitor in decimal I get (P=9, R=2, N=12, D=16), however, logging these same parameters in RealDash DataLogging gives me (P=18, R=4, N=24, D=32) with same doubling effect for 720\_B3

## DBC

BO\_ 720 MP10: 8 FJ\_CRUISER  
SG\_ ID720\_B2 : 23|8@0+ (1,0) [0|0] “” Vector\_\_XXX  
SG\_ ID720\_B3 : 31|8@0+ (1,0) [0|0] “” Vector\_\_XXX

## RealDash

frame canId=“0x2d0” endianess=“big”\>  
value name=“MP: ID720\_B2” startbit=“23” bitcount=“8” units=“None” signed=“false” rangeMin=“None” rangeMax=“None” /value  
value name=“MP: ID720\_B3” startbit=“31” bitcount=“8” units=“None” signed=“false” rangeMin=“None” rangeMax=“None”/value  
/frame

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 21, 2023, 8:37am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/2 "2023-10-21T08:37:35Z")

</div>

By way of an update, I realised the Python code I was using to convert from DBC to RealDash XML needed to be recoded.

Whilst the conversion of single bit values using startbit / bitcount was fine; this was not the case with multiple bit and byte values, which was introducing an undesirable bit shift.

Apart from single bit values, the code now converts using offset / length only and this is now working fine. It also explains why canbus sniffing values has been so troublesome.

---

<div class="post-metadata">

**Author:** ![CommaL](https://forum.realdash.net/user_avatar/forum.realdash.net/commal/32/29_2.png) [@CommaL](https://forum.realdash.net/u/CommaL)\
**Post date:** [October 21, 2023, 4:11pm UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/3 "2023-10-21T16:11:12Z")

</div>

translation so can i run this code in realdash ?

BO\_ 947 BodyInformation\_3\_MS: 8 XXX  
SG\_ CamraDefog\_B\_Req\_UB : 58|1@0+ (1,0) [0|0] “” XXX  
SG\_ TrStats\_D\_Actl\_UB : 48|1@0+ (1,0) [0|0] “” XXX  
SG\_ RearFog\_Lamp\_Dbnce\_UB : 49|1@0+ (1,0) [0|0] “” XXX  
SG\_ TrStats\_D\_Actl : 13|2@0+ (1,0) [0|0] “” XXX  
SG\_ CamraDefog\_B\_Req : 40|1@0+ (1,0) [0|0] “” XXX  
SG\_ RearFog\_Lamp\_Dbnce : 0|1@0+ (1,0) [0|0] “” XXX  
SG\_ CarMode : 53|4@0+ (1,0) [0|0] “” XXX  
SG\_ Day\_Night\_Status : 15|2@0+ (1,0) [0|0] “” XXX  
SG\_ Parklamp\_Status : 3|2@0+ (1,0) [0|0] “” XXX  
SG\_ Dimming\_Lvl : 31|8@0+ (1,0) [0|0] “” XXX  
SG\_ Litval : 23|8@0+ (1,0) [0|0] “” XXX  
SG\_ Mfs\_Turn\_Stalk\_SW\_Status : 11|2@0+ (1,0) [0|0] “” XXX  
SG\_ PwMdeExten\_D\_Actl : 63|5@0+ (1,0) [0|0] “” XXX  
SG\_ STR\_WHL\_ANGLE : 39|15@0+ (0.1,-1000.0) [0|0] “Degrees” XXX  
SG\_ Turn\_Seq\_Cmd\_Right : 7|2@0+ (1,0) [0|0] “” XXX  
SG\_ Turn\_Seq\_Cmd\_Left : 5|2@0+ (1,0) [0|0] “” XXX  
SG\_ Smart\_Wiper\_Motor\_Stat\_UB : 8|1@0+ (1,0) [0|0] “” XXX  
SG\_ Smart\_Wiper\_Motor\_Stat : 55|2@0+ (1,0) [0|0] “” XXX  
SG\_ Mfs\_Turn\_Stalk\_SW\_Status\_UB : 9|1@0+ (1,0) [0|0] “” XXX  
SG\_ reserve : 1|1@0+ (1,0) [0|0] “” XXX

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 22, 2023, 3:49am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/4 "2023-10-22T03:49:26Z")

</div>

Hi @CommaL attaching the XML translation, noting the single bit units="bit’ will be fine as will the full byte values shown with offset / length, but you may have to tweak the startbit for the 2 bit, 5 bit, and 15 bit signals in your list to get these to work  
[commal.xml](https://forum.realdash.net/uploads/short-url/9ruOQ5eZTEs3iILrkNTeOow6K8h.xml) (3.1 KB)

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 22, 2023, 4:06am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/5 "2023-10-22T04:06:43Z")

</div>

@CommaL please disregard first version, I noticed a few conversion errors, now corrrected as attached  
[commal.xml](https://forum.realdash.net/uploads/short-url/3O5LVvhqJ2m7ty3oIQjfNO8rjeq.xml) (3.1 KB)

---

<div class="post-metadata">

**Author:** ![CommaL](https://forum.realdash.net/user_avatar/forum.realdash.net/commal/32/29_2.png) [@CommaL](https://forum.realdash.net/u/CommaL)\
**Post date:** [October 22, 2023, 8:19am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/6 "2023-10-22T08:19:14Z")

</div>

Thank you very much for your answer. I found the codes on the internet and you translated them, unfortunately it did not work.  
My car is ford fiesta mk8 screen. I have codes that I work on my desk. Please help me if I share.

//Vehicle Alarm + Parking Brake  
opSend(0x3C3, 0x00, B11111111, handbrake, brakeApplied, 0x00, 0x00, 0x00, 0x00);  
//Bytes 1/2: B11111111=Alarm  
//Byte 3: B00010000=Park Brake

//ABS  
opSend(0x416, 0x0E, 0x00, 0x00, 0x00, 0x00, tc, 0x00, 0x00);  
//Byte 6: B00000100=Slow flashing TC, B00000010=Solid TC Light  
//Byte 7: B10000000=Rapid flashing ABS, B01000000=Solid ABS

//TPMS  
opSend(0x3b4, tpms, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);  
//Byte 1: 49=Shows Low Tire Pressure Menu, B00000100 shows still tire warning, B00001000 shows flashing tire warning  
//Byte 2: Highlights Front R and L tires  
//Byte 3: Same as above but rear

//ECU  
opSend(0x421, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);  
//Byte 1: B00001000=Flashing CEL, B00000100=Solid CEL

//Charging System  
opSend(0x42C, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x00);  
//Byte 2: 17=Charge Light (No Message on Screen)

//Power Steering  
opSend(0x877, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

//Language?  
opSend(0x191, 65, 17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);  
//Byte 1: Units; 65=KM and CELSIUS  
//Byte 2: 17=English, 35=German

//Outside Temp  
opSend(0x3B3, 0x00, 0x00, 0x00, 0x00, 125, 0x00, 0xFF, 0x00);  
//Byte 5: Outside Temp Value → 125=22°C

//Front Camera  
opSend(0x3D8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

//Tractioncontrol  
opSend(0x46A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

//High Beam + Auto Hed  
opSend(0x46B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, fullBeam);  
//Byte 8: B00110000=High Beam

// RPM  
opSend(0x42F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, rpmgate, finetune);

// Speedometer INOP  
opSend(0x202, 0x40, 0x00, 0x00, 0x00, distance, distance, speed, finetuner);

opSend(0x591, 0x91, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); // Keep alive signal  
opSend(0x3B2, 0x45, 0x00, 0x00, 0x8E, B00000000, 0x00, B00000000, 0x00); //Ignition  
opSend(0x179, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00); //Odometer and Service  
opSend(0x156, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00); //Coolant  
opSend(0x04C, 0x00, 85, 85, 0x00, 0x00, 0x00, 0x00, 0x00); //Airbag  
opSend(0x213, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //Parking Brake (Fusion 2013)  
opSend(0x3C3, 0x00, B11111111, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //Vehicle Alarm + Parking Brake  
opSend(0x416, 0x0E, 0x00, 0x00, 0x00, 0x00, B00000000, B00000000, 0x00); //absLight  
opSend(0x3b4, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //TPMS  
opSend(0x421, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //ECU  
opSend(0x42C, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x00); //Charging System  
opSend(0x877, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //Power Steering  
opSend(0x191, 65, 17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //Language?  
opSend(0x3B3, 0x00, 0x00, 0x00, 0x00, 100, 0x00, 0xFF, 0x00); //Outside Temp  
opSend(0x3D8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //Front Camera  
opSend(0x46A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //Tractioncontrol  
opSend(0x46B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, B00000000); //High Beam + Auto Hed

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [October 22, 2023, 11:40am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/7 "2023-10-22T11:40:47Z")

</div>

@CommaL I did the first two frames for you as attached. Suggest you get a copy of Kvaser Database Editor which is great for managing the source DBC file, if you send me the DBC file I am happy to convert to RealDash XML or alternatively I can  
[ford\_fiesta\_can.xml](https://forum.realdash.net/uploads/short-url/8Acwdgonjg9rd5us40rb7ZdAjSq.xml) (1.1 KB)  
send you the Python progam I use.

---

<div class="post-metadata">

**Author:** ![WOOL2007](https://forum.realdash.net/letter_avatar_proxy/v4/letter/w/9de0a6/32.png) [@WOOL2007](https://forum.realdash.net/u/WOOL2007)\
**Post date:** [May 12, 2024, 8:34pm UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/8 "2024-05-12T20:34:56Z")

</div>

hI mmain .Could you please help me in converting DBC to xml format. I have a DBC file from Rusefi can Verbose and I would like to apply it in Realdash for my Subaru Legacy. Can you help me do it. Thank you in advance.

> <https://github.com/rusefi/rusefi/blob/master/firmware/controllers/can/rusEFI_CAN_verbose.dbc>

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [May 13, 2024, 2:54pm UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/9 "2024-05-13T14:54:56Z")

</div>

[subaru.xml](https://forum.realdash.net/uploads/short-url/l8Tiw0ub4BCTGhiEV60FCuAU1vl.xml) (10.9 KB)  
Try this

---

<div class="post-metadata">

**Author:** ![mmain](https://forum.realdash.net/user_avatar/forum.realdash.net/mmain/32/651_2.png) [@mmain](https://forum.realdash.net/u/mmain)\
**Post date:** [May 14, 2024, 2:14am UTC](https://forum.realdash.net/t/dbc-parameter-conversion-to-realdash-can-format/3962/10 "2024-05-14T02:14:03Z")

</div>

[subaru.xml](https://forum.realdash.net/uploads/short-url/sz31I6QEkWuLS3QPG1fqoSj7zw5.xml) (9.7 KB)  
Please ignore earlier and use this instead; once confirmed working it would be worthwhile removing “name” entries in favour of targetId to align with RealDash
