LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help searching hexidecimal string.

Hi all. Having some trouble searching a hexidecimal string. (labview 8.0).  Im currently using the search and replace string function with the search string in hex display which has worked for me in the past.  (ie search for "0A0A BCD2" and i get a match. )  However, now i would like to be able to use wild card characters, so maybe search for something like "0A0A **D2", but i have not had any success in finding an easy way to do this.  Any suggestions? Thanks in advance for any help. 
0 Kudos
Message 1 of 14
(3,858 Views)

Hi dirtyb15,

i´m not sure if there is a ready function to use, but you can split your string into peaces. Search first for the string before your wild card characters, if you find a match you can jump over the next number of available wild card characters and check if the string after this matches your input. If not start with this process from the beginning with offset of the last match.

 

Hope it helps.

Mike 

Message 2 of 14
(3,857 Views)

I thought about doing something like that, just was hoping there was an already built function :).

Thanks for the suggestion, guess thats the route i will take.

 

0 Kudos
Message 3 of 14
(3,854 Views)

I don't know at which LV version this was introduced, but you can right-click the replace function and check "regular expression". In regular expressions a period "." matches any character. In hex representation a period is 2E. So you can edit the search string to "0A0A 2ED2".

 

Hope this helps,

Daniel

 

Message Edited by dan_u on 08-26-2008 04:03 PM
Message 4 of 14
(3,847 Views)

Make sure the Search and Replace String function is in regular expression
mode (right click it).

To mach any character, use a point (.). A * will match any number of
characters (0-n), a ? will match 0-1 characters, a + will match 1-n
characters. You can combine it with [], e.g. [A-F]? will match one A, B,
C... F character. See the help.

Regards,

Wiebe.


0 Kudos
Message 5 of 14
(3,842 Views)
Danu, i saw that function, and i also tried to use 2E as the wildcard, but for some reason im not getting that to work. (no matches.) ill keep playing with it and see if i can figure that out.
0 Kudos
Message 6 of 14
(3,839 Views)

Did you configure the "Search and Replace String" function to "Regular Expression"?

I attached a small sample VI (LV 8.5) that works for me.

 

 

Message 7 of 14
(3,836 Views)

yes, i made sure to select regular expression.  Whats odd is i can use a search string with no wild cards (2E), and it will work with out regular expression enabled, but if i enable it, then it wont work. 

Could you maybe revert save that back to 8.0 for me?

thanks!

I have something working using the search and split ect., but if i can get this function to work it would be much cleaner anyways.

Thanks everyone for the quick replies, much appreciated.

 

Well just tried the same vi i made with labview 8.6 and it worked so maybe something is not right with the function and labview 8.  Unfortunately i dont have the application builder for 8.6 so guess ill have to use the long way. Thanks for the help guys.

Message Edited by dirtyb15 on 08-26-2008 10:00 AM
0 Kudos
Message 8 of 14
(3,819 Views)

Here's the VI in LV8.0.

 

0 Kudos
Message 9 of 14
(3,815 Views)
Hi dirtyb15, Posting what you have tried will give a clear idea of what you actually want.
0 Kudos
Message 10 of 14
(3,807 Views)