Changes between Version 6 and Version 7 of S6350serialcom
- Timestamp:
- 10/27/08 11:40:33 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S6350serialcom
v6 v7 53 53 54 54 55 55 56 = Silence Tag = 56 57 … … 81 82 82 83 Here is an example of the code to do this: 83 84 84 dim checksum as string 85 86 85 dim xornumber1 as integer 87 88 86 dim xornumber2 as integer 89 90 87 'Do a XOR of all the bytes of the string for byte 1 of the checksum 91 92 88 'Do not worry about xornumber having a zero initially, this does not impact the XOR operation 93 94 89 for i as Integer=1 to len(data) 95 90 xornumber1 = xornumber1 xor ascB(mid(data,i,1)) … … 98 93 'calculates byte 2 of the checksum 99 94 xornumber2 = &hFF xor xornumber1 100 101 95 'put the two together for the complete checksum 102 96 checksum = chrB(xornumber1) + chrB(xornumber2)