Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have designed an USB HID device which can answer our queries. So I can request this device for updates and the USB device sends back the updated data.
I am writing an application in C# using VS2010 and I have used USB HID library from Atmel "atusbhid.dll". I have some controls on the main form including text boxes and combo boxes.
Now the problem is that the application starts normal but gets slower and unresponsive with time passage. I have tried to solve the problem using Threads too, but not fruitful.

What is the best way to synchronize with USB HID device and to keep the GUI responsive?
Posted
Updated 18-Dec-13 2:04am
v2
Comments
Pheonyx 18-Dec-13 8:44am    
What debugging have you tried? Have you managed to identify what parts of the code get slower? Have you looked at the applications memory usage (i.e. is there a memory leak)?
qureshi.yk 18-Dec-13 14:01pm    
When I created a separate thread to retrieve data from USB device, I observed that after a while the device was still getting requests from the PC but my GUI was unresponsive. And what I think is that the GUI is not fast enough to get updated.

I would be very pleased if you can provide me any example or link to data polling with USB devices in C#.
Pheonyx 18-Dec-13 14:56pm    
What happens if you take out the automatic updating and have a button in your UI that asks for a fresh from the device?
qureshi.yk 19-Dec-13 9:10am    
With a single button click and also with longer delays it works absolutely ok and this is the reason why I think that the GUI is not fast enough to update the controls with automatic refresh. My desired refresh rate is 2 times a second.
qureshi.yk 30-Jan-14 18:05pm    
I found the solution in Ahid.dll. This is paid USB HID library which really works fantastic for me. more information can be found at: http://ahidlib.com/index.php/ahid-and-vb

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900