03-21-2020 05:59 AM
Hi
Does anyone know how to covert the arrays
16 00010110
80 to 10000000
0B 00001011
30 00110000
Regards
Patrick
Solved! Go to Solution.
03-21-2020 09:31 AM
Yes, I (and many other readers of this Forum) do.
Why don't you try to figure it out for yourself? There are Tutorials mentioned on the first page of this Forum. Since you are dealing with Strings, examine the functions on the Strings Palette.
Bob Schor
03-21-2020 11:38 AM
If your input string array is on hex display and one byte per element, you can try to do something like this (for each element):
If input array is on normal display you have to replace the Unflatten From String function with Hexadecimal String To Number
03-21-2020 12:34 PM - edited 03-21-2020 12:35 PM
@Patrick0830 wrote:
Hi
Does anyone know how to covert the arrays
16 00010110
80 to 10000000
0B 00001011
30 00110000
First of all, the left side is NOT a "decimal" string (characters 0..9), but a hexadecimal string (characters 0..F). Big difference! You have two nibbles, so you are dealing with a single byte, which can be represented as 8 binary characters (0..1). Is it never more that two hex characters on the left? Does the left side start out as a string array or is it derived from a U8 numeric array?
Is this a programming exercise or a process that occurs often and should be as fast as possible?
What have you tried? Once you have code for all 256 possible combinations, you could create a lookup table, right?
You could even just leave it as a U8 array and just change the display format, right?
03-21-2020 12:41 PM
03-21-2020 12:52 PM
03-22-2020 07:10 AM
It works well, thanks.
03-22-2020 07:15 AM
Thanks for your suggestion, I am a beginner and have spent over 2 days to figure out how to do it, so I posted here for help.
Regards
Patrick
03-22-2020 07:17 AM
Thanks, let me have a try.
Regards
Patrick