LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino mega 1280

Hi,

I have followed all the steps in the setup guide but I have an arduino mega 1280 with windows 7 unfortunatley If I even wire up an the Init vi and the close vi and set the com port with a control to com7 and a the board to mega, I get the ERR 5002.  Does anyone know even a way around this even if I have to open the visa session myself manually.

Thanks

Nick

0 Kudos
Message 1 of 9
(7,521 Views)

Nick,

Are you using the included (unchanged) version of the firmware?  Did the firmware deploy to the board without any trouble?

One user was having trouble getting the Mega 2560 to connect but changing the timeout in the Init IV fixed the issue.  You can try chainging the timeout shown below to something larger (this is in the init.vi).

SP32-157.png

Let us know if this helps.

-Sam

LIFA Developer

0 Kudos
Message 2 of 9
(3,947 Views)

Nick,

If the above does not work you can also change the timeout listed below.

SP32-158.png

The timeout in my previous post is the amount of time to allow for the serial port connection to be opened in your OS (Windows).  The timeout in this post is to allow time for the Arduino bootloader to finish before LabVIEW tries to synchronize with the Arduino.  As I was typing this I realized that this must be your problem.

On the older Arduino boards (Duemilanove / 1280) the bootloader takes much longer because it needs to allow the user time to press the reset button to program the board.  On the newer boards (Uno / Mega 2560) the board is automatically reset by the programming environment (Arduino IDE) using the serial DTR line.  This results in a much faster boot time on the newer boards.  Since we only 'officially' support Uno and Mega 2560 this was not included as on option in the toolkit but it will likely be added in the future if we see enough people useing older boards.

-Sam

LIFA Developer

0 Kudos
Message 3 of 9
(3,947 Views)

Hi Sammy,

Thanks for replying so quickly. Dont I feel dumb it turned out that I had forgotten to change the baud rate on win 7 to match labview baud.

Thanks again

Nick

0 Kudos
Message 4 of 9
(3,947 Views)

Changing the timeout delay fixed my 5002 error on my Duemilanove, thanks Sam!

0 Kudos
Message 5 of 9
(3,947 Views)

Cool cool.  I'm glad we got you guys sorted out.

-Sam

LIFA Developer

0 Kudos
Message 6 of 9
(3,947 Views)

Dear Sam,

I have the same problem with my Arduino Mega 1280. I tried to change the delays but it didn't work. I also tried to change the baud rate in both windows device manager and in labview. Since I know pretty much nothing about this kind of things, could you please give me the correct baud rate for the Arduino? It's the usb serial port baud rate that has to be changed (1in windows device manager) in order to match the one in LabVIEW or it's the opposite?

Regarding the other parameters (Board type and bytes per packet) which value should they have?

Thank you very much

Ettore

0 Kudos
Message 7 of 9
(3,947 Views)

The baud rate set in LV and the Arduino firmware need to match.  The windows setting should be overwitten by LabVIEW (this is why you have to specify the setting in LV) but it seems like some people have had success setting it manually.  Either way LV will (try to) overwrite the windows setting (temporarily for the session).

-Sam K

LIFA Developer

0 Kudos
Message 8 of 9
(3,947 Views)

Hi,

See my post at the end of   Mega 2560 - 5002 error

Regards

Canalian

0 Kudos
Message 9 of 9
(3,947 Views)