0

I've been using an Arduino UNO to log data: it's queried by a LabView VI over a VISA connection. It'll happily sit there and log for days, but very occasionally one of the VISA functions will fail.

After this, I can't open the COM port again (in LabView or elsewhere) and the only way to restore communication is to unplug and replug the USB cable. The Arduino hasn't crashed because I can see the other results of the program it's running working fine, but Serial comms are a gonner.

Has anyone experienced this? Do you know if this is an Arduino problem, a Labview problem, a Windows problem? Or something else?

I'm writing a minimum working example to try and catch this happening in the most simple code possible, but since the error usually takes several days to show up I can't tell you the results yet!

  • Which Arduino? – Majenko Sep 10 '15 at 16:11
  • Good point: it's an Uno – CharlieB Sep 10 '15 at 16:13
0

The assumption I am making is "VISA connection" is a PC operating VISA. I have seen ports shut down on windows several times yet the same port works fine while in DOS. My suggestion is try a different computer, that should narrow down your problem to which side of the connector is failing.

  • Cheers Gil, I did give it a shot on another computer and the problem was still there though. In the end I found a solution, I'll add it as an answer. – CharlieB Oct 26 '15 at 20:59
0

In the end I found a solution, more or less through trial and error.

Labview default its VISA VIs to "asynchronous" mode: I found that by switching them to "synchronous" (right click on them and select "synchronous") this problem disappeared.

I think this is caused by the computer occasionally getting ahead of the Arduino and asking for the next measurement before it's finished receiving the first one. Switching to synchronous mode forces execution to wait until the VISA exchange is complete before it continues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.