LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port hang/freeze

Apologies for dragging an old thread up, but like many others here I had also been struggling with random FTDI USB-serial port issues, exactly as those described here. I also tried all the attempts to fix it in drivers/software. Sometimes it'd be fine for several weeks, or even a month, other times it'd give grief daily.

 

I fixed it in the end in a relatively simple manner as I realised a 'proper' fix involved the hardware/firmware and drivers beyond my direct control;

 

Simply, I added a second device which was controlled by my system to power cycle the USB-serial device. This was a software/hardware system - software monitors the systems which rely on the USB-serial device/drivers via a watchdog type mechanism and when it detects loss of comms, it would send a signal to a hardware device (over TCP/IP) which operates a relay contact to break the 5v power to the USB-serial device. Power would be left removed for say 5 seconds, then re-applied.

 

Voila! The device is re-detected and as far as everything else is concerned, it's been physically removed and re-inserted. Any hanged drivers/threads/processes relying on it exit cleanly and they can then be restarted following the power cycle, using similar detection mechanisms.

 

It may not be pretty, it may not be elegant, but it works, and I no longer get phone calls at Stupid O'Clock..

 

Hope this helps someone.

 

Chris

0 Kudos
Message 21 of 22
(1,108 Views)

Dredging up this thread again!

 

One thing I've discovered more recently is that using the 'D200' method of communicating with FTDI USB-RS232 devices, rather than a COM port, is somewhat more amenable to being reset if it all goes wrong. Haven't had chance to apply said knowledge back to the test system that I was stuck with 1.5 years ago, but it would be interesting to do. If nothing else one can do a complete driver reset in software.

 

One of the other major annoyances with using it as a COM port seems to be that letting a VI terminate without calling 'close' can lead to a situation where LV can't ever open it again, unless one quits LV entirely and restarts it, which is pretty poor.

 

I never did figure out a way to recover once the remote USB device went wrong and hung on a VISA Close, other than removing and reinserting the USB device, or killing LV from the task manager ...

 

regards

John

0 Kudos
Message 22 of 22
(1,028 Views)