12-12-2008 05:51 PM
I'm trying to do a VI to get Checksum of next Hex strings:
1557 0000 0000 18F0 9FE5 18F0 9FE5 18F0 9FE5 18F0 9FE5 =======>-100 (or 100)
1557 0000 0000 18F0 9FE5 18F0 9FE5 18F0 9FE5 18F0 9FE5 =====> -4 (or 4)
1557 0000 0018 14F0 9FE5 14F0 9FE5 4000 0800 3401 0800 ======> 30
I allready tried many vi from the forum
thanks
12-12-2008 06:30 PM
It would help if you could attach a small sample VI that contains your three strings and the desired results as diagram constants.
12-12-2008 06:36 PM
there is hex numbers and no space I just copy the text from string in Hex view
it's just different data for that reason the final checksum it's diferent
12-12-2008 06:37 PM
12-12-2008 06:50 PM
Sorry, my mistake
1557 0000 0000 18F0 9FE5 18F0 9FE5 18F0 9FE5 18F0 9FE5 checksum = 100 decimal
1557 0000 0018 14F0 9FE5 14F0 9FE5 4000 0800 3401 0800 checksum = 25 decimal
1557 0000 0028 3801 0800 3C01 0800 4001 0800 B003 0800 checksum = 30 decimal
12-13-2008 04:01 AM - edited 12-13-2008 04:02 AM
Hi Imontoya,
have you followed the link given by Altenbach?
You have to know what kind of checksum you want to program! Where the checksum will be written to is totally irrelevant, especially when the data sink is a processor capable of running it's own algorithms...
We may be able to provide an algorithm which yields the correct results for those 3 given strings but may fail on all other inputs
12-15-2008 11:58 AM
Here is the protocol in pdf and a sample hex file.
I'm trying to do all complete flash but my labview experience is to poor and i have more than a week trying.
Thankyou for your help
PD (the hardware i done)
12-15-2008 12:30 PM - edited 12-15-2008 12:37 PM
Are you sure your examples are correct. The attached VI seems to do what the datasheet says, and matches for your first example, but not for the last two. It does handle the sample hex strings in your other document.
Your checksum takes the number of data bytes, adds them to the sum of all those data bytes (keeping the result as a U8, so you will most likely rollover to 0 several times during the addition). You take that value and subtract it from 0, getting 2's complement.
Since your strings have the total number of bytes as the 1st character, the VI, just adds the bytes up and subtracts them from 0.
12-15-2008 01:16 PM
I did this and is working
thank you all