LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure

Hello everyone,

I'm wondering if it's possible to display an HEX number in the case selector.
I've wired an HEX number to it but I got to put the number in decimal in
the selector. Kinda of not what I want to do but of coursse it still works.
I want it to display the number in HEX.

Thx!


Eric Paulin
0 Kudos
Message 1 of 5
(2,794 Views)
Humm this one is interesting. Yes i know there are work arounds but the case struct doesn't directly let you type in the HEX # in it.
Good suggestion, can be forwarded.

Abdullah
0 Kudos
Message 2 of 5
(2,794 Views)
You can format the number in an hexadecimal string (for example %02x) and
input this string to the case selector. Change the cases to "00", "01", etc.

Jean-Pierre Drolet


"Eric Paulin" a écrit dans le message news:
3a8d810f@newsgroups.ni.com...
>
> Hello everyone,
>
> I'm wondering if it's possible to display an HEX number in the case
selector.
> I've wired an HEX number to it but I got to put the number in decimal in
> the selector. Kinda of not what I want to do but of coursse it still
works.
> I want it to display the number in HEX.
>
> Thx!
>
>
> Eric Paulin
0 Kudos
Message 3 of 5
(2,794 Views)
This won't let you do things like "00-09" "0A-0D" "0E..." though, since the
numerical "meaning" is lost.

Jean-Pierre Drolet wrote in message
news:3a8dc3b0@newsgroups.ni.com...
> You can format the number in an hexadecimal string (for example %02x) and
> input this string to the case selector. Change the cases to "00", "01",
etc.
>
> Jean-Pierre Drolet
0 Kudos
Message 4 of 5
(2,794 Views)
Hmm,
that one not so simple for ranges...

The correct syntax for string ranges is "00".."09" but remember that the
range spec is upper bound EXCLUSIVE for strings. The range "00".."0F" thus
corresponds to an integer range of 0..14 beacuse "0F" is not part of the
string range. You enter an inclusive range 15 putting the upper bound
explicitely "00".."0F","0F". Otherwise, since "A" is lexically greater than
"9", there is no problem.

Since string selectors support \ codes, another way is to flatten you number
to string and type in your cases as "\00".."\FF" for U8 numbers,
"\00\00".."\FF\FF" for U16 and "\00\00\00\00".."\FF\FF\FF\FF" for U32. The
upper exclusive rules for strings still applies.

Jean-Pierre Drolet


"Craig Graham"
@lancaster.ac.uk> a écrit dans le message news:
3a90f484@newsgroups.ni.com...
> This won't let you do things like "00-09" "0A-0D" "0E..." though, since
the
> numerical "meaning" is lost.
>
> Jean-Pierre Drolet wrote in message
> news:3a8dc3b0@newsgroups.ni.com...
> > You can format the number in an hexadecimal string (for example %02x)
and
> > input this string to the case selector. Change the cases to "00", "01",
> etc.
> >
> > Jean-Pierre Drolet
>
>
>
0 Kudos
Message 5 of 5
(2,794 Views)