11-05-2009 04:23 AM
Hi
I have a wireless receiver that is connected to a PC via a Serial port. The receiver is connected to a transmitter that sends digital data obtained from a ADC. The resolution of the ADC is 12 bit.
The data received at the serial port is between 0 and 4095. I have plotted the received data but it does not look like the original analog signal at the transmitter.
I am attaching my screen shots of my original signal and the waveform plotted in labview.
can someone please help me out?
Thanks
11-05-2009 09:35 AM
I think it is a sampling rate issue- Your scope is set to 500samples/sec while the 500msec delay in your vi will only yield 2samples/sec at best. To obtain an accurate representation of your signal, the sampling rate needs to be at least 2 times higher that the highest frequency component of interest contained in the signal. This is independant of how fast the A/D is sampling.
How fast can the can the receiver be polled via the serial port and what is the minimum delay required between requsting and returning the data? That will be the be the difining factor on your sampling rate.
-AK2DM
11-06-2009 02:43 AM
Thanks for your reply.
The ADC is programmed to have a sampling rate of 16 ksps, which I think is the maximum possible value.
I didn't understand your question on the receiver? Can you elaborate on that?
The baud rate of the serial port is set at 19200 bps. what would be the optimal value?
Does decreasing the delay in the VI improves the graph?
11-06-2009 09:26 AM
Hi,
I think you might be losing some data in the decimal string to number conversion. Can you probe before and after that subvi to make sure you are getting the results you expect? Depending on what format the string you are passing to the conversion and how many bytes / values you are reading on each VISA read you may only looking at the first value from each read. This would cause you to receive data that appears to be sampling at 2 Hz because you would be ignoring the other samples when you read. Hope this helps!
11-10-2009 02:01 AM
11-10-2009 05:53 PM
Your code is set up to read all available bytes at the port. If you try to read more bytes you could start getting time out errors because the read is going to wait until the bytes are available. Can you elaborate on your observation? Is everything spaced out? Are you using the same code that you posted?