12-30-2012 10:55 AM
Hey I got an exceptionally long boolean array - 544 elements, none of the techniques work as per the attachment to convert it to a HEX string.
What is the solution?
See attached VI...
(these all produce wrong results)
12-30-2012 11:27 AM
If an indicator is showing a hex number like FF FF FF and you put the cursor in the indicator box, the cursor will move over each pair of FF's in one move because it is treated as a single number.
--- I don't know where this statement comes from, because it's just not the case.
"FF" is never considered to be "a single number" in hex, any more than "34" is a single number in decimal.
Hex notation is something that you impose on a number. It doesn't change the number, it changes the process of turning a numeric quantity into characters on the screen.
If my value is 255, then it is 255 whether you show it as decimal 255, as hex 0xFF, or as binary 11111111.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-30-2012 12:02 PM - edited 12-30-2012 12:03 PM
Hi kate,
quite cool to refresh a thread older than 11 years...
This might be a solution for your question:
It displays your bits as binary number in a string 😄
To give a hint:
LabVIEW support floats up to EXT precision, holding 80 bits of mantissa. So you have to use some simple math to calc a EXT number from your bits by summing up some powers of 2...
12-30-2012 01:37 PM - edited 12-30-2012 01:41 PM
@kate2012 wrote:
Hey I got an exceptionally long boolean array - 544 elements, none of the techniques work as per the attachment to convert it to a HEX string.
However, your attached example has only a boolean array with 8 elements. Can you make a more relasistic default value?
@kate2012 wrote:
(these all produce wrong results)
Then please tell us what the "right" result is. Since there is an infinite number of wrong results, but only one right result, we cannot conclude by elimination.
@kate2012 wrote:
... to convert it to a HEX string.
What is a HEX string? Do you want a binary string where each character corresponds to eight of the booleans or do you want a hex formatted string of that above result, exclusivley containing characters 0..F, or something else.
12-30-2012 02:05 PM - edited 12-30-2012 02:07 PM
OK, try something like this.... (LabVIEW 2012)
Even if it is not exactly what you want, it might give you some ideas. If one of the solutions is as desired, delete all the unecessary code. 🙂