LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Mini and Labview Interface for Arduino - Error 5002

Solved!
Go to solution

Hi there,

I'd like to use an Arduino Mini with LVIFA but unfortunately I keep on receiving Error 5002...

Everything seems to be connected properly: The Arduino is connected via USB to serial converter, the CP210x driver is installed and the device is recognized and functional (9600 baud rate device setting, this is also set as default rate in LVIFA sketch and my LabView vi), the reset pin is connected using 100 nF capacitor. Uploading sketches such as SerialCallResponseASCII as well as reading potentiometer values from a connected thumbstick works. But when I try a sketch (that was previously and successfully tested on an Arduino Uno) with LVIFA and the Arduino Mini the communication won't work (Error 5002). The Arduino Init.vi doesn't allow me to select the mini board so I selected Uno, could that be the reason for my problems? Any information I missed to provide? Any suggestions?

Thanks heaps,

Daniel

0 Kudos
Message 1 of 30
(14,837 Views)

Hey Daniel,

Can you confirm that the LIFA firmware builds and deploys successfully?

Have you used a VISA constant wired to the Init VI to specify the COM port that coresponds to the Arduino?

Thanks,

-Sam K

LIFA Developer

0 Kudos
Message 2 of 30
(5,305 Views)

When you loaded the LIFA firmware sketch to the Arduino Mini, did you set the board type to Arduino Mini w/ Atmega xxxx, in the Arduino's IDE Tools pull down menu? Same place you set the serial baud rate. On the LabVIEW side, the VIs should all work with the Board Type set to UNO in the Init.vi. 

Arduino Minis have 8 analog inputs, instead of 6 as found on the UNO. To gain access to the extra ports, edit Num Pins in the Check For Pin Out of Range.vi (case UNO/case Analog) by changing the constant 6 to 8.

JohnCS

0 Kudos
Message 3 of 30
(5,305 Views)

Sammy_K schrieb:

Hey Daniel,

Can you confirm that the LIFA firmware builds and deploys successfully?

Have you used a VISA constant wired to the Init VI to specify the COM port that coresponds to the Arduino?

Thanks,

-Sam K

LIFA Developer

Hi Sam,

Thank you for your reply!

No, I cannot confirm that the LIFA firmware builds and deploys successfully. Right now I'm getting bad messages (again) such as 'avrdude: stk500_getsync(): not in sync: resp=0x00' in arduino software upon (arduino example) sketch upload. I got those messages before but the issue seemed to be cured. I actually succeed once in using a thumbstick with my own vi but I can't reproduce the results... Serial communication with the arduino mini via usb/serial adapter seems kind of unstable?

I have used a VISA constant wired to the Init VI to specify the COM port that coresponds to the Arduino.

Is it possible that I killed the arduino/usb-adapter by switching rx/tx cables?

Daniel

0 Kudos
Message 4 of 30
(5,305 Views)

JohnCS schrieb:

When you loaded the LIFA firmware sketch to the Arduino Mini, did you set the board type to Arduino Mini w/ Atmega xxxx, in the Arduino's IDE Tools pull down menu? Same place you set the serial baud rate. On the LabVIEW side, the VIs should all work with the Board Type set to UNO in the Init.vi. 

Arduino Minis have 8 analog inputs, instead of 6 as found on the UNO. To gain access to the extra ports, edit Num Pins in the Check For Pin Out of Range.vi (case UNO/case Analog) by changing the constant 6 to 8.

JohnCS

Hi JohnCS,

Thanks for your reply.

Yes, I set the board type to Arduino Mini w/ Atmega xxxx, in the Arduino's IDE Tools pull down menu. Serial baud rate was set to 9600 in Win7 device/driver settings (silicon labs cp210x usb to uart bridge), in LVIFA_base and in the LabView VI.

Daniel

0 Kudos
Message 5 of 30
(5,305 Views)

Switching the Rxi and Txo lines shouldn't hurt the device, but it won't work if the lines aren't connected correctly.

Which version of the Mini are you using?

Are you still  getting averdude error messages?  The message 'avrdude: stk500_getsync(): not in sync: resp=0x00' usually means that something is wrong with the USB to UART connection and the firmware download has failed.

JohnCS

0 Kudos
Message 6 of 30
(5,305 Views)

JohnCS,

Thanks for your reply. I'm using an Arduino Mini R5 with ATmega168 and unfortunately, I'm still getting the messages. I even changed the USB UART adapter but still no luck.

Daniel

0 Kudos
Message 7 of 30
(5,305 Views)

According to the Arduino Main website, Arduino Mini Revision 5 has ATmega328.

Are you still  getting averdude error messages?

Using only the Arduino IDE programming environment, are you able to compile, upload and run one of the Arduino example sketches from the Arduino application window?

JohnCS

0 Kudos
Message 8 of 30
(5,305 Views)

Hi JohnCS,

I swapped rx/tx again, changed to ATmega328 and pushed the reset button shortly before uploading the "Blink" example sketch. The LED is blinking & no more averdude error messages! Thank you.

I'm still getting Error 5002 from Init.vi (after uploading LVIFA).

0 Kudos
Message 9 of 30
(5,305 Views)

Assuming that LIFA uploaded to the Mini correctly (no errors in the IDE window), error 5002 implies that the Max Retries to connect has been exceeded. Try opening the block diagram of the Analog Read Pin Example.vi and click on the Init.vi to open it. Open the block diagram and put probes on the VISA resource wire and the error cluster wire in the space between the while loop and the colored error/no error case statement. Set the front panel of the Analog Read Pin Example.vi as you normally would and run the example VI.

What does the Probe Watch Window display about the Visa Resource and the Error Cluster?

JohnCS

0 Kudos
Message 10 of 30
(5,305 Views)