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:
Message counter (byte 2, bit 0..3). Count from 0 to 15 and then start again from 0.
Desired engine speed (byte 2, bit 0 .. byte 3, bit 4 = 13 bits) =
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
Message counter (byte 2, bit 0..3). Count from 0 to 15 and then start again from 0.
Desired engine speed (byte 2, bit 0 .. byte 3, bit 4 = 13 bits) =
0..8191 rpm
I don't understand the checksum XOR statement etc, engine speed request is fine.
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.
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.
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.