Thang Nguyen Posted April 27, 2010 Report Share Posted April 27, 2010 Hi, I am trying to detect the Header Start Byte in a string of data sent though TCP/IP by myself. The string of data is built by concatenate the string converted from array of byte data. When I receive it, I just do in the reverse order. And the match pattern function doesn't work. But if I convert the string to array of byte, I can search it. I post this becaue I want to understand what I did wrong. Thank you, Thang Nguyen I have my code here: TestScanString.vi Quote Link to comment
Grampa_of_Oliva_n_Eden Posted April 27, 2010 Report Share Posted April 27, 2010 Hi, I am trying to detect the Header Start Byte in a string of data sent though TCP/IP by myself. The string of data is built by concatenate the string converted from array of byte data. When I receive it, I just do in the reverse order. And the match pattern function doesn't work. But if I convert the string to array of byte, I can search it. I post this becaue I want to understand what I did wrong. Thank you, Thang Nguyen I have my code here: Hex 24 = $ which is special character for the match pattern. Check the help on Match pattern and look at "special characters" Ben Quote Link to comment
jcarmody Posted April 29, 2010 Report Share Posted April 29, 2010 Hex 24 = $ which is special character for the match pattern. Check the help on Match pattern and look at "special characters" Ben I used a Format Into String to escape the special character and it works correctly (you need to escape the escape character in the format string in order to get the escape character into the Match Pattern, hence the two "\"s). The "offset past match" will be one more than the "index of element" from your Search 1D Array. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.