LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing Zigbee with Labview VIA RS232

Hello all! I have a question that might be pretty simple. I am currently a student and am just getting into LabView for a senior project that I have to do with a team. We've run into a bit of a problem though. We can't get the Zigbee that is plugged into the RS232 board to be seen by MAX, and since we can't get it to show up in MAX I have a feeling we're not going to be able to get it into the VI. 😞

 

Does anyone know how to get the information that's coming in via the Zigbee to be placed into a blank VI?

 

Thanks in advance! 🙂 

0 Kudos
Message 1 of 39
(10,281 Views)
You will never see the Zigbee show up in MAX. For serial devices the only thing you will ever see in MAX are the serial ports. There is no protocol for instrument identification over serial. What you should do is to first make sure you can talk to the unit without using LabVIEW. If you're on Windows the easiest tool to use is HyperTerminal. On Windows 7 you'll need to get some sort of terminal program. Lots of them out there for free. The reason for doing this is that serial terminal programs like HyperTerminals are pretty flexible and can be used to iron out hardware issues like cabling. Once you've established that you can talk to the device you can then try to use LabVIEW. The simplest way to go about this is to use the Basic Serial Write and Read example that ships with LabVIEW. You may need to use the Advanced Serial Write and Read if you need to set the termination character for VISA to use so it knows when a response from the device has finished. The Basic Serial Write and Read works by using a delay after the write and then reading whatever is on the port. The other method is to use a termination character. This tells VISA Read to stop trying to read the serial port once it sees a specific character (typically this is a linefeed). The documentation for the Zigbee will tell you what method it uses.
Message 2 of 39
(10,261 Views)

Hmm. Okay - well we used the terminal program that came off of the Zigbee website and we've plugged one of them in to a MC9S12 and got them to talk to each other without a computer. I don't actually have the Zigbees on me right now so I was hoping that maybe I could get some help as to building the VI that'll be able to take the input from the Zigbee? I know that it's going to be plugged in to COM3. I'm just having trouble figuring out how to implement it into LabView.

 

I am a beginner at LabView right now too - so if at all possible could you dumb it down?

 

Thanks again. 🙂 

0 Kudos
Message 3 of 39
(10,254 Views)

Well, you have to start by making sure you can actually get the data in the first place. Then you worry about your program. Having 2 Zigbees talk to each other is of no use to you. Like I said, there's a serial port example that ships with LabVIEW. Already written up. Start with that. Do you have the programming documentation for the Zigbee? You'll need it.

 

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

 

 

EDIT: There's a fair number of hits regarding Zigbee on the NI site. You may want to peruse some of those hits.

Message Edited by smercurio_fc on 04-30-2010 02:40 PM
0 Kudos
Message 4 of 39
(10,250 Views)

I'm sorry for taking so long to get back to you on this but my team kind of gave up on this project for a little and have come back to it only to find that we've hit the same roadblock and can't figure this out at all.

 

Let me try and explain what our project is doing so that hopefully it'll be easier for you to help me. We're going to be pulling brain waves off of a person those waves are going to be stuffed into an ATD that is built into the MC9S12 microcontroller. From there the output of the microcontroller is going to go into pin two on the Zigbee. All of this is completely devoid of a computer. Then on the laptop's side we're going to have a Zigbee plugged in to the RS232 chip and it's going to be picking this data up. I'm trying to get this data into LabView and then display the brain waves onto a waveform graph. The main issue right now is getting the digital data into LabView somehow. I mean the Zigbee is plugged in via USB (on the RS232), but I don't know what I need to use to get it into my program.

 

I've checked the resources on the Learning Center and perhaps I'm just blind but I cannot find anything on there that pertains to my question and none of the online courses I've seen have anything on VISA programming with the Zigbee module if that's actually what I need to do.

 

Furthermore, after we figure out how to get the Zigbee into LabView my team is going to have to figure out how to split the three signals that are being broadcasted to be split and sampled at different times.

 

Got a feeling my team and I might have bit off way more we can chew right about now. 😕 

0 Kudos
Message 5 of 39
(10,083 Views)
Sorry, I ran out of time to edit my message so I have to post again but I'm not actually using an RS232 on the computer side - I'm using this - don't exactly know what it's called - http://www.sparkfun.com/commerce/product_info.php?products_id=8687
0 Kudos
Message 6 of 39
(10,072 Views)
From the description and the fact that it uses the FTDI chip and driver, it does appear that when it's plugged into the pc, it would appear as a com port. This is easy to verify. When you plug it in for the first time, you will be prompted for the driver. Point it to the FTDI driver and after installation, windows device manager should show a new com port. If your micro is constantly transmitting, then you can open any terminal emulation program on the pc, set the com parameters, and see 'something'. It may not display the data correctly but at least you will know the xbee is working. Using LabVIEW, you can try either of the serial examples and just do a read.
0 Kudos
Message 7 of 39
(10,061 Views)

Alright. So here's what I'm doing so far - I've got both of the Zigbee's plugged in to my computer, they are on COM4 and COM5 and they talk to each other just fine via the X-CTU terminal.

 

I'm using a serial example from the vi attached, the drop down menu cannot find anything other than COM1 though and there's not even anything on COM1. I have a feeling it's not seeing the USB Zigbees because this is a serial example - I know that these Zigbees can talk to each other via the terminal and I've even used separate computers and had them communicate.

 

How can I change this serial example to read from USB serial ports? I have a feeling as long as I can write "*IDN?/r" to the Zigbee I should be able to pick things up that are being sent from the terminal.

 

Thanks for the patience and help. 🙂 

0 Kudos
Message 8 of 39
(10,023 Views)

There should be nothing to change. Forget about LabVIEW for a while. Windows device manager sees Com4 and Com5? Open up MAX (Measurement & Automation Explorer) and do a View>Refresh. Then expand Devices and Interfaces>Serial & Parallel. See what is listed there.

 

If they are not listed, then it's possible that the FTDI driver is not installing the xbee's as serial ports. There are actually two flavors of FTDI drivers. With one of them, you use a Call Library Function Node and not the serial functions. I have used both and there is example code on the FTDI site and I know I've posted some here.

0 Kudos
Message 9 of 39
(10,015 Views)

Checking the device manager, it looks as though the drivers are installed (Because I installed the drivers from the FTDI drivers from the website for my appropriate OS (Windows 7))

 

See attached, but it doesn't seem that MAX is picking up the XBee - Perhaps I have installed the wrong one? I installed these - http://www.ftdichip.com/Drivers/VCP.htm

 

0 Kudos
Message 10 of 39
(10,004 Views)