Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication

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

Download All
0 Kudos
Message 1 of 6
(4,495 Views)

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

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 6
(4,468 Views)

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? 

0 Kudos
Message 3 of 6
(4,441 Views)

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!
Matt
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(4,423 Views)
I get the same value before and after the decimal string to number conversion vi. I have observed that the number of bytes read is only 5 bytes. How do I increase the number of bytes read? I have also observed that 0.5 second wide signal on oscilloscope looks 25 seconds wide in labview.
0 Kudos
Message 5 of 6
(4,365 Views)

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?

Matt
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(4,336 Views)