-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
For specific images the calculated checksum produced only contains 2 or 3 characters, instead of the expected 4 character format.
The issue was identified to be a formatting problem in which a calculated checksum containing leading 0's had would have the leading 0's dropped before transmitting the checksum to the Cognex camera. This would result in a failure of the image to be transferred, and our written script to cease running.
To rectify this we made a small modification to the calculate_checksum function to format the return differently. This isn't necessarily the best solution but it did fix the formatting of the checksum in order to make the transmission of large quantities of images consistent and reliable.
old return: "hex(cword).upper()[2:]"
modified return: {:4x}".format(cword)