LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with xbee, arduino and labview

Hello to everyone

Im trying to communicate two xbee boards with arduino and labview. the two xbee modules are set to work with the same baud rate (9600).

The first xbee module is conected to my laptop by a usb-xbee board and the other one is conected with arduino uno board by the wireless proto shield with its xbee module.

Im trying to read an analog value from a potenciometer, but when I run the program with labview, I see the leds blinking of the two boards, but labview show me an error with the conection.

Im using labview 2013, and I have a question, I saw in other post about some problems with xbee and labview using LIFA, they say that the file labviewinterface.h have to be modified in the baud rate,

so my question is, do I have to modify the baud rate in the file labviewinterface.h if Im using labview 2013?

I will let you guys some pictures about the modules and an screen picture about the error.

I hope you can help me

0 Kudos
Message 1 of 5
(4,389 Views)

You have to modify the baud rate in both the firmware (the .h file) and in LabVIEW (by wiring the appropriate value to Init.vi).  This is not dependent on LabVIEW version (meaning it doesn't matter what version of LabVIEW you are using).

0 Kudos
Message 2 of 5
(3,668 Views)

hello , Thanks for the answer.

Can you tell me what I need to modify? Im not sure how to doit.

this is the code from the Labviewinterface.h

#define DEFAULTBAUDRATE 9600// Defines The Default Serial Baud Rate (This must match the baud rate specifid in LabVIEW)

#else                                                     <------- Do  I delete this line?

#define DEFAULTBAUDRATE 115200       <------- Do  I delete this line?

#endif                                                     <------- Do  I delete this line?

when you say, that I need to wire the appropiate value, is in this part right?  ?

init VI xbee.jpg

I hope you can help me, I still having the same problem, and I dont know why

0 Kudos
Message 3 of 5
(3,669 Views)

If you are using an Arduino Uno, you need to change the second DEFAULTBAUDRATE definition to 9600:

I.e.

Change:

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#define DEFAULTBAUDRATE 9600    // Defines The Default Serial Baud Rate (This must match the baud rate specifid in LabVIEW)
#else
#define DEFAULTBAUDRATE 115200
#endif


to:

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#define DEFAULTBAUDRATE 9600    // Defines The Default Serial Baud Rate (This must match the baud rate specifid in LabVIEW)
#else
#define DEFAULTBAUDRATE 9600
#endif

The first one is for the Arduino Mega and the second one is for everything else (including the Arduino Uno)

0 Kudos
Message 4 of 5
(3,669 Views)

Hello, thans for the answer

I modified the LAbviewinterface.h file with the baudrates, But Im still having the same problem

Baudrate.jpg

I tested the two xbee modules without the labview and they work perfectly. I dont know why I have the problem to communicate with labview

do you have any ideas?

I will leave you my vi file, I hope you can check it . Im using arduino uno.

I hope you can help me.

0 Kudos
Message 5 of 5
(3,669 Views)