LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial data read not working properly

If you don't read constantly, you'll overflow the serial port buffer and get an error. You apparently didn't read what I said about taking the mean of the data. You certainly don't have to display each point as it arrives.
0 Kudos
Message 11 of 17
(1,510 Views)

I am new to the labview. i tried but  not succeded in taking the mean of a data. More over there are no arrays in my Vi. So can you please tell me, how exactly  can i take mean of the data in my VI.

 

Thank you

0 Kudos
Message 12 of 17
(1,498 Views)

How fast is your data actually coming in?  You could just use the Mean PtByPt.vi to do a moving average of X samples based on the actual sample rate.  Then just use Elapsed Time to state when to store the latest value.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 17
(1,486 Views)

The data is coming very fast as Ex : 100samples/sec. Sorry i didn't understood what you have said about elapsed timed as i am very much new to labview. so can you please provide me a example shows how can we make a delay of 1sec (same as wait(ms)- 1000ms ) in a while loop. If possible please do the corrections for My attached VI. Because i need this to be completed very urgently.

0 Kudos
Message 14 of 17
(1,466 Views)

liviya wrote: The data is coming very fast as Ex : 100samples/sec.

You need to know your system a lot better than "very fast".  I consider 100S/sec slow.  But if we assume the 100S/sec, then the simplest method is to just use a FOR loop to gather 100 samples (1 second's worth of data) and do an average of that data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 15 of 17
(1,443 Views)

Actually the data varies so i dont know exactly. It is like reading a radiation, it is very fast intilally and then decreases slowly. And i need only to read the sample/sec. i am getting various sample per each second. And the Vi I used intially to read serial data but the actula VI is different (i am attaching here). Please correct the Vi i provided So that i read the sample/sec. Thank you for your patience.  Sorry i am new to labview and not able follow you exactly.

 

 

thank you

0 Kudos
Message 16 of 17
(1,428 Views)

We have developed a package on the LabVIEW Tools Network to automate serial port interactions. You can use it to replicate what you manually do using Putty in LabVIEW for serial devices such as login, entering commands, waiting for a response and returning it. You can find out more about it and download a 30-day free trial at: http://sine.ni.com/nips/cds/view/p/lang/en/nid/214248

Certified LabVIEW Architect (CLA)
0 Kudos
Message 17 of 17
(1,211 Views)