LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 5005

I've installed the LabVIEW interface for Arduino on my PC.  My Arduino shows up on the device manager as COM20 and is working.   I loaded the LVIFA_Base.pde file in Arduino IDE software and uploaded to the board succesfully.  I have a photocell hooked up as shown in the diagram and have it working in other programs.  when i load the LabVIEW Photocell example for the Arduino and set all COM ports to 20 (under the INIT, READ, and CLOSE icons) and when i run this VI i get an error 5002, 5003 & 5005 saying it has lost connection to Arduino. 

Anyone else getting this error or found a way to resolve it?

0 Kudos
Message 1 of 13
(21,073 Views)

Ambient_Temp,

You should only have to specify the COM port as an input to the Init VI.  Have you modified the example other than chainging the COM port?  Can you post the code or a screen shot of the code you are running?  Which error are you getting 5002, 5003 or 5005?  You should only get one per run.

I think a screen shot of you code will help us get to the bottom of this.

-Sam

LIFA Developer

0 Kudos
Message 2 of 13
(5,520 Views)

Thanks for the reply Sam,

No i've changed nothing to the VI except the COM Port.  I'm running everything at default, just like i downloaded it from the LabVIEW website, other than changing the port to COM20, i ran the setup again changing the port for only the Arduino INIT and i still get the same error..  I'm getting Error 5005 in general.  I pointed out the other 500x errors, as i was getting those within the sub vi's.  For instance if i double click the Arduino INIT module and run it by itself, i would get the 5002 error.  All errors point to the connection to the Arduino being lost, yet the Arduino is connected and functions in Max/MSP & with the Arduino IDE as well.  But when running it in LabVIEW Interface for Arduino i get these errors.  When i run the Arduino thru LabVIEW using COM ports (The old way) it works, so i'm confused. 

You asked for a screenshot of the "code" do you mean the code in the LVIFA_Base.pde?  Or a screen shot of the block diagram of the Labview Interface.vi?

Thanks for your response!

Roger..

0 Kudos
Message 3 of 13
(5,520 Views)

Roger,

I meant a screen shot of the block diagram.  I would still like to see the screen shot, but if you did not modify the example at all it should work.

The individual VIs will not work by themselves.  This is expect.  The Initi VI initializes a connection with the Arduino and passes connection information to the other VIs.  Without this information the other VIs cannot run.  In addition the Init VI does some configuration on the Arduino to make sure it is synchronized with LabVIEW and ready to send / receive data.

Which Arduino board are you using?  If you are using an Uno connected via USB you should be able to load the firmware on the board and then open an example and just click run (with no modifications to the VI).  The Init VI will automatically detect the Arduino and connect to it.

Please let us know if this helps.  If not a screenshot of the block diagram will help determine what is going wrong.

-Sam

LIFA Developer

0 Kudos
Message 4 of 13
(5,520 Views)

Here are screenshots of the main VI and the Arduino INIT VI. 

http://i1179.photobucket.com/albums/x395/nerdyranks808/Roger-LabVIEW-Interface-Arduino.jpg>

http://i1179.photobucket.com/albums/x395/nerdyranks808/Rogers-Arduino-INIT-VI-Block-Dia.jpg>

I'm using the Arduino Duemilanove, maybe that is the issue?  I assumed the Uno and Duemilanove basically the same.

Thanks again,

Roger

0 Kudos
Message 5 of 13
(5,520 Views)

Roger,

  Here is what that error means: http://digital.ni.com/public.nsf/allkb/3DFDB07DC04B036686257885005981E1

It might point to the Arduino not being connected, it might be the drivers not being installed. I would recommend ensuring each step of the Getting Started guide was taken. Also, check out the new video VIShots put out covering the getting started process:

http://vishots.com/getting-started-with-the-labview-interface-for-arduino/

Hope this helps!,

-Ben

Ben J.
National Instruments
Applications Engineer
Message 6 of 13
(5,520 Views)

Thanks Ben,

Its strange because i'm getting that error 5005 yett my Arduino is definitely connected and working, it shows up in all software except with the LabVIEW for Arduino interface.  If i load my Arduino with a "sketch" sending data from the Photocell out of the Serial Port, that data shows up in LabVIEW like it always has from COM20, so i'm sure the Arduino/drivers are working properly.

When i load the LVIFA_Base.pde onto the Arduino, it says "uploading" then about 5 seconds later it says "upload completed" so i'm sure the firmware is getting installed on the Arduino.

   If i'm running the Arduino in Max/MSP (to make sure the Arduino is functioning), then close the program and load up LabView and load LabVIEW interface for Arduino and set The Arduino INIT.vi  to COM20 and run it i get the Error 5005, but if you look in Windows Device Manager under COM Ports, there i see my Arduino listed as COM20 and working properly.

The video is excellent, thanks for the link.   I'm gonna keep banging away at this, i'm excited to get this working

Message 7 of 13
(5,520 Views)

Ok guys, i had some success getting it to work. 

To set the COM port, i was double clicking on the ArduinoINIT and selecting COM20 from the drop down menu in the top left corner of that window. So i had no Constants plugged into the Arduino INIT to tell it what to do..

So to fix this i created a String Constant of "COM20" and wired that to the Arduino INIt and created a Numeric Constant of 115220 and wired that to the ArduinoINIT as well, and viola i now see data coming in as it should be..

http://i1179.photobucket.com/albums/x395/nerdyranks808/Rogers-Fix.jpg

Thanks for your fast responses i really appreciate it. 

Roger.

Message 8 of 13
(5,520 Views)

Roger,

Instead of wiring a string into the VISA Resource input you should use a VISA Resource constant.  You can right click on the VISA Resource terminal on the top left of the Init VI and choose Create>>Constant.  This will create a VISA Resource constant that allows you to select the appropriate COM port from a drop down menu.

The default baud rate on the Sketch is 115200.  This is the default value used by the Init VI and does not need to be wired into the init VI for it to work (although wiring it in will not hurt anything).  If you changed this default value in the init VI you will need to explicitly wire in the correct value.

115220 is close enough for the communication to the arduino to work, but to avoid random data loss I would change it to 115200.

Other than that I'm glad to hear that you were able to get everything working.  Let us know if you have any more questions.

-Sam

LIFA Developer

0 Kudos
Message 9 of 13
(5,520 Views)

Cool i'll wire it with a VISA Resource constant.  I checked the baud rate again and it was set to 115200, it was just a typo on my part   Thanks again to the team responsible for the Interface, its awesome!

0 Kudos
Message 10 of 13
(5,520 Views)