LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan/search hex string with wild card

Solved!
Go to solution

Is there a better way to do this? I need to search incoming hex from rs485 for this pattern FFEx. This is a hex string, not normal, so I couldn't find a way to use a wildcard to search the string. Attached is what I came up with, but it seems excessive. 

0 Kudos
Message 1 of 3
(1,293 Views)
Solution
Accepted by topic author TheWolfmansBrother

We probably need a more specific example. I would assume that a typical input string is longer than 2 bytes, else you could just use "search array" here.

 

If it is exactly 4 bytes, casting to U16 and doing a masking/comparing would work.

 

altenbach_0-1647879082183.png

 

Message 2 of 3
(1,284 Views)

It's only the four bytes. Your solution works perfectly, a lot less cumbersome. thank you. I tried the type cast, earlier, just wasn't quite getting it correct. 

0 Kudos
Message 3 of 3
(1,256 Views)