10-10-2006 05:46 AM
10-10-2006 06:43 AM
10-10-2006 07:49 AM
Without having a bit more detail of the protocol and the data type of your inputs I put this together that might be helpfull. What I did here was to convert the input strings to arrays of bytes. Then I could use the sum array function. I converted the bytes to U32 data first. The sum array will then produce a U32 (4 byte integer) that I invert (for "invert of byte sum") and that result and cast it back to a string. Then I combinded the whole thing with the string concatenate.
In your message you mentioned that there are 12 bytes in the tail and only list the function of 8 of those bytes. Do you know what the other 4 are? Also you might need to check the endian of the inverted sum to make sure it matches what you protocol needs.
Hope this helps some,
paul
10-10-2006 08:33 AM
Thanks, this worked very well - problem solved!
A few quick points: the remaining 4 bytes in the tail are labelled as 'reserved' in the instrument command, and return an error code for the instrument message (which has the same structure). Also, the 'Invert sum of command' seems to include everything in the header, body, and tail up to the final 4 bytes.
I spent a week on this, so I am grateful for your input :).
Mark