LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arduino toolkit

Having trouble connecting the ( even running ) the example to read serial data from the arduino toolkit.

It seems that my program cannot see or find the arduino resource. It throws up an 'Error 5002' which basically tells me that it's something with the serial port.

 

So to check I wrote a simple 'Read Serial' after 'Configure Serial' on the same COM port that I mentioned in the above example & am able to display a buffer string ( without the arduino toolkit ).

 

What could be the reason? In the example below, I only included the VISA serial read part since I was getting th error. I would obviously not use them concurrently.

 

Attached some screen shots.

arduino interface.jpg

0 Kudos
Message 1 of 7
(7,265 Views)

Hi vaishakh.chava,

 

You're completely correct in saying that LabVIEW is unable to establish a connection to the Arduino microcontroller. There are quite a few reasons as to why this can occur, so it's important to make sure of the following:

 


  1. Make sure that the correct firmware is flashed to the Arduino. This will configure the microcontroller to understand the communication protocol implemented by the LabVIEW VISA drivers to control the peripheral interface ports.  The correct firmware can be found in<LabVIEW>\vi.lib\LabVIEW Interface for Arduino\Firmware\LVIFA_Base 
     
  2. Make sure you have selected the correct COM port for the Init.vi or that the VI automatically locates the Arduino (this happens when no wire is connected to the VISA Resource input of theIniti.viand only works for Arduinos that areconnected to the PC via USB); otherwise the wrong USB port be communicating with.

  3. If using an Arduino connected via USB make sure that the Arduino is listed as under Ports in Windows device manager.  If it is not listed you may need to install the Arduino drivers. If the device is not recognised by your Operating System, it will not be associated with your computer due to missing driver calls; this means your Operating System would be missing the means by which to communicate with the device on the most basic level.

  4. If using a wireless connection (Xbee, BlueSMIRF) to LabVIEW try using a wired connection (USB , Serial).  Poor wireless signal strength can cause the Arduino to be unreachable by LabVIEW.

  5. Make sure that the baud rate specified as an input to Init.VImatches the baud rate specified in the firmware by the DEFAULTBOARDRATE definition at the beginning of the code. If the wrong board rate is specified, the communication between the devices will always be out of sync and will data will not be correctly 'understood' between VISA and the Arduino.
    #define DEFAULTBAUDRATE X (where X is the baud rate).

 

Please let me know how you get on with these steps!


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

Message 2 of 7
(6,953 Views)

When downloading the included firmware to aduino all I get is:

 

LVIFA_Base.cpp:24:31: error: LabVIEWInterface.h: No such file or directory
LVIFA_Base.cpp: In function 'void setup()':
LVIFA_Base:36: error: 'syncLV' was not declared in this scope
LVIFA_Base.cpp: In function 'void loop()':
LVIFA_Base:55: error: 'checkForCommand' was not declared in this scope

 

What should I do to fix this?

0 Kudos
Message 3 of 7
(6,815 Views)

Wow. that's a lot of information. Permit me some time to get back to you. It's just that I have installed all those files, see the various tabs that are supposed to create the 'enviornment' for download & communication but this will not download to the micro. Normal arduino programs are transfering just fine so it cannot be serial protocol configuration issues is what I am thinking.

Would want to really get this onto the chip as I see the world of possibilites.

Thanks

0 Kudos
Message 4 of 7
(6,807 Views)

Here is the screenshot on the arduino side. It does not even compile. the program compiles in a regular arduino sketch. With those tabs the LVFIA base there seems to be some error.

Help!

0 Kudos
Message 5 of 7
(6,805 Views)

complie error

 

This is the error. Sorry about that. did not upload in the last post

0 Kudos
Message 6 of 7
(6,803 Views)

It appears to me that the referenced header files (and therefore the functions contained) aren't within the scope of compilation. The included files will need to be within either the default header files folder or within the same directory hierarchy of your Main method for them to be found. 

 

It does not even compile. the program compiles in a regular arduino sketch

Can you please clarify for me what you mean by this? Where isn't it successfully compiling?

 

Thanks,


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 7 of 7
(6,791 Views)