03-18-2010 02:33 PM
Is there a way to convert a string of the following format:
1400010107070D0305006A01 ........ ("Normal display" string)
programatically to:
1400 0101 0707 0D03 05006A01 .......... ("Hex display" striing)
I need to do this in order to calculate a CRC16 value.
See attached VIs
Thank you.
Solved! Go to Solution.
03-18-2010 02:51 PM
Hi chuck,
1) search the forum, this has been asked a lot of times before
or
2) make a loop, get 2 chars from the string, convert to U8 number (by hex string to number), convert the resulting U8 array to string (by U8 array to string function)
03-18-2010 02:54 PM - edited 03-18-2010 02:55 PM
You can iterate over the string and use the String to Hex VI. If you work with two bytes of the string at a time you can get a U8 array of the desired binary values. Then when you are complete you can either work with the byte array of convert it back to a string using Byte Array to String.
EDIT: GerdW typed faster than I did.
03-18-2010 02:57 PM
My problem is that the orignal string is in hex, but not hex format.
03-18-2010 03:04 PM
03-18-2010 03:07 PM - edited 03-18-2010 03:09 PM
Here is exactly what we suggested.
03-18-2010 03:08 PM
03-18-2010 03:14 PM
03-18-2010 03:39 PM
Thank you, very impressive!
03-18-2010 03:45 PM