checksum for ComPort
Posted: Tue Jul 23, 2013 6:52 pm
I need to include a Checksum byte in my command line to the ComPort. Any direction in generating the packet checksum would be appreciated.
Thanks, folks!
Thanks, folks!
DSP Robotics and FlowStone Graphical Programming Software Support and Forums
https://172.235.132.105/support/
Code: Select all
string_data = @ins[0]
# this is line for test only, comment this to use input
string_data = "this is the data string"
####
checksum = 0
string_data.each_byte {|x| checksum ^= x }
output 0, checksum # with test line active this output have, checksum => 96