11-24-2008 05:25 PM

11-24-2008 05:27 PM
11-24-2008 07:09 PM
Hi, I hope you read this. I had a followup question. My read string is obviously something other than XX.XXXX or X.XXXX or even XX.XX or .XXXX, and I have these Search Regular Expression Boolean results wired to OR statements and tied that to a case structure that when TRUE, executes data logging and plotting. However, I have not received any data in the file, therefore there must be no number in my read string that fits these.
I put some indicators on my system to try and troubleshoot it and this is what I found, as one example:
Read Buffer (indicator directly after VISA Read): 1.4576
String Length (indicator directly after VISA Read): 10
Number of Bytes at Serial Port (after Number of Bytes at Port instrument settings vi and just before VISA Read, just as in example): 40.
Do these numbers seem reasonable? I need to figure out what exactly is in my Read string so that I know how to handle it.
Thank you.
11-25-2008 03:56 PM - edited 11-25-2008 03:57 PM
I am not very familiar with talking to serial devices over VESA so whether or not those make sense I am not sure. But what I can tell you is that if you want the match to be more flexible than XX.XXXX but be able to accomodate any arbitrary amount of numbers before and after the decimal then replace the regular expression you have now with this one ---> ^[0-9]+\.[0-9]+$
This new regular expression only requires at least one number before the decimal, an actual decimal, then at least one number after the decimal. To be more explicit it will match X.YYYY, XXX.Y, but it will not match XX. or .YY
