LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPS emulation

Have a Thales Navigation ADU5 GPS-based three-dimensional position and attitude determination system.
 
There are many messages delivered by the box with each containing a checksum at the end.
 
The manufacturer's operation manual states the "Hexadicimal checksum is computed by exclusive ORing all bytes between
but not including $ and * "
 
An example response string is:
 
 
$PASHR,ROP,0.2690,A*6B
 
I cannot seem to calculate a checksum of 6B.
 
I'm using an autoindexing string array of 15 elements; one for each character.
This is fed into a For loop with shift registers and the XOR takes place within.
 
Any words of wisdom?
 
 
 

 

 

 

 

 
 
 
0 Kudos
Message 1 of 6
(3,092 Views)
Hi - refer to the attached vi example - exclusive or'ing the byte values of the string does result in a result with hex value 6B...
0 Kudos
Message 2 of 6
(3,063 Views)

Thanks,

I was just XORing the individual items not the commas.

Makes a difference.

Also, taking the string apart into 15 individual items is not the ticket.

Here's a VI with the four possibilities.

Only one calculation gives the expected result.

 

 

 

 

 

0 Kudos
Message 3 of 6
(3,053 Views)
Now that we have the checksum, I need to append that to the original string as follows:
 
$PASHR,ROP,0.2690,A*6B
 
The problem I run into is that now matter how I approach this, I end up with $PASHR,ROP,0.2690,A*k
I need the 6B representation.
 
I'm simulating responses.
 
The computer program, someone else's not modifiable, is expecting the string in the format as shown with the HEX number on the end.
I'm not sure if it will accept the string with the ASCII character representation of 6B.
 
 
 
 
0 Kudos
Message 4 of 6
(3,028 Views)
When you add the byte with a numerical value of 6B (hexadecimal) to a string, that shows up as the lower-case letter k in your string, because the ASCII value of k is is 107 (decimal) which equals 6B (hexadecimal).
 
You need to add some code to your vi that converts a byte's numerical value to a string of characters representing the numerical character.
 
I have added one such method to the example vi I posted before. When you run it, you'll see the checksum calcuates to the numerical value 6B as before, but now the "resulting string" also displays 6B, in string format - this is what you would want to use in your string where you now have the letter k.
0 Kudos
Message 5 of 6
(3,022 Views)

Perfect.

Thank you.

Implemented and works as needed in my code.

 

0 Kudos
Message 6 of 6
(3,018 Views)