ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using hex values as case statement selector

I'm trying to writie a little conversion routine that accepts a hex value (read from a TTL device) and converts that to an enum.  The hex values returned aren't sequential (i.e 0x00, 0x7E, 0xF5, 0xF0, etc).
 
I would like to run these values into a case statement and return the appropriate enum,  I can't seem to get the syntax right for the case selector.  Can I represent the number in hex (in the case selector), or do I have to do the conversion to base 10?  If it's possible, what is the proper syntax?
0 Kudos
Message 1 of 6
(3,841 Views)
In LV 8.20 the radix of the selector is available as a popup. Internally the representation of the number makes no difference. The representation only becomes a factor when displayed.

Lynn
Message 2 of 6
(3,837 Views)


@johnsold wrote:
In LV 8.20 the radix of the selector is available as a popup.

Lynn, this has been around for quite a few versions before 8.2. Very useful! 🙂

Message Edited by altenbach on 02-08-2007 09:48 AM

Message 3 of 6
(3,830 Views)
Thanks, Christian. I did not recall how far back it went and did not take the time to check it.

Lynn
0 Kudos
Message 4 of 6
(3,822 Views)

Hi altenbach

 

I am using Labview 9.0

 

Has this option to select the radix gone?

 

radix selection.png

 

I am struggling to use any of the potential solutions to this problem. If I try the putting it in as code displays the \00\A0 the \A0 does not appear in the case structure (its a blank for new line or w/e) which means the comparison fails.

 

Where probe 9 is in the picture is where my hex is being passed in to the substring node

 

 

Any help would be much appreciated on this

 

Thanks

 

0 Kudos
Message 5 of 6
(3,309 Views)

If you were to look at the image, you would see a numeric wired up and that still has the option for hex display. A string does not.

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