LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Computer crashes while communicating via serial port

Solved!
Go to solution

I have developed a code in LabVIEW 2011 to communicate with XY linear stage. It's actually two stages mounted perpendicularly. The setup of the system is that a joystick (made by the same manufacturer as the stage) is connected to the USB port of the computer though a USB to Serial converter. One stage is daisy chanied to the joystick and the other stage is daisy chained to the first stage.

For the purpose of our application, it's required to continuously check the status and position of the X and Y stages. Because the joystick also returns responses when a request sent to all devices, I need to send the requests individually; i.e.. one request per command per device making it total of 4 commands. This takes care of the error received from the joystick. The issue, though, is that after a while either the program freezes or the computer crashes and restarts. It happens about 13 minutes (in average) after the program starts. It also happens even when no move commands are sent to the devices. I have put to 50 ms delays before sending each two commands (position and status) per device. Basically, the app waits for 50 ms before sending two commands to X stage and receiving the response and when all is done with X stage, it waits for another 50 ms to do the same for Y stage. This procedure should goes on until the app is stopped. But as I said, a problem occurs. Now, I am assuming the problem is that the serial port buffer overflows. It's not preferred to increase the delay time, but if it helps resolve the issue, then I have no other option!

I would appreciate any thoughts and comments!

0 Kudos
Message 1 of 12
(16,695 Views)

AFAIK a buffer overflow should only generate an error at the device level (e.g. OVERRUN). When the computer crashes usually the culprit is the device driver, not the application. I suggest to try with another USB-serial adapter.

Most adapters feature either a FTDI chip or a Prolific chip. Personally I had more problems with Prolific than FTDI. However the performance could also depend not only on the chip but on the specific driver implementation.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 12
(16,677 Views)

Thanks for the reply! Just to give you some more info, I am using Windows 8 Home Edition OS and a Prolific USB-to-Serial converter. The driver for the converter updated and I have a feeling it's when the issue started. I'm not sure if rolling back the driver might help.

0 Kudos
Message 3 of 12
(16,662 Views)

Are you using more than one Prolific USB to serial converter?

 

I have found recently that multiple Prolific USB to serial converters on the same buss or hub will eventually fail. Even if your computer has four USB ports they could all be on one USN hub internally.

 

This problem has cropped up with in the last year or so. I read Prolific changed their drivers to detect some counterfit Prolific chips and that might have introduced this bug.

 

What I have had to do is plug one adaptor in to the front USB ports and one into the rear USB ports. But of course there is nothing that says that will always work, it just happend that the fron and rear ports are on different USB busses in teh computers we use.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 12
(16,642 Views)

The USB to Serial adapter I have has two serial port ends, so I get two serial ports from one USB port. However, I only need one and the other serial port is always free. The one I am using is manufactured by Manhattan.

0 Kudos
Message 5 of 12
(16,635 Views)

http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=155&pcid=41

 


It is confirmed that counterfeit (fake) PL-2303 USB to Serial Controller ICs using Prolific's trademark logo and device drivers were being sold in the China market. Counterfeit IC products show exactly the same outside chip markings but generally are of poor quality and causes driver compatibility issues. We issue this warning to all our customers and consumers to avoid confusion and false purchase. Only buy from Prolific authorized distributors.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 12
(16,625 Views)

I bought this adapter from Unicorn Electronics in New York state. Unfortunately, I don't have the package anymore to confirm if it's made in China. Any thoughts if switching to a FTDI chip adapter would resolve the issue?

0 Kudos
Message 7 of 12
(16,619 Views)

Several years back I had a problem with a prolific converter and windows vista.  10-20minutes would cause a BSOD and the crash log traced it wown to the driver dll.  I replaced the converter and all went away.

No problems with labview or VISA.  you should try a diferent converter some are more flakey than others

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 12
(16,610 Views)
Solution
Accepted by topic author farahikia83

After long time experimenting, I am convinced that the issue was with Profilic adapter.

0 Kudos
Message 9 of 12
(16,534 Views)

I had a similar porblem with prolific serial adapters, while running on Window7 machine with LV2011. When the same application is run on Windows XP, no problems occured.

 

I started using FDTI chipsets based serial adapters from then. I never saw issue with serial port on Win7 / win 8 or XP.

 

 

0 Kudos
Message 10 of 12
(16,513 Views)