Checksum for Automotive application

JamesC
2010-01-12
2010-01-28
  • JamesC - 2010-01-12

    Hello,

    I require help as i need to create a checksum to validate the information being sent to request engine speed control. I have no experience of this. See the information below.

    I'll need 3 values:

    1. Message counter (byte 2, bit 0..3). Count from 0 to 15 and then start again from 0.

    2. Desired engine speed (byte 2, bit 0 .. byte 3, bit 4 = 13 bits) =

    0..8191 rpm

    1. Checksum byte 0 = byte 1 XOR byte 2 XOR byte 3 XOR byte 4 XOR byte 5 XOR byte 6 XOR byte 7

    I don't understand the checksum XOR statement etc, engine speed request is fine.

    IMG: pg2.JPG

    IMG: pg1.JPG

     
  • ndzied1 - 2010-01-12

    It looks to me as if you just fill in the values you need first in what are called bytes 1 to 8 in the table.

    Then you would perform an Exclusive OR operation on each byte to come up with the check sum. The XOR is a standard function. If you store each byte in a variable it is as simple as:

    ChkSumByte := Byte1 XOR Byte2 XOR... Byte8;

    However, this looks like it might be CANopen or perhaps J1939 and if you are using a function block with one of those systems, it may perform the check sum for you. You should read up on the function you will actually use to transmit or receive the data.

     
  • spfeif - 2010-01-14

    Can you please provide more information. What are you trying to do? What is your setup? It seems you are trying to use a PLC or something to communicate with an Engine ECU? What MFG engine?

    Norm is correct that this checksum and so forth may be part of CAN and not required by you. the document that you showed has traces of J1939 (500kb, 10msec updates) but the IMO_01 is not a PGN that is recognized. Typically you would use the TSC1 message to control the engine speed and torque. This may need to be setup in advace with your engine MFG.

     
  • JamesC - 2010-01-28

    Thank you for the replies, i have now had some assistance creating this XOR statement to create the Check Sum and it works well.

    This was required to allow the transmission of Engine control request IMO_01 in i.d 78H on CAN standard ISO 15765, the only trouble is now i don't think my Check Sum can operate quick enough for the change in transmitted data from the throttle pedal. I need a fast count block but i can't find on in my libaries.

     

Log in to post a comment.