LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read a data selecting from sets of string.

Solved!
Go to solution

hi

 how can i read a data from string.my output string looks like.:

for example

{<V01/DST62/SRC01/PT08/DT01><C04/R01/A00><P120.002​.001/R001/C001><2000>}:{<V01/DST62/SRC01/PT08/DT01​><C01/R01/A07><P120.003.001/R001/C001><6>}u and so on.But i need only the value  2000 and 6.i have to analyse more than 20 such output string.how can i read these value in my front panal?

Thank u.

 

Thakur

 

0 Kudos
Message 1 of 10
(2,718 Views)

What data are you looking to extract? You need to help us here if you want help.

 

What do you need to do?

Will the string that you are getting always look like the one that you have provided?

How are you going to get the data?

What have you already tried?

Tim
GHSP
0 Kudos
Message 2 of 10
(2,712 Views)

Match Pattern and Scan From String will be your friends here.

0 Kudos
Message 3 of 10
(2,710 Views)

hi I am trying to get data which contains between <>.i have such more than 20 String that i received.each string  starts with { and ends with with }+Checksum.Then starts with{ next string for next data.but i fell difficulty getting so many string as output.I am not so gut in programing..

 

thanks

0 Kudos
Message 4 of 10
(2,707 Views)

do i need  any loop or case too.Coz i have more than 20 string that i have to analyse.

0 Kudos
Message 5 of 10
(2,706 Views)
Solution
Accepted by topic author tadhika

Here is what I would do to start:

 

Example.png\

 

This will accommodate the multi string that you want to process. You just need to get them into an array to pass to the for loop.

Tim
GHSP
0 Kudos
Message 6 of 10
(2,693 Views)

I think it really still depends on what the actual rules for the input string are.

I thought this:

tadhika string scan.png

 

Replacing the input string with an array and a for loop would work.  Or concatenating all strings together would work.

0 Kudos
Message 7 of 10
(2,688 Views)

Or you can use a regular expression.

 

Regex Solution.png

 

Ben64

Message 8 of 10
(2,680 Views)

wow..thanks it works .And can i use while loop in visa read for continuous reading a data?i used concanate string to send all the string.But Some string contains only the commands to be set and rest of them contains commands to get.e.g.in my above string C01 is for Get and C04 is for set.How can i read data continuously.i just use visa read and write with out any loop.(see attachment)

0 Kudos
Message 9 of 10
(2,677 Views)

hi

Thanks a lot.Can i use while loop in visa read ?.Because i need to get data continuosly.

 

Tadhika

0 Kudos
Message 10 of 10
(2,673 Views)