07-27-2012 02:18 PM
This is really only for looks, but I was wondering if there was a way to collect data and convert into two different types instantly on the front panel. Let's use binary and hexadecimal because that's what I am collecting. I have a huge array of numbers that gets converted into a huge array of binary or hexadecimal, depending on what the user chooses from the front panel. If that person chose binary, but then wants to look at it in hex, could this be done without re-running the VI?
Thanks
Solved! Go to Solution.
07-27-2012 02:23 PM - edited 07-27-2012 02:25 PM
Just right-click the indicator Visable Items>> Check Radix
The operator can select Decimal, Octal, Hexadecimal or Binary
07-27-2012 02:28 PM
Jeff's solution is really simple and you should be showing the Radix anyways for clearity if you are showing a numeric in anything but decimal. Nothing like thinking you have a bug when you really don't because you thought you read decimal and it was really hex.
The other option I've seen is to have a control to allow the user to choose the radix for all of the controls and you can then set the display using property nodes.
07-27-2012 02:33 PM
I am only able to choose decimal or SI notation
07-27-2012 02:38 PM - edited 07-27-2012 02:38 PM
That's because your data type is a floating point. You have to have an integer type (U8, I8, U16, etc.) to be able to display hex, binary, or octal (who the heck uses octal anymore?).
07-27-2012 02:42 PM
Ohhhh okay that makes sense. I also found out that since I have a case statement with my array that way the user could choose binary or hex, my default is binary and when I right click on that array's properties, the display style has normal, \code, password, and hex, so this will work for me since I can just use normal or hex. Thank you very much for the help. I appreciate it.
07-27-2012 02:48 PM
@Szklanam wrote:
...when I right click on that array's properties, the display style has normal, \code, password, and hex, so this will work for me since I can just use normal or hex.
Ah, so you are using a string. You can still use the same trick for those now.
07-27-2012 02:50 PM
I fooled around a little bit and it was much cleaner using an integer and applying radix to the indicator instead of the "Number to Hex" and the "Format Value" for the hex and binary conversions respectively
07-27-2012 03:27 PM
@crossrulz wrote:
That's because your data type is a floating point. You have to have an integer type (U8, I8, U16, etc.) to be able to display hex, binary, or octal (who the heck uses octal anymore?).
I'm curious. When was octal ever really used? Were there particular situations where it made sense to use it?
07-27-2012 04:44 PM