Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

checksum for ComPort

For general discussion related FlowStone

checksum for ComPort

Postby clamprod » 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!
clamprod
 
Posts: 7
Joined: Mon Aug 02, 2010 3:33 pm

Re: checksum for ComPort

Postby Tronic » Tue Jul 23, 2013 7:13 pm

this is an example in ruby

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
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: checksum for ComPort

Postby clamprod » Sun Jul 28, 2013 3:50 am

Ah, awesome, Tronic!
Thank you!

clammy
clamprod
 
Posts: 7
Joined: Mon Aug 02, 2010 3:33 pm


Return to General

Who is online

Users browsing this forum: No registered users and 60 guests