10-09-2009 07:07 PM
Hello All,
I've got an interesting problem and having a tough time finding a solution, and thought a pair of fresh eyes might help! I'm reading data in over serial using VISA. That's going well. I'm doing this continually and then appending to a string. From this string, I look for new lines, and pull them off of the serial buffer string. I then look at the lines to see if they have the appropriate commands, and if so, parse out those commands to control a case structure.
Now here's the interesting part. When I started, I wrote a vi to take in some arbitrary multi-line string in, and parse out the sentences and data, and it works as expected, but when I do it with live serial data and the ring buffer, the case statement doesn't work. Also, when I probe the parsed string that goes to control the case statement, it LOOKS right, but the case statement will not accept it.
Any thoughts would be greatly appreciated, I'm pretty stumped as to what's going on here. I attached the 2 vi's.
Gurus? Masters?
Thanks!
Solved! Go to Solution.
10-11-2009 01:35 AM
10-12-2009 07:48 AM
Jim S,
I see a couple of problems. As previously posted you should be using Greater or Equal? instead of Greater?. The biggest problem is that you have a string constant set to '\n' but the constant itself is not configured for '\' Codes Display mode.
10-12-2009 12:16 PM
Thanks Albert and Wayne,
After posting this, I realized I hadn't enabled the '\' visual for the string output. Once I flipped this on, I was able to see a hidden \r that I hadn't caught. I am curious as to why the regular expression doesn't chop that out, but otherwise, the problem is resolved.
Thanks again!