LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable auto-reset on serial connection?

This is a bit off-topic because it doesn't have to do with the LVIFA, but it does have to do with an Arduino. I have a program running on the Arduino, and I would like to have a vi communcate with it over the USB serial interface. The problem is that when LabVIEW opens the serial port the Arduino Uno gets reset and starts its program over, and I don't want that. My research tells me that this is a result of the DTR line being toggled, and some programming languages have ways of stopping that, but I haven't been successful with LabVIEW. Using a VISA (ver 6.0.3) Instr property node and setting DTR to unasserted before opening the port doesn't have any effect. I know there are other hardware solutions like cutting traces, but I would like a less drastic approach. Any solutions?

Richard

0 Kudos
Message 1 of 3
(9,053 Views)

After doing a bunch more digging and some experimentation I have concluded that there is no way to control the DTR line through LabVIEW with the Arduino drivers, so I have gone for a hardware solution. I attached an RC combination to the Reset line: resistor to +5 V and a large electrolytic capacitor to ground. Now the short auto-reset pulse gets filtered out and doesn't have any effect. If I want auto-reset back I just disconnect the RC circuit from the Reset line by removing a jumper.

Richard

Message 2 of 3
(5,439 Views)

Richard,

You are correct that the Arduino Uno is reset when the DTR line is toggled.  This makes programming an Arduino with the Arduino IDE much easier since you no longer have to press the reset button within a few seconds of hitting the upload button (the reset is now triggered by the DTR line being toggled).  This allows the boot loader to complete faster but causes trouble when using LabVIEW to connect to the Arduino.

In LabVIEW you have direct control over the DTR line via property nodes once a VISA session has been opened. However the act of opening a VISA session toggles the DTR line, causing the Arduino to reset.

As you mentioned there are a couple hardware fixes (cutting a trace on the board, the less permanent RC filter ...), or you can find yourself an older board like the duemilanove which did not include this 'feature'.

-Sam

LIFA Developer

0 Kudos
Message 3 of 3
(5,439 Views)