Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

checksum byte with a bit error

I am currently writing a .Net 2.0 wrapper for the NI-Can API so i can use with software i am writing.  When i send a frame using the ncWrite function and then call the ncRead function as i am expecting a response. The repsonse i get is a Frame Error with the error code C008, the description of the error code says The LIN Interface slave task recieved a checksum byte with a bit error.
 
Can some explain a bit more about this and the likely causes as i am a bit confused
0 Kudos
Message 1 of 8
(5,935 Views)

We had a checksum calculation bug with NI-CAN 2.4 and 2.5. This only appears if you receive LIN frames from a non NI device with advanced checksum anabled.

This issue should be fixed with our new driver releasing soon. If you need an urgend fix, please contact your local branch office.

DirkW

0 Kudos
Message 2 of 8
(5,929 Views)
Hello,

I have the same checksum problem. (I am trying to interface the Ni Lin interface with a non-NI LIN transceiver).

However, I have not specified that the Ni LIN interface should be using advanced check-summing. Therefore I assume it's only using basic check-summing. In anycase, it appears there is a bug with the NI software and I have waisted a lot of time on this 😞

I note that the last post was almost a year ago ...
 
When are the latest drivers going to be released?
Is there any way around this problem (ie: Editing the API?)
How can I ensure the Ni-Interface is using basic check-summing?

Any further information on the probem would be appreciated.

Many thanks,
T
0 Kudos
Message 3 of 8
(5,597 Views)
Hi T,

What version of driver do you have? We have NI-CAN 2.5.2 released on Oct. 2007 and I think those must be the drivers Dirk might be referring to. If you are still facing issues with the new drivers, give us a description of the issue you are facing so we can help you out.


Message Edited by Adnan Z on 07-09-2008 11:38 AM
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 8
(5,584 Views)
Thanks Adnan,

Apologies, I am indeed running NI-CAN 2.5.2 (I assumed I was looking for V2.6).

Just so I am clear on check-summing, I refer to the NI-CAN H/W S/W Manual:

"Classic checksum is calculated by summing the data bytes alone"

"The LIN 2.0 specification defines the checksum calculation process as the
summing of all values and subtraction of 255 every time the sum is greater
than or equal to 256 (unlike modulo-255 or modulo-256)."

"The NI LIN interface provides an attribute to set the checksum type to classic or enhanced.
The default setting is classic."

So if I assign my FOUR databytes each to 0x01, I calculate my checksum to be 0x04.

However, when using NI's "LIN Master Send Header and Receive" C++ example, I get the following error:
LIN Error Frame        7 C0 08 01 06 04 FB 23

So my checksum is being received correctly (04) but why is the expected checksum FB?
In fact, if I hard code my checksum to be FB, I receive a Full frame without problem.
LIN Full Frame        4 01 01 01 01

This implies it is not a baud rate problem.

Any ideas?

Many thanks,
Terry



0 Kudos
Message 5 of 8
(5,567 Views)
Hi Terry,

One more question, what hardware are you using?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 6 of 8
(5,555 Views)

Hi,

The classic checksum doesn't only sum the databytes it inverts the final result at the end. That makes an "FB" from your "4".

DirkW

0 Kudos
Message 7 of 8
(5,552 Views)
Thanks for that.

Yes "0xFB" is indeed the inverse of "0x04" - and it works AOK now. Don't know why I didn't see that myself - probably because I wasn't looking for it.

I have not seen any documentation suggesting that the checksum is inverted (but I could be blind).

Many thanks again,
Terry
0 Kudos
Message 8 of 8
(5,529 Views)