Changes between Version 6 and Version 7 of S6350serialcom


Ignore:
Timestamp:
10/27/08 11:40:33 (16 years ago)
Author:
pinwc4
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S6350serialcom

    v6 v7  
    5353 
    5454 
     55 
    5556= Silence Tag = 
    5657 
     
    8182 
    8283Here is an example of the code to do this: 
    83    
    8484  dim checksum as string 
    85  
    8685  dim xornumber1 as integer 
    87  
    8886  dim xornumber2 as integer 
    89    
    9087  'Do a XOR of all the bytes of the string for byte 1 of the checksum 
    91  
    9288  'Do not worry about xornumber having a zero initially, this does not impact the XOR operation 
    93  
    9489  for i as Integer=1 to len(data) 
    9590    xornumber1 = xornumber1 xor ascB(mid(data,i,1)) 
     
    9893  'calculates byte 2 of the checksum 
    9994  xornumber2 = &hFF xor xornumber1 
    100    
    10195  'put the two together for the complete checksum 
    10296  checksum = chrB(xornumber1) + chrB(xornumber2)