11-14-2013 09:03 AM
Hi
I want seperate data from string.
1.First I have to seperate data with 07326203x
2 and then from 8 byte data (from each line) i just want to read 6 byte position from each line.
BR
kalu
11-14-2013 09:11 AM
Easy enough. What's your question?
11-14-2013 09:50 AM
hi here I have attach my vi
11-14-2013 09:52 AM
No attachment.
11-14-2013 09:59 AM
hi
Sorry I couldnot able to attach vi
so i make screenshot.,
my data look like
7.6562 4 07328203x RX d 8 , CA 00 10 00 00 0A 00 47 tid=00
7.6562 4 07326203x RX d 8 , 01 00 01 00 00 00 00 04 tid=00
7.8750 4 07315F03x TX d 8 , 3F 00 00 00 00 00 00 00 tid=00
8.2969 4 07326203x RX d 8 , 00 00 00 00 00 00 00 04 tid=00
8.9219 4 07328203x RX d 8 , CA 00 10 00 00 0A 00 47 tid=00
8.9375 4 07326203x RX d 8 , 00 00 00 00 00 00 00 04 tid=00
9.5625 4 07326203x RX d 8 , 00 00 02 00 00 00 00 04 tid=00
10.2031 4 07328203x RX d 8 , CA 00 10 00 00 0A 00 47 tid=00
10.2031 4 07326203x RX d 8 , 02 00 02 00 00 00 00 04 tid=00
10.8437 4 07326203x RX d 8 , 02 00 02 00 00 00 00 04 tid=00
11.4844 4 07328203x RX d 8 , CA 00 10 00 00 0A 00 47 tid=00
11.4844 4 07326203x RX d 8 , 02 00 02 00 00 00 00 04 tid=00
12.1250 4 07326203x RX d 8 , 02 00 02 00 00 00 00 04 tid=00
11-14-2013 10:01 AM
11-14-2013 11:12 AM
I've attached a LAbVIEW 2013 example that does what you want. This example will not work if you don't have the OpenG tools installed as it uses the Multi-line String to Array function from them. To install the OpenG toolkit you need to use VIPM, which comes with LabVIEW 2013 or can be downloaded and installed free from JKI.com.
Here's a snippet of the code.
What I'm doing is converting the data to an array. Each line is an element. I then look search each element for your search string. When I find the string I split get everything in the element after the comma, delete the white space from the front and back of the string, get the to characters at position 15 (assuming you want the 6th byte [1-8] not byte 6 [7-0]), and save that character to an array. Youi end up with an array 6th bytes from every line that contained the search string.
11-18-2013 04:06 AM
Hi need i more help:)
I have a time stamp in string array and i need to evaluate time difference between new message with previous one. Problem is I convert String array to number and I got fixed number without decimal.
11-18-2013 04:54 AM - edited 11-18-2013 04:55 AM
Hi kalu,
your problem is your regional setting! You use the comma as decimal separator whereas the string contains numbers using the point.
Please read the help for ScanFromString (or your string function), then read the linked help for "format codes". The use the correct format code "%.;%f"!