LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Match pattern not working

I am trying to break down the following string using "match pattern"
 
1       2008-03-19 09:35:25     0
2       2008-03-19 09:35:25     -26.534
3       2008-03-19 09:35:25     0
 
First the data goes thru Basic serial  write and read.vi then the read string is wired to the string of Match Pattern.  When I set the regular expression to hex 3120
no data leave the match pattern.  however if I seach for 3230 3038 2D30 33 it works.  Unfortunately I need the 3120, 3220, and 3320 to differentiate the lines.  I have tried it in both normal and hex
 
Any help is appreciated
 
 
 
NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 1 of 5
(3,031 Views)
Works fine for me:

My guess is that you don't have the string set to "Hex Display" mode when entering the values in Hex, although why one would enter the values in Hex in this case is beyond me. Smiley Surprised

You may want to consider using the Spreadsheet String to Array function instead. You would need to just replace the column separators from spaces to a single tab first, though.
0 Kudos
Message 2 of 5
(3,023 Views)
as per the hex, I tried it normally first and it didn't work and I was told that LV can have issues with spaces if using ASCII.  So I tried hex but that didn't work either.  Thanks for trying to solve this, I thought it should be a very straight forward string interpretation when I started this morning
NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 3 of 5
(3,016 Views)
Who told you that LabVIEW can have problems with spaces? I too have no problem using the match pattern with the data you've specified. Are you sure the there is a space in the original string? Have you looked at the input string with hex display or '\' Codes Display on? If your code does not work, why don't you attach the VI? Be sure to have data inay any string controls and do a "Make Current Values Default' and save the VI before you post it.
0 Kudos
Message 4 of 5
(3,009 Views)

Why not just use "scan from string" to convert it to a number? While you're at it you could convert all the values (including the date/time) in one scan from string like this.....

(Your input is in "string")

 

Rod.



Message Edited by Rod on 03-19-2008 06:36 PM
Message 5 of 5
(3,001 Views)