03-21-2022 10:52 AM
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.
Solved! Go to Solution.
03-21-2022 11:01 AM - edited 03-21-2022 11:11 AM
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.
03-21-2022 11:43 AM
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.