LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I change default settings for Windows Serial Latency times through LabVIEW

Solved!
Go to solution

I have a wireless data collection device my company makes that I am trying to use to test one of our other wireless products. The device sends serial data to a PC through a USB port. I have written an automated LabVIEW program to test all the functions of my new product. However, after pulling in data, I have realized that the serial data comes in very fast and requires that I change the default Windows latency time for the COM port from 16ms to 2ms to not miss anything. This is easy enough for me to do locally on my machine, but much harder for me to spec for an offsite CM.

Is there a way to have my LabVIEW program change the latency time of the Windows COM port from 16ms to 2ms automatically?  

0 Kudos
Message 1 of 7
(9,591 Views)

@EricBSEE wrote:

I have a wireless data collection device my company makes that I am trying to use to test one of our other wireless products. The device sends serial data to a PC through a USB port. I have written an automated LabVIEW program to test all the functions of my new product. However, after pulling in data, I have realized that the serial data comes in very fast and requires that I change the default Windows latency time for the COM port from 16ms to 2ms to not miss anything. This is easy enough for me to do locally on my machine, but much harder for me to spec for an offsite CM.

Is there a way to have my LabVIEW program change the latency time of the Windows COM port from 16ms to 2ms automatically?  


I've never heard of this being an issue before.  Would you mind uploading your code so that we can see where the problem lies?

 

Thanks!  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 7
(9,577 Views)
Solution
Accepted by topic author EricBSEE

Are you talking about the FTDI driver? I know they allow such changes through registry settings. So the approach would be probably to have a small registry script that updates the according setting. Most likely this will need to be run with elevated priviliges as these settings typically reside in the HKLM or HKCR hive rather than the HKCU one.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 7
(9,546 Views)

You are right rolfk. For some reason I thought the latency value was from some Windows setting, but the 16ms time is actually from an FTDI driver.

 

From FTDI's website:

 

 

The default value for the latency timer is 16ms. This value may be customised by adding or changing the following entries in the FTDIPORT.INF file of the driver before installation.

 

 

[FtdiPort232.NT.HW.AddReg]

 

HKR,,"LatencyTimer",0x00010001,50

 

 

This example will set the default latency timer value to 50ms. The valid range for the latency timer is 1ms - 255ms, although 1ms is not recommended as this is the same as the USB frame length.

 

 

The latency timer value is held in the registry under

 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS\{Device VID, PID and serial number}\0000\Device Parameters\LatencyTimer

 

Using this information, I will see if i can modify the FTDI driver installation file and send that to the CM along with my test software package.

 

However, this does bring up a new question for me. You mention writing a script to change the registry.

Is it possible to make changes to Windows registry values from within LabVIEW?

I understand that this may be contingent on the elevated privileges you mentioned.

 

 

0 Kudos
Message 4 of 7
(9,531 Views)

I should have just done a quick search before adding my last question.

It looks like LabVIEW can make changes to the registry:

 

http://zone.ni.com/reference/en-XX/help/371361J-01/glang/windows_registry_access_vi/

0 Kudos
Message 5 of 7
(9,522 Views)

See below

 

REGISTRY.png

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 7
(9,517 Views)
Solution
Accepted by topic author EricBSEE

Actually it ended up being extremely easy to just add to my LabVIEW program's Initialization to check the driver setting  and change the latency to 2ms if it wasn't already set that way.

 

 registry change.png

0 Kudos
Message 7 of 7
(9,501 Views)