0

SPN 4207 checksum support

JohnNix 4 days ago in IQANdesign 0

I've been using the CRC parameter in IQAN design for J1939 messages that require SPN 4206 (rolling counter) and SPN4207 (checksum). I can't find a configuration that works. I assumed that the "J1939 checksum" option was for SPN4207 but that doesn't seem to be the case (I just get checksum errors from the destination device). Am I missing something or is the CRC parameter not configurable for SPN 4207? I'm having to do it the long way around doing the calculation (it works but it's very messy). SPN4207 is a 4 bit checksum (as below), SPN4206 is a 4 bit rolling counter.

Checksum = 
(Byte1 + Byte2 + Byte3 + Byte4 + Byte5 + Byte6 + Byte7 + 
message counter & 0x0F + 
message ID low byte + message ID mid low byte + message ID mid high byte + message ID high byte)

Message Checksum = (((Checksum >> 6) & 0x03) + (Checksum >>3) + Checksum) & 0x07