DBC parameter conversion to RealDash CAN format

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

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.

1 Like

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

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 (3.1 KB)

@CommaL please disregard first version, I noticed a few conversion errors, now corrrected as attached
commal.xml (3.1 KB)

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

@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 (1.1 KB)
send you the Python progam I use.

1 Like

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.

subaru.xml (10.9 KB)
Try this

subaru.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