Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66885

Some questions on efficient serial read and speeding up data processing

$
0
0

I have this flow meter that spits out two strings when queried with command "x" : Date:time, and then Meter #1 xxxx.xxxx SCFM . All that the x does is query the meter to display its status. The serial readout from the meter is intended to only duplicate the value present on the little lcd that the meter has. It's not meant for controlling and my discussion with the company was that while not ideal, parsing the string is the only way to get useable info from it. I only need the flow value and there is no way that it will just output that string. So I have it set up to search for the meter name, and if this has a value find the number. Before I did not have the true false case but it meant that the flow would state zero every time that it received the date:time string. My questions are:

 

Is this the only way to do this? both in terms of finding the number I need and making sure that it is always updated properly.

 

Right now I have a delay in the while loop because if I sample too fast, I oversample the buffer and get no useable string data (get one letter or no value at a time). Is there any way to remove this and have continous sampling?  I thought about reducing the wait time to 25ms, searching for a series of characters like #, 1, and parsing the string character by character, but the vi moves too fast to capture all of the data. If I put in a buffer delay I am right back where I started with the longer delay.

 

Is there anything else I can do to make this code more efficient and better sample the flow meters output?


Viewing all articles
Browse latest Browse all 66885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>