LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sine Wave Measurements

I am currently new to Labview and have made some progress but would love some help.  I am currently receiving sine wave data from the RS232 port and then converting it and needing to take measurements on the input data.  The problem I am having is that as soon as my data hits the distortion measurements, all I get for an output is a NaN.  I figure I am missing something simple.  Any pointers or help would be greatly appreciated!!
0 Kudos
Message 1 of 2
(2,296 Views)

Are you sure you are getting complete messages every time you read the serial port?

 

Right now you loop runs 10 times per second (100 ms wait timer).  It takes all the bytes available at the port and reads them, then proceeds to work on them.  This could be 1 byte, it could be 100 bytes.  I would bet that if you are getting incomplete data (such as only 1 byte when a complete data packet might be 10 bytes) your string data is not being converted to good numerical values.

 

What does one package of valid data look like?  Does it have a termination character?

 

You need to set up your serial communication that ensures you have a complete package of valid data before your proceed to convert it and do the math on it.

0 Kudos
Message 2 of 2
(2,269 Views)