Discussion:
checksum byte with a bit error
(too old to reply)
LColes
2007-08-28 07:40:10 UTC
Permalink
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
DirkW
2007-08-28 13:40:11 UTC
Permalink
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
tezaa
2008-07-08 22:40:10 UTC
Permalink
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
Adnan Z
2008-07-09 10:40:06 UTC
Permalink
Hi T,What version of driver do you have? We have <a href="http://joule.ni.com/nidu/cds/view/p/id/921/lang/en" target="_blank">NI-CAN 2.5.2</a> 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
tezaa
2008-07-09 22:10:09 UTC
Permalink
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 greaterthan 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&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;7 C0 08 01 06 04 FB 23So 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&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;4 01 01 01 01This implies it is not a baud rate problem.Any ideas?Many thanks,Terry
Adnan Z
2008-07-10 13:10:09 UTC
Permalink
Hi Terry, One more question, what hardware are you using?
DirkW
2008-07-10 15:40:16 UTC
Permalink
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
tezaa
2008-07-16 03:10:07 UTC
Permalink
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
Loading...