LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LIFA - ARDUINO FIO

Hello every one ,

I'm new on this community and I don't speak English well, so apoligizes in advance for my mistakes.

I'm using Arduino and Labview working together to develop a project. Is the final project of my degree, Electronics engineering.

The fact is, I'm able to connect successfuly some Arduino boards (ATMega328) with LIFA (May 2011) with LabView 2010 (Vista 32bits). However, it does not work for Aduino Fio.

I run AnalagRead (from examples) and it shows me 5002 error. I went trhough subVIs and I think Send-Recived.vi is which starts reporting errors (with 5003).

I read most of post which are writen about this error, and i tried many. I matched baud rates, time outs...

The reason  to use Arduino Fio is the Xbee module. I would like to set up a Sensor Network (Arduinos )and monitorize it with LV.
I have no problems either with Arduino Duemilanove nor MC-NOVE, so what about FIO?
Could anyone kindly help me???
thank you for your consideration of this matter .
0 Kudos
Message 1 of 9
(9,480 Views)

Glo,

Do you have the XBee module in the slot? Are you connected through USB?

I have found issues connecting through USB when anything else is connected to the TX and RX lines (which the XBee does). Try taking out the XBee module while using USB.

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 9
(4,234 Views)

BenJ,

Thanks for your answer. I already know this thing. Actually, you can not programming over the Arduino if the XBee is connected. In most arduinos you must remove the microcontroller from the board to configure the XBee, and flash the microcontroller without de XBee module.

But, in Arduino Fio there are some differences. You can not remove de micro, there are other ways to programming to it. If you need some help, just let me know.

What i'm not able to get, is to connect LIFA whith Arduino Fio board (with no XBee by the moment). PC (Labview + Lifa) + USB+ Arduino Fio (FDTI mini adapter). It reports 5002 error.

Thanks!!

0 Kudos
Message 3 of 9
(4,234 Views)

Glo,

  Also make sure to check out http://digital.ni.com/public.nsf/allkb/15AE7F234C5B966886257884006DF1CD

Let me know if none of those steps help out.

-Ben

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 9
(4,234 Views)

Ben,

Very intesting link, I read trhough it , and I've tried all the issues, but it still does not work .

The firmware includes the pins the configuration (for other board )so I have made some changes to match that with Arduino Fio Board's pins distribution. This is the thing on which I'm working right now. I can not think in more options to check, or change.

.

Thanks again

0 Kudos
Message 5 of 9
(4,234 Views)

Glo,

I've never used an Arduino FIO so the toolkit may not work with this board type.  The toolkit is only intended for use with the Uno and MEGA2560.  That being said it should work with any board that it fits on and has a working serial port.  Do you get any erorrs or warnings when you upload the firmware to the board?   Are you using the default firmware or have you made modifications to the LIFA Sketch?  Do you have any other hardware attached to the arduino? 

As I was writing this I found this in the board documentation

"The on board mini-USB connector is only used for charging and does not allow for serial communication."  You will need to use something like the FTDI Basic or FTDI cable to talk to the board VIA usb.

Let me know if this helps.

-Sam K

LIFA Developer

0 Kudos
Message 6 of 9
(4,234 Views)

Sam,

Thank you very much for your answer.

The Arduino FIO has a mini-USB connector for charging. But, you can program to the FIO board using a USB to serial adapterI (FDTI). http://www.sparkfun.com/products/8772. This is an option, but not the only one.

I used LIFA successfuly with some Arduino boards, which are not UNO or MEGA 2556.

I don't get any errors or warnings when I upload the firmware to the FIO board. Actually, I upload other sketches (Analog_Read and others ) to the FIO board, using external hardware, as LEDs and sensors and it works.

However, when I upload LIFA's firmware, I don't have any hardware attached to the Arduino, and It just says done.

I tried with the default LIFA.pde. And I also tried modifing LIFA sketch. I added the Arduino FIO board's pins declaration. This board has a different number of pins (e.g It has 7 analog input instead of 5.

But, It uses the same microcontroler (ATMEGA328) as Duemilanove board does. And LIFA works on Duemilanove.

What can I do??

Maybe I have to go through LIFA deeper  to find differences between boards??

I want to use FIO board because I need to use XBEE modules, and I think is the cheapest option .

Again, thank you very much. Almost I can share this with others .

0 Kudos
Message 7 of 9
(4,234 Views)

Glo,

LIFA should work with most if not all Arduino compatible boards.  We only officially support the MEGA2560 and UNO because thats what I used to develop and test the toolkit.

You will only need to add a custom pin configuration to add functionality for additional pins.  For example if you are using a MEGA and tell LIFA you are using an UNO everything will work fine but you will only have access to the pins that are available on the UNO.

I ask about attached hardware because you will need to leave the RX and TX pins open for communication with LV.  Typically these are D0 and D1, so make sure you never attach anything to these pins other than ther serial data lines.

You can use a program like portmon to look at the serial data being sent between LV and the Arduino to see if the packets look right.  This might give you some insight into what is giong on.

Let us know what you find or if you have any questions for us.

-Sam K

LIFA Developer

0 Kudos
Message 8 of 9
(4,234 Views)

Sam,

Sorry it took me so long to reply you!

I understand what you explain. Very important what you say about attached hardware to RX and TX pins.

Unfortunately, Labview evaluation version I had is not longer avaiable. I'm looking for a permanent version. So I have to wait to probe new ideas.

On the other hand , I have made some changes at LIFA_Base for FIO pin configuration. I'm not sure about what I did. In FIO, digital I/O are from D2 to D13 so, do I have to guess TX and RX are D1 and D0?

FIO's data sheet says it has 14 digital I/0, so I miss two of them?

But, are TX and RX digital pins?

Shouldn't RX be analog?

I add here  LIFA.pde (with my changes) and FIO information link, maybe it helps you to understand what I did.

Finally, I haver never work with the program you say, but I will. Wish it helps.

// Writes Values To Digital Port (DIO 0-13).  Pins Must Be Configured As Outputs Before Being Written To
void writeDigitalPort(unsigned char command[])
{
  digitalWrite(13, (( command[2] >> 5) & 0x01) );
  digitalWrite(12, (( command[2] >> 4) & 0x01) );
  digitalWrite(11, (( command[2] >> 3) & 0x01) );
  digitalWrite(10, (( command[2] >> 2) & 0x01) );
  digitalWrite(9, (( command[2] >> 1) & 0x01) );
  digitalWrite(8, (command[2] & 0x01) );
  digitalWrite(7, (( command[3] >> 7) & 0x01) );
  digitalWrite(6, (( command[3] >> 6) & 0x01) );
  digitalWrite(5, (( command[3] >> 5) & 0x01) );
  digitalWrite(4, (( command[3] >> 4) & 0x01) );
  digitalWrite(3, (( command[3] >> 3) & 0x01) );
  digitalWrite(2, (( command[3] >> 2) & 0x01) );
  digitalWrite(1, (( command[3] >> 1) & 0x01) );
  digitalWrite(0, (( command[3] ) & 0x01) );
}

// Reads all 6 analog input ports, builds 8 byte packet, send via RS232.
void analogReadPort()
{
    // Read Each Analog Pin
    int pin0 = analogRead(0);
    int pin1 = analogRead(1);
    int pin2 = analogRead(2);
    int pin3 = analogRead(3);
    int pin4 = analogRead(4);
    int pin5 = analogRead(5);
    int pin6 = analogRead(6);
    int pin7 = analogRead(7);

And here you can see how FIO looks like: http://www.arduino.cc/en/Main/ArduinoBoardFio.

Thank you very very much, for your patience and for your help.

Glory,

Baby engineer.

0 Kudos
Message 9 of 9
(4,234 Views)