03-22-2015 08:25 PM
Thanks RavensFan.
I have a termination character. I'll try to rewrite my read with your suggestions in mind.
Never heard of a loop burner before. Googling comes up with cylindrical contraption...
By the way. I didn't write the code in the read loop. It came from a VI called serialduplicatesessions.vi which is found here:
http://www.ni.com/example/26727/en/
03-23-2015 06:38 PM
I keep seeing these types of questions pop up lately. You might want to go look at this thread: http://forums.ni.com/t5/LabVIEW/Write-and-read-serial-port-simultaneously/m-p/3106900#M890338
03-23-2015 08:10 PM
Thanks crossruls, I had a read of that thread. Sounds like your advice there is very plausible. Unfortunately the test rig is being relocated and I have to install LabVIEW on the machine for the job and the IT people can't even work out why I can't log in to that machine 😞
04-30-2015 06:10 PM
Sorry for not updating this earlier. I still haven't got a solution.
However I have found out that the problem may have nothing to do with LabVIEW or how I wrote the program (although I still agree I need to follow the advice given).
Some days after my original post, the user of the equipment reported a freeze when a vacuum pump in close proximity to the equipment was switched off.
I can repeat the problem by flicking the switch on the pump. The problem happens using a terminal program so it's not LabVIEW.
On the Arduino you have Tx and Rx pins which are between the USB chip (Atmega16U2) and the main microcontroller. Looking at those with a serial port monitor I saw the characters coming from the PC coming in slowly and the main microcontroller replying instantly. However no characters of the reply were seen by the terminal program. The Atmega16U2 must be getting corrupted somehow.
Connecting the PC to the Arduino through Tx and Rx and powering the Arduino through a separate power supply fixes the problem.
It may be that there are two mechanisms which cause the freeze and the glitch from the mains may not be the only cause of the problem.
PS. The Arduino I am using is a Funduino not a genuine Arduino. I have a genuine Arduino on order to see if that is more resilient.