0
\$\begingroup\$

I have a DBC file and inside of this file there are the lines bellow:

BO_ 1 BCS_Vout: 8 HIL SG_ Vout_01 : 0|15@1+ (4,800) [0|32767] "mV" BCS

BO_ 1 BCS_Load: 8 HIL SG_ Load_01 : 0|15@1+ (5,0) [0|32767] "mA" BCS

How the ECU will differentiate between these messages, since the message ID are the same?

TIA

\$\endgroup\$
3
  • \$\begingroup\$ What is a DBC file? What ECU are you talking about? What is the format that you are looking at? \$\endgroup\$
    – Ron Beyer
    May 1, 2020 at 23:25
  • \$\begingroup\$ It is about CANBUS \$\endgroup\$
    – JRbarros
    May 1, 2020 at 23:29
  • 1
    \$\begingroup\$ It would help to see the raw PDU. \$\endgroup\$
    – Ron Beyer
    May 1, 2020 at 23:59

2 Answers 2

1
\$\begingroup\$

Short answer is: almost certainly the ECU can not distinguish these two messages.

DBC is not a public format, it is proprietary format of Vector so this answer, and usually any answer, is only based on partial discosure from Vector examples, experience and well established DBC-friendly public tools like cantools.

Usually this dbc rules get written like this

BO_ 1 BCS_Vout: 8 HIL
 SG_ Vout_01 : 0|15@1+ (4,800) [0|32767] "mV" BCS

BO_ 1 BCS_Load: 8 HIL
 SG_ Load_01 : 0|15@1+ (5,0) [0|32767] "mA" BCS

I am not sure that they are strictly DBC format compliant, putting BO_ and SG_ in the same rows, but I experimented myself that (maybe tolerant) tools like cantools accept it both ways.

You can test the resulting DBC file (with the five line at the start of this answer or the three lines in the question)

$ cat 497070.dbc
BO_ 1 BCS_Vout: 8 HIL SG_ Vout_01 : 0|15@1+ (4,800) [0|32767] "mV" BCS

BO_ 1 BCS_Load: 8 HIL SG_ Load_01 : 0|15@1+ (5,0) [0|32767] "mA" BCS

with such tool and your suspects are confirmed, the two definitions override each other

$ echo "  can0  1   [8]  31 00 FA 01 D6 00 00 45" | cantools decode 497070.dbc
Overwriting message 'BCS_Vout' with 'BCS_Load' in the frame id to message dictionary because they have identical masked frame ids 0x1.
  can0  1   [8]  31 00 FA 01 D6 00 00 45 ::
BCS_Load(
    Load_01: 245 mA
)

where:

  • file name 497070 is irrelevant for the test and is the actual id of this question
  • message can0 1 [8] 31 00 FA 01 D6 00 00 45 match the dbc rules because it has arbitration id 1 and the specified 8 byte of message length, message data bytes are close to random, interface name can0, again, is irrelevant
  • cantools explains that the rules overlap and the last one win so the message is decoded as a Load_01 signal

Using multiplexing technique it is possible to have one of this two DBC rules triggered by another "unused" part of the message, but this is not the case because an additional field should be present, like this

BO_ 1 BCS_Vout: 8 HIL
 SG_ Vout_01 m<some-value> : 0|15@1+ (4,800) [0|32767] "mV" BCS

for instance

BO_ 1 BCS_Vout: 8 HIL
 SG_ Vout_01 m322 : 0|15@1+ (4,800) [0|32767] "mV" BCS

which is not.

Further analysis probably requires taking into consideration the complete DBC file and some CANBUS data dump.

\$\endgroup\$
0
\$\begingroup\$

You can do multiplexing. You need some sort of flag or switch in the signals that indicates weather you are seeing Voltage or Load. Otherwise there isn't a way to do this based on the arbitration id.

Here are some app notes from vector: Vector App Note

Here is an example of the format from Socialledge:

BO_ 200 SENSOR_SONARS: 8 SENSOR
 SG_ SENSOR_SONARS_mux M : 0|4@1+ (1,0) [0|0] "" DRIVER,IO
 SG_ SENSOR_SONARS_err_count : 4|12@1+ (1,0) [0|0] "" DRIVER,IO
 SG_ SENSOR_SONARS_left m0 : 16|12@1+ (0.1,0) [0|0] "" DRIVER,IO
 SG_ SENSOR_SONARS_middle m0 : 28|12@1+ (0.1,0) [0|0] "" DRIVER,IO
 SG_ SENSOR_SONARS_right m0 : 40|12@1+ (0.1,0) [0|0] "" DRIVER,IO
 SG_ SENSOR_SONARS_rear m0 : 52|12@1+ (0.1,0) [0|0] "" DRIVER,IO
 SG_ SENSOR_SONARS_no_filt_left m1 : 16|12@1+ (0.1,0) [0|0] "" DBG
 SG_ SENSOR_SONARS_no_filt_middle m1 : 28|12@1+ (0.1,0) [0|0] "" DBG
 SG_ SENSOR_SONARS_no_filt_right m1 : 40|12@1+ (0.1,0) [0|0] "" DBG
 SG_ SENSOR_SONARS_no_filt_rear m1 : 52|12@1+ (0.1,0) [0|0] "" DBG
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.