LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data in multiple case statements

Solved!
Go to solution

I have tried this code but still have the case that the input to the case statement looking for 0x6100 is always zero.  Does it need some conversion required?

 

Thanks

0 Kudos
Message 11 of 16
(589 Views)

@lafox24 wrote:

I have tried this code but still have the case that the input to the case statement looking for 0x6100 is always zero.


I suspect the constant you used for the Type Cast or Unflatten From String is an I32 (the default representation for a numeric) when it should be an U16.  If you upload your VI, we can check that and other things that are easy to miss.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 16
(577 Views)

You can use \-codes in the case selector:

 

backcodes.png

Message 13 of 16
(554 Views)

@altenbach wrote:

You can use \-codes in the case selector


Assuming we know it is a U16, it is better here to cast the string value to a number and then right-click on the case structure and choose Radix->Hex.  At least it makes it a lot easier to read.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 16
(530 Views)

Oh yes. My post wasn't a recommendation, just a bit of trivia. 🙂

0 Kudos
Message 15 of 16
(515 Views)

@altenbach wrote:

 just a bit of trivia.


That is interesting. I never knew that.

Thanks for the tip 🙂

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 16 of 16
(502 Views)