Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing problem in acquiring through a USB-serial converter

Hello

I'm having a timing problem in acquiring a high-frequency serial signal through a USB-serial converter. In my project, I have to use 2 serial lines (both pass through a converter, since my computer doesn't have a serial port).

 - The first line must read N frames of 500 values, which are continuously sent by the device I must check.

 - The second line receives a variable-in-time number of bytes, and I must know how many bytes it has received in the time the first line has read a 500-values frame.

Both serial ports work at the same baud frequency, around 1Mbips, and the values are acquired through VISA.

 

My problem is that  the program doesn't acquire the values continuously: it seems that it receives the data in big bursts, which cause serious evaluation errors on the second line (it reads in one time the number of values that it should read in 3-4 times). I know that USB sends data frame-by-frame rather than continuously, but I have this same problem even working at lower frequencies (and the data bursts seem to be about 4000 bytes in size, instead of 1024 as a typical USB frame).

 

Do you have any suggestions about this  problem?

 

Thanks in advance.

Delfo79

0 Kudos
Message 1 of 5
(7,872 Views)

Hi Delfo

 

As far as I understood your request can be addressed to two main issues: a) modify the reading modality and b) perform a continuous acquisition.

 

I would like to suggest you to give a look to the VISA Raad.vi function help. You can find it in your LabVIEW Help through the following path: VI and Function Reference»Instrument I/O VIs and Functions»VISA VIs and Functions. VISA Read details give precious suggestions on how to check reading performance (point 'a') while the Basic Serial Write and Read VI  and the Advanced Serial Write and Read VI examples show how to implement a continuous reading, using the Byte at Port property node to read continuously data from your second line, for instance.

 

Hope this helps

 

HUDSON

0 Kudos
Message 2 of 5
(7,847 Views)

Hello,

 

I am having a similar problem with my test setup. I am using a USB to Serial converter for RS-422 communication. The data is coming into the receive lines at a rate of 1 frame of data (5 bytes) every 1 msec (1000 Hz rate). I verified this using a scope. When I use LabVIEW to read the data, I do not see any data except every 0.7 seconds and then I see a pile of data. It is repeatable to some extent but there is always a delay of between 0.6 and 0.7 seconds. The data is correct but should come over continuously.

 

The settings for the unit are 375,000 baud rate, 8 bits-Odd Parity-1.0 Stop Bits and no flow control. I have checked both Asynchronous and Sychronous communication and there is no difference with the delay problem. I am using LabVIEW 8.5, Windows XP, and the converter is Saelig USB-COMi-SI-M Single Port Converter set to RS-422.

 

Thanks in advance for all your help.

 

Michael

0 Kudos
Message 3 of 5
(7,691 Views)

I solved the problem with the help of the manufacturer of the serial converter. To fix things, go to the "Device Manager -> Ports" and select the USB Serial Port corresponding to your Serial Converter. Right Click and select "Properties". When the Properties window comes up, select "Port Settings" and then select "Advanced...". Under "BM Options" there is a "Latency Timer". I changed mine from 16 msec to 1 msec and the delay problem went away and the data comes over perfectly. Hope this helps other frustrated users. Have a great LV Day!

 

Michael

 

 

Message 4 of 5
(7,687 Views)
 wrote:

I solved the problem with the help of the manufacturer of the serial converter. To fix things, go to the "Device Manager -> Ports" and select the USB Serial Port corresponding to your Serial Converter. Right Click and select "Properties". When the Properties window comes up, select "Port Settings" and then select "Advanced...". Under "BM Options" there is a "Latency Timer". I changed mine from 16 msec to 1 msec and the delay problem went away and the data comes over perfectly. Hope this helps other frustrated users. Have a great LV Day!

 

Michael

 

 


Splendid ... you really made my day.

Finally solved our data transfer problem with Barbier Densy 150E so thanks a lot 🙂 cdr

0 Kudos
Message 5 of 5
(3,410 Views)