LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Help required to setup Arduino interface with Labview

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. 

0 Kudos
Message 1 of 6
(8,369 Views)

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.

Kevin Fort
Principal Software Engineer
NI
Message 2 of 6
(3,336 Views)

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();

  }

}

0 Kudos
Message 3 of 6
(3,336 Views)

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

Kevin Fort
Principal Software Engineer
NI
Message 4 of 6
(3,336 Views)

That helps a lot!

Thanks for your kind reply.

0 Kudos
Message 5 of 6
(3,336 Views)

Chocka, can u please post the complete codes of yours here?

0 Kudos
Message 6 of 6
(3,336 Views)