Quote:
Originally Posted by dpeterson3
Thanks. CRC is just a 1's compliment. Java has a class to do the calculation for me! Unfortunately, the network has a 10.xx.yy.zz configuration. However, I am sure there is a way to set the CRIO's address to something else (invoking VxWorks directly from WindRiver) and use the VDS if it works instead of the physical one.
|
A CRC is not a ones complement. A CRC accumulation has feedback from multiple bit positions. That's why it's called a "Cyclic" redundancy check.
To calculate a CRC you need to know the polynominal used. Often but not always it's the 802.3 polynomial x**32 + x**26 + x**23 + x**22 + x**16 + x**12 + x**11 + x**10 + x**8 + x**7 + x**5 + x**4 + x**2 + x + 1 or 0x82608EDB.
You can calculate a CRC an octet at a time using precomputed values and a table lookup or by code that performs the bitshifts. Once upon a time table lookup was always faster. Today, with processor caches, the bitshifting is often faster because the table lookup often requires physical memory accesses.
If the protocol actual involves an XOR instead of CRC that would be a good thing to know. If not, if you find the actual polynomial (and initial value) please post them.