LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search split string

I am trying to use the search/split string function with some code and it does nt seem to be working, I keep getting the "no match found response" (return count of -1).
 
Andrew
0 Kudos
Message 1 of 6
(3,470 Views)
Hi Andrew,
I can't open your VI because I only have LV8.0, but a frequent cause of that is unseen whitespace.  Try to trim your text of whitespace.
Jim

LV 2020
Message 2 of 6
(3,465 Views)
Andrew,

the string you are searching for does not exist in your input. You are looking for 0x3641 3644, not 0x6A6D....

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 6
(3,464 Views)
Hi labstew,
change the View of your string constant to "normal" so you will see, what you can search for. Smiley Happy
See the attached picture. Hope it helps.
 
 
Mike


Message Edited by MikeS81 on 04-30-2008 05:16 PM
Message 4 of 6
(3,456 Views)
Andrew,

You are trying to search a binary string with an ASCII string representing the binary data.  As was pointed out, you are not searching for binary 6A6D but literal string "6A6D".

Instead of using the number to hex string, use a typecast, which will convert the number to the decimal string.



You are also making things more complicated than they need to be for getting the 16-but numbers.  Instead of converting the array to a U8 array then building a U16, just typecast the string to an array of U16's to begin with.



Also, if this was not example code and was in fact code to be put into a program, the result for offset match will always be 2 x index (assuming index is in range).


Message Edited by Matthew Kelton on 04-30-2008 10:17 AM

Message Edited by Matthew Kelton on 04-30-2008 10:21 AM
Download All
Message 5 of 6
(3,454 Views)

Thanks for all the responses, I assumed since I had the didsplay of the original sting set to Hex that would work.  The code works fine with these adjustments. 

 

 

Andrew

0 Kudos
Message 6 of 6
(3,434 Views)