LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Output

Hi,

  I am struggling on data acquistion from a bench scale automated reactor. It gives digital output and data acquistion is made via serial port.  The data output is a buffer of strings and I need to seperate the required data string out of buffer. I have tried different VI's for e.g., scan string, match expression, string subset etc., but could not able to extract the required string.  I attached a single set of string output ialong with this message and highlighted the required data string in red color.  Each data out contains similiar kind of buffer of strings. How can I able to index this buffer of strings to extract the required data string? could anyone help me in resolving this problem?

 

Thanks

 

Regards,
Senthil

0 Kudos
Message 1 of 59
(8,137 Views)

I don't understand your problem? Correct me if I'm wrong. You have a string and you need to convert it to some other form. I opened the attached document, but I didn't understand what you need to convert to what.

 

Could you give an example of what is the input string, and what you'd like the output to be?

0 Kudos
Message 2 of 59
(8,118 Views)

I think he wants to extraxt the red potion of his text

 

but I do not know if it is a string or dbl or what have you...

Message Edited by Harold Timmis on 09-04-2009 10:03 AM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 3 of 59
(8,116 Views)

If the string is always going to be the same length, you could continually search for { and when you find an appropriate gap between { indices, pull the appropriate string out.  So for instance if you have
{A

{A

{A

{A908ASD75HA0897TFA-E89ASFUHA0D89AF7

{A

 

Then the searches would return 0, 3, 6, 9, 37

And since 37 - 9 = 26 (or whatever the right number is), you take characters 10-35 (or i+1 to i+24 or whatever)

0 Kudos
Message 4 of 59
(8,109 Views)

Hi,

  Sorry for the confusion on understanding my post. This is a data output (in string form) read thru serial port read.vi from a automated lab reactor.   I need to extract the required string (consisting information about values of diff. operating variables) from the data string set.  The problem is a single set of data out contains also empty strings with return carriages along with the orignal data (shown below)

 

Single Data string set:

 

 

{ A0000000000000000<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{ A<

{!A=

{ A5294584442951404475000045422609D100000000990000442250004530000044100000436

{ A581201045530000C42330004300000000200510453180004412880045317000442000004560000045"

{ A0000000000000000<

 

 I wish to extarct the red highlighted string out of the data. Which VI could I use to extract this string?  I tried scan string.vi, string subset.vi and match expression.vi, but could not resolve it?

 

Appreciating anyone's suggestion to solve this.

 

Thanks and Regards,
Senthil

0 Kudos
Message 5 of 59
(8,087 Views)

Is the '{!A=' always before the part you want.  You could do something like this:

 

Get string.png

Message 6 of 59
(8,068 Views)

Since each line starts with a '{' you can convert the string into an array and index the array for the required string.

 

Message Edited by VADave on 09-04-2009 11:36 AM
Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 7 of 59
(8,066 Views)

Assuming you want the line that looks like "{AnumberDnumber" you can simply use Match Pattern on the whole string with the following regular expression

 

A[0-9]+D[0-9]+

 

Result should be in match string.  

0 Kudos
Message 8 of 59
(8,039 Views)

Hi VaDave,

   Thnaks for your response. I tried with string to array.vi as per you mentioned. But it converts all data string in numerical format. Say, my required string (length of 77) has been converted as 4.3000...  I even specified the format as %s in the VI.  It would be helpful if I get an array with each index having each line of data out string as it is in original format as shown below.

 

Array Index'o' : { A0000000000000000<

 

Array Index'1' :  { A<

-

-

-

-

-

Array Index'n': { A5294584442951404475000045422609D100000000990000442250004530000044100000436 (my required string).

 

Later I can use index array to seperate my string. I need the string with same format and length of 77 (shown above in red color) to enable it processesed by VI, which is developed already.

 

Hope I am not confusing.

 

Thanks

 

Regards,

Senthil

 

 

 

0 Kudos
Message 9 of 59
(8,030 Views)

851624047 wrote:

Hi VaDave,

   Thnaks for your response. I tried with string to array.vi as per you mentioned. But it converts all data string in numerical format. Say, my required string (length of 77) has been converted as 4.3000...  I even specified the format as %s in the VI. 


You did not properly wire up VaDave's example. You probably connected an array of numbers (thick orange or blue wire) to the bottom left array type input. If you note in the example, that's an array of strings (thick purple wire)

0 Kudos
Message 10 of 59
(8,021 Views)