def setChecksum(command):
 if (len(command) < 8):
  raise LabJackException('Command does not contain enough bytes.')
 try:
  a = command[1]
  a = ((a & 120) >> 3)
  if (a == 15):
   command = setChecksum16(command)
   command = setChecksum8(command, 6)
   return command
  else:
   command = setChecksum8(command, len(command))
   return command
 except LabJackException as e:
  raise e
 except Exception as e:
  raise LabJackException(('SetChecksum Exception:' + str(e)))

def setChecksum ( command ) : if ( len ( command ) < 8 ) : raise LabJackException ( 'Command does not contain enough bytes.' ) try : a = command [ 1 ] a = ( ( a & 120 ) >> 3 ) if ( a == 15 ) : command = setChecksum16 ( command ) command = setChecksum8 ( command , 6 ) return command else : command = setChecksum8 ( command , len ( command ) ) return command except LabJackException as e : raise e except Exception as e : raise LabJackException ( ( 'SetChecksum Exception:' + str ( e ) ) )
returns a command with checksums places in the proper locations for windows .