LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

checksum

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

 

0 Kudos
Message 1 of 9
(4,044 Views)
  • Are these hex formatted strings consisting of the characters 0..F (and space) or binary strings set to hex display?
  • What is the difference between the first two strings?
  • What kind of checksum do you want? 
  • What is the format of the output you show (is it decimal?)

 

It would help if you could attach a small sample VI that contains your three strings and the desired results as diagram constants.

0 Kudos
Message 2 of 9
(4,029 Views)

 

  • Are these hex formatted strings consisting of the characters 0..F (and space) or binary strings set to hex display?
                                  there is hex numbers and no space I just copy the text from string in Hex view
  • What is the difference between the first two strings?
                                   it's just different data for that reason the final checksum it's diferent
  • What kind of checksum do you want? this is data to be send to a ADUC7021 microprocesor
  • What is the format of the output you show (is it decimal?) decimal

0 Kudos
Message 3 of 9
(4,024 Views)
The data in the first and second strings you posted is identical.
0 Kudos
Message 4 of 9
(4,021 Views)

 

 

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

 

0 Kudos
Message 5 of 9
(4,017 Views)

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 Smiley Wink

Message Edited by GerdW on 12-13-2008 11:02 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(3,993 Views)

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)

Download All
0 Kudos
Message 7 of 9
(3,951 Views)

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.

 

 

Message Edited by Matthew Kelton on 12-15-2008 01:37 PM
Download All
0 Kudos
Message 8 of 9
(3,929 Views)

I did this and is working

thank you all

0 Kudos
Message 9 of 9
(3,915 Views)