Toro,
I do this support at home but have some of the information in the office.
From another track someone was talking to a Knick 73 instrument. From the documentation I see it uses a CRC CCITT-X.25 builded with the following conditions:
Precondition is set to 0.
Polynom is x^16+x^12+x^5+1
Postcondition is not inverting
From your mail I see you need:
Precondition is set to 0xFFFF
Polynom is x^16+x^12+x^5+1
Postcondition is inverting
Since the VI from Shane and the one which works with the Knick instrument calculate the same CRC it has the right polynom. Modify the VI in the following manner:
There is a constant labeled CRC16 which goes to the shift register of the outer loop. This is the precon
dition. Change this to 0xFFFF.
The other side is the CRC. Insert a boolean invert before the branch to the indicator and type cast.
Another optimization you can do is to move the Build array which is located in the outer loop before the outer loop and use a tunnel with indexing disabled. I don't know if the optimizer of LabVIEW will see that the array is constant with each iteration of the outer for loop. This is even another variant part in CRC calulation. This array hold the power of 2 numbers in decreasing order. You can also do this in increasing order.
For your understanding:
CRC is
not a byte stream it is a bit stream calculation. Mathematically is does not operate on bytes it operates on bits. Therefore you have to define which bit of a byte you have to process first.
I think the modified VI will calculate the right CRC.
Thanks to my ISR providing a web interface to my mailbox so I can reach it from the office.
Waldemar
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions