LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can loop data back into a match string filter?

I'm using a match string filter to separate an ascii line. There are more than one $,   ,   ,   , cr(carriage return)sequences in each line. It looks for a '$' and allows the '$' and the rest of the string to pass. The next match string function looks for a cr and allows the cr and before to pass. These 2 functions looks at the ascii string and separates a part that looks like this: "$rpols,...,...,...,cr". My problem is this: I would like to filter the rest of the line again to filter out more than one of these string formats. Can I pass the rest of the string through the same match string sequence or do I have to build a match string filter for each of the $ cr occurances?? Right now my error is something like 2 sources into one sink. I tried putting the match string filter into into a while loop and then using a feedback node and that got the sink error. I would like to use the same filter. Thanks in advance for the help.

ssmith@bnl.gov
0 Kudos
Message 1 of 4
(2,259 Views)
A while loop with feedback node or shift register should do what you want. You may need to return the offset past match to the start offset via another shift register, depending on exactly what you are trying to do.

You may have connected something incorrectly. Can you post your VI with some sample data?

Lynn
0 Kudos
Message 2 of 4
(2,255 Views)

Just to clarify Lynn's post, you should always operate on the same string, it is not worth constantly re-feeding the current "rest" back via shift register. The only thing you need to keep track of in a shift register is the current match position so you search from there in the next iteration.

There are quite a few efficient ways to do this. Please attach your VI and a typical sample string.

0 Kudos
Message 3 of 4
(2,253 Views)
Lynn/Altenbach--
    Here is a little more info about the VI's use. A radio repeater is doing a store and forward operation once per minute. During the minute the repeater receives radio messages that start with a $ and end with a CR/LF (Carriage return/Line feed). The repeater groups the captured messages and sends all out as one transmission once per minute. I'm asking LV to read the data using a serial com port, Look for the $ then the CR and separate it and look for the next $ and CR separate and so on. I've attached 2 VI's that I've built and a text file with a repeated message. The repeated message only has 2 messages in it but eventually could have 10 or more. One of them works and the other does not. The filename with NG at the end does not and the other one does. Please don't laugh to hard at  my work  because I am a Labview novice. Thanks in advance for the help.

Scott

ssmith@bnl.gov
0 Kudos
Message 4 of 4
(2,247 Views)