03-22-2012 12:28 AM
I recently installed Labview 2011 evaluation version to my laptop. I also downloaded arduino environment and was able to check 'Blink' example with Arduino Uno. However, I have problems interfacing Arduino with Labview. I uploaded the LVIFA_Base.pde to the Arduino Uno and tried executing the Simple_LED (https://decibel.ni.com/content/docs/DOC-20044) example. But I couldn't communicate properly with LabVIEW front panel and Arduino. It gives me error 5002 and says could find Arduino Uno. Kindly provide suggestions.
03-28-2012 08:57 AM
You probably need to specify the COM port for your arduino manually on the Init block. It could also be a mismatch of the baud rate between the firmware on the arduino and the LabVIEW code.
03-28-2012 11:03 AM
Hi Kevin, Thanks for the reply.
By the way, how could I specify the baudrate in the firmware?
Below is the firmware that I am using.
/*********************************************************************************
**
** LVFA_Firmware - Provides Basic Arduino Sketch For Interfacing With LabVIEW.
**
** Written By: Sam Kristoff - National Instruments
** Written On: November 2010
** Last Updated: Dec 2011 - Kevin Fort - National Instruments
**
** This File May Be Modified And Re-Distributed Freely. Original File Content
** Written By Sam Kristoff And Available At www.ni.com/arduino.
**
*********************************************************************************/
/*********************************************************************************
**
** Includes.
**
********************************************************************************/
// Standard includes. These should always be included.
#include <Wire.h>
#include <SPI.h>
#include <Servo.h>
#include "LabVIEWInterface.h"
/*********************************************************************************
** setup()
**
** Initialize the Arduino and setup serial communication.
**
** Input: None
** Output: None
*********************************************************************************/
void setup()
{
// Initialize Serial Port With The Default Baud Rate
syncLV();
// Place your custom setup code here
}
/*********************************************************************************
** loop()
**
** The main loop. This loop runs continuously on the Arduino. It
** receives and processes serial commands from LabVIEW.
**
** Input: None
** Output: None
*********************************************************************************/
void loop()
{
// Check for commands from LabVIEW and process them.
checkForCommand();
// Place your custom loop code here (this may slow down communication with LabVIEW)
if(acqMode==1)
{
sampleContinously();
}
}
03-28-2012 11:04 AM
The baud rate is set in LIFA header file. There should be a line that sets the default baud rate. It will set different rates based on whether you have an Uno or a Mega
03-28-2012 11:17 AM
That helps a lot!
Thanks for your kind reply.
06-17-2014 03:03 AM
Chocka, can u please post the complete codes of yours here?