LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analyzing the read buffer string

I have a device that is sending a text line ( text line looks like: A= 122  B=17% C=012 ) to the serial port of PC every second, i have used VISA read  to read the data in LabView(read buffer) , i am looking for a way to set limit to these values for example: whenever A goes below some limit send a signal to DAQ card, if there is a way to graph these data too, it would be great. Thank you for your time.
0 Kudos
Message 1 of 9
(7,443 Views)
You can parse out the string that is read in using the scan from string function.  (Note there is a %% in the format string to handle the % sign showing up in the string that is read.)
 
Then you can use the values as you see fit such as comparing them and executing code in a case structure and sending the values to waveform charts.


Message Edited by Ravens Fan on 04-22-2008 03:49 PM
Message 2 of 9
(7,430 Views)

Hi persol,

here is a way, how you can get your data into an array. After that you can analyze it and check ranges.

Mike



Message Edited by MikeS81 on 04-22-2008 09:54 PM
0 Kudos
Message 3 of 9
(7,422 Views)
As an addendum to the above, if your list of parameters that gets returned is long, using an array may be a little easier:

EDIT: I was referring to Ravens Fan's post, as Mike posted at the same time I did.


Message Edited by smercurio_fc on 04-22-2008 02:54 PM
0 Kudos
Message 4 of 9
(7,420 Views)
Thank you all, i am new to labview so i am not sure what is that box that looks likes pages? ( dont laugh) or where i can find it?
0 Kudos
Message 5 of 9
(7,404 Views)


persol wrote:
Thank you all, i am new to labview so i am not sure what is that box that looks likes pages? ( dont laugh) or where i can find it?


Look in the string palette, mine,  Mike's, and smercurios functions can all be found there.  One thing to be careful of, and you will have to experiment with the various strings, is that in your example, it seems you have an extra space after the A= portion of the read string.  Extra spaces could cause hiccups in Mike's and smercurio's examples.
0 Kudos
Message 6 of 9
(7,391 Views)
Thank you Ravens Fan i am currently trying to do it like your example but this error comes up: "LabVIEW:  Scan failed. The input string does not contain data in the expected format." but in mike example i wasn't talking about the functions i was talking about that box that includes "Match pattern" functiuon and the other function, that has @"N" at top lrft corner an "i" at the bottom. thanks again for your help
0 Kudos
Message 7 of 9
(7,378 Views)

nevermind i found it, its a for loop

but i steel get that error message , i think that is because i cant define the format correctly, in data that i get from device there is also time and date like so " 04/22/08 14:02:53" at the begining which they are not equal to anything so i cant use %f, do you know how can i define the format?

0 Kudos
Message 8 of 9
(7,365 Views)
In the labView help search for Format Specifiers Syntax Elements, click on the subject of same name...
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 9 of 9
(7,363 Views)