chilakaluri
May 6th, 2009, 08:28 PM
Hi,
I have an multi threaded application developed using C under Microsoft Visual Studio.
The application runs on desktop computer and the devices are connected to the computer USB port using a USB toRS485 converter. All devices communicate to the computer on RS 485 bus.
It has the following threads.
Main application thread
RxThread communicates with a Labview application on TCP/IP
protocol_RxThread and
protocol_TxThread are used for communicating with the devices.
The system works well for 1 or two days and it stops communicating after that. I have observed that the computer gives an error message saying that the device connected to the USB port is not identified. Now I need to findout whether it is
1. Problem with the USB port - Is it freezing after some days of working.
2. Problem with the converter I am using.
3.Problem with the threads used for communication.
When the application looses communication, I have seen that the application communicates with the Labview application on TCP/IP which is running on the same computer. When I check the COM ports on Device Manager, the USB device is not shown and after some time it comes up with an error saying that there are no drivers for the attached USB device. If I disconnect and reconnect the USB device it finds the device and still the application did not communicate with the devices. But when I quit the application, it quits without any problem.If I do not reconnect the USB device and try to quit the application it does not quit,It disappears from the application but stills runs in the processes in the task manger window. To quit I need to kill the process.
I am struggling with this problem from last six months, earlier I was assuming that it could be problem with the threads, but with recent observations I am thinking it could be problem with USB port or the USB to 485 converter.
If any one can suggest a solution for this I will be verymuch greatful.
Thanks
I have an multi threaded application developed using C under Microsoft Visual Studio.
The application runs on desktop computer and the devices are connected to the computer USB port using a USB toRS485 converter. All devices communicate to the computer on RS 485 bus.
It has the following threads.
Main application thread
RxThread communicates with a Labview application on TCP/IP
protocol_RxThread and
protocol_TxThread are used for communicating with the devices.
The system works well for 1 or two days and it stops communicating after that. I have observed that the computer gives an error message saying that the device connected to the USB port is not identified. Now I need to findout whether it is
1. Problem with the USB port - Is it freezing after some days of working.
2. Problem with the converter I am using.
3.Problem with the threads used for communication.
When the application looses communication, I have seen that the application communicates with the Labview application on TCP/IP which is running on the same computer. When I check the COM ports on Device Manager, the USB device is not shown and after some time it comes up with an error saying that there are no drivers for the attached USB device. If I disconnect and reconnect the USB device it finds the device and still the application did not communicate with the devices. But when I quit the application, it quits without any problem.If I do not reconnect the USB device and try to quit the application it does not quit,It disappears from the application but stills runs in the processes in the task manger window. To quit I need to kill the process.
I am struggling with this problem from last six months, earlier I was assuming that it could be problem with the threads, but with recent observations I am thinking it could be problem with USB port or the USB to 485 converter.
If any one can suggest a solution for this I will be verymuch greatful.
Thanks