LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview arduino interface using Xbee

Hey,

 

I would like to monitor room temperature remotely using Arduino which is connected to Xbee and display that temperature in LabVIEW.

 

Set up:

I have Arduino wireless proto shield (in micro mode) which has Xbee and temperature sensor (LM35) connected to it. Shield is connected to the Arduino. This Arduino+Xbee+temperature sensor is powered using USB cable connected to the PC.

 

Another Xbee is connected directly to the PC using USB shield for Xbee.

 

I have two working LabVIEW programs (Labview arduino interface and LINX) which allow me to read the analog pin of temperature and display it in LabVIEW if I am using direct USB connection rather than Xbee. (all good so far)

 

I have configured Xbees using XCTU and I was able to get the temperature reading using PuTTY serial monitor. (So, I know that Xbees  are communicating with each other). This test can be done either using LIFA_base file with my code uploaded to it or just running my Arduino code. I am able to power the Arduino+xbee+temperature sensor assembly by another computer and see the serial monitor/sensor data on my screen. (so far so good).

 

Problem: I am unable to make the Xbee work with LabVIEW. It is giving me the error 5002. I have read other forums about it and none of the solutions such as setting the same baudrate work, PC does see the arduino board and Xbee... I have seen there is a solution how to use Labview+arduino+xbee to control servo motor which I was not able to adapt for my application. 

 

Steps:

1) I upload LIFA_base to the Arduino with .h file modified like this (this is what I read on the forums to make sure to match the baudrate: 

#define DEFAULTBAUDRATE 9600 // Defines The Default Serial Baud Rate (This must match the baud rate specifid in LabVIEW)
#else
#define DEFAULTBAUDRATE 9600 // the line I have modified
#endif

2) using  VI with Arduino/Labview interface (rather than LINX) I set connection type to XBEE

3) I change COM port to the one which has only the XBEE connect to it. (since arduino+xbee+temperature sensor assembly is only used to power the board)

4) Run the same VI which was working with USB connection and get error 5002.

 

Where have I gone wrong?

 

I have attached a screenshot of the Labview programs. (they do have two analog readings that work with USB connection and Putty but I would be happy to start with temperature only with Xbee connection)

 

Arduino code is just analog pin read with scaling. When I was doing LINX I did the scaling using arduino code, doing it with arduino/labview interface I have scaled in VI program. 

 

Let me know if something is unclear 🙂

 

 

 

Download All
0 Kudos
Message 1 of 3
(948 Views)

Does the Xbee attached to the computer install a virtual com port? 

 

I ask because if Xbee is anything like Bluetooth then once the two modules are paired (Or what ever Xbee does) they should become transparent, and communication through them should be no different than through USB. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 3
(916 Views)

I believe it does not.

I get what you mean and that is what I would expect as well but it looks like it does not work like that. (Or I have made a mistake in a sequence how I connect things or something..)

 

UPDATE:

Using LINX I was able to make the communication via XBee to work without changing the VI. 

Problem:

Every time I run the test again I need to flash Arduino with makerhub firmware (LINX firmware wizard) which in application defeats the purpose of the Xbee because I still need a computer in the room with temperature sensor to run the test. Where I want it to be set up and left to do it remotely while only plugging the power on. If I could somehow have the firmware pre-uploaded all the time it would work (I think).

 

0 Kudos
Message 3 of 3
(907 Views)