简体   繁体   中英

USB-Serial Port stops working without any reason

I use as USB-SerialPort Converter for a Barcodereader. (Drivers for the converter are supplied on a CD -- company: digitus)

In my program (C#) I wait for SerialPortDataReceived-Events and proceed if I get values -- so far everything works fine.

The problem now is that I don't receive Data anymore sometimes. The same readers and USB-RS232 converters as well as the same notebooks (lenovo, Win7) are used at 8 stations, but only at 2 of them I have this problem.

When I am in the situation that I do not receive Data when the reader read some, I can't see any problem. Windows says that the serial port is working fine.

But when I unplug the power supply of the reader and reconnect the COM-Port in my program it works again. (And I do not think that the reader is the problem, because those readers are used a couple of hundred times in the company I work for) So it must be the converter or the cooperation from the converter and the barcode reader!?

My next idea would be trying another converter, but is there any way to understand the cause? Or did anybody have a similar problem?

USB ports are terribly unreliable in this way. The only way to get a reliable serial.port is to use a PCI card or an Ethernet device server. You will never get a consistent connection through USB.

We get a bug reported in our serial port comms about one a month, and every single occurrence is due to someone using a USB to RS232 converter. As soon as we install better hardwarec the issue vanishes.

Try disabling the "USB selective suspend" feature

  1. Open Control Panel .
  2. Click on Hardware and Sound .
  3. Click on Power Options .
  4. Click the Change plan settings link for the plan you're currently using. (If you change the settings on the power plan that isn't active, this won't work.)
  5. Click the Change advanced power settings link.
  6. Expand USB settings .
  7. Expand USB selective suspend setting .
  8. Select Disabled from the drop-down menu.
  9. Click Apply .
  10. Click OK .

If you're changing the settings on a laptop or tablet, you'll see two options: On Battery and Plugged in , so make sure to change those settings accordingly.

Once you complete these steps, Windows 10 will no longer power off USB devices connected to your computer, which can fix any problem you may have as a result of this feature.

While this guide focuses on Windows 10, USB selective suspend has been around for a long time, and you can use the same steps on machines running Windows 8.1 and Windows 7.

For more details check https://www.windowscentral.com/how-prevent-windows-10-turning-usb-devices#:~:text=When%20a%20USB%20device%20is,feature%20to%20fix%20the%20problem.&text=Windows%2010%20includes%20the%20USB,re%20not%20actively%20in%20use .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM