ergosophist
Member
Hello,
I'm running on an AB ControlLogix and need to generate a 16-bit CRC, to ensure data integrity when transferring to another system. I have an array of 150 DINTs that I would like to CRC (similar to calculating CRC for a file). My question: How can I implement the CRC calculation for a 600-byte array in ladder (or ST)? How can I program the table generator?
Specifically, how do you use the values from the lookup table to operate on the successive bytes in the array? And, how do you generate the lookup values for that algorithm (if it is even different then just doing CRC16 on a byte with 0xFFFF pre-pended and 0x0000 appended)?
After reading Ross Williams' guide on CRCs, the theory makes sense, but I'm struggling on the ladder implementation of a table-driven approach. Of course, I would need to write the table generation code as well (or import a table that I know will work, at the least). As for the polynomial, I would use the CCITT standard 0x1021.
RSLogix doesn't come with a true CRC instruction, and I haven't found any sample code. If anybody has sample code, references , or can provide an explanation of how to calculate the array CRC, that would be greatly appreciated!!
Thank you
I'm running on an AB ControlLogix and need to generate a 16-bit CRC, to ensure data integrity when transferring to another system. I have an array of 150 DINTs that I would like to CRC (similar to calculating CRC for a file). My question: How can I implement the CRC calculation for a 600-byte array in ladder (or ST)? How can I program the table generator?
Specifically, how do you use the values from the lookup table to operate on the successive bytes in the array? And, how do you generate the lookup values for that algorithm (if it is even different then just doing CRC16 on a byte with 0xFFFF pre-pended and 0x0000 appended)?
After reading Ross Williams' guide on CRCs, the theory makes sense, but I'm struggling on the ladder implementation of a table-driven approach. Of course, I would need to write the table generation code as well (or import a table that I know will work, at the least). As for the polynomial, I would use the CCITT standard 0x1021.
RSLogix doesn't come with a true CRC instruction, and I haven't found any sample code. If anybody has sample code, references , or can provide an explanation of how to calculate the array CRC, that would be greatly appreciated!!
Thank you