06-04-2010 07:54 PM
Did you install NI-VISA? I don't see it in the list under software.
Put your NI Device Driver CD/DVD back in and run it again. Once you do that, you should see Serial and Parallel Devices under the Interfaces.
06-05-2010 01:29 PM
06-05-2010 02:03 PM
06-05-2010 02:33 PM
tastypotato wrote:
I don't have that as an option when I pop in the NI Labview DVD. 😞
I said the Device Driver DVD, not the LabVIEW DVD.
08-25-2010 06:15 PM
After all this time we have kind of given up on trying to get the Xbee to plug directly into the laptop. Now my team and I are going to put a DAQ between the XBee that goes into the computer running labview. I've included a pretty rudimentary drawing here to help people visualize it.
Okay, so here's the new problem that we have, and I'm hoping someone will be able to help me here. Data is going to be transmitted through the XBee's, right? So the transmitting issue is not the issue here as I'm sure our coder will be able to figure this out. But the problem we're having is how are we going to parse the information that the XBee is sending and have the DAQ figure out what is coming in and to split the three signals back up and display them via a graph? I don't really need a direct answer, any pointers to tutorials will help.
08-25-2010 07:47 PM
I have no idea how you are going to get a DAQ card to figure out what the Zigbee is telling it.
The DAQ card is an analog acquisition device. It takes analog signals (such as voltages) and converts them to digital for the computer to understand. The Zigbee is putting out a serial communication protocol.
It also has digital inputs for determining whether a signal is on or off (high or low, true or false).
In theory, you could have the DAQ card acquire the entire waveform the serial device (Zigbee) is putting out, and use LabVIEW to analyze the waveform and figure out what the bit pattern is. Then convert that to bytes and data and so on. It could also be done with a digital input channel. But that is a ridiculous amount of work and the timing of the signal is critical. The USB-6008 is a low cost DAQ device, and I really don't think it will have the timing requirements to meet your needs. And even if you do have a DAQ device that can handle the requirements, you still need to do a ridiculous amount of work to get it to work, and I'd doubt you'd ever have the reliabililty you need.
I think you need to go back to the drawing board and get the Zigbee to work directly with the PC. It's been a couple months, and you say you've done a lot, but you really haven't indicated what else you've done and how it didn't work. Did you ever get NI-VISA installed?
How would the Zigbee work and be connected to the laptop if LabVIEW wasn't involved at all? Do they have some software package that works with it?
If there is a way to get any software to work with the zigbee on your laptop, then there is certainly a way to get it to work with LabVIEW.
08-25-2010 08:05 PM
Okay, thanks for that realization.
Most of the things we've done in the past 2 months have been related to hardware, figuring we would have been able to figure it out if we came back to it a little later.
The Zigbee does come with some simple software and we were able to get two Zigbees to talk to each other while they were both plugged into separate computers ( http://www.digi.com/support/kbase/kbaseresultdetl.jsp?kb=125 ). Using that program we were actually able to send data from one Zigbee to a machine running a LabView VI that I found online (Attached) which was very promising. As of right now though we still don't have the software done on the microcontroller that is converting the analog signal to digital to pump through the Zigbees to the computer running LabView.
So in short, I suppose the Zigbee is working, it's just a matter of trying to split those three waveforms that are going to be coming in as one packet.
08-25-2010 08:51 PM
I've used that X-CTU software before with a radio modem set I purchased years ago. It was part of the initial tryout for one of my first LabVIEW projects. My office was upstairs and through a windows from our R&D lab. I wanted to talk to a motor controller serially, but it was too far to run RS-232, and really no convenient way to run a wire. So used the radio modem as my link. It was actually set for RS-485 on the motor end and RS-232 on my PC end. It worked well. I could issue a command on my PC, pop my head up and see if the motor was turning when I looked through the window.
So now you really don't have a LabVIEW/Zigbee problem any more. It sounds like that is solved. Now your issue is creating your own communication protocol to transmit waveform data.
How many samples of data are in each of the 3 waveforms? How often do you need to transmit?
I would look at the TCP/IP examples in LabVIEW for how to transmit the data. Not because you are going to be using TCP/IP, but because it has some principles on how to transmit binary data reliably.
I would send a few preample bytes with each package of data to tell how many bytes to expect to receive in a package. Two bytes should be enough. I really don't think you want to send more than 4096 bytes at a time (all dependent on how big your serial buffers might be). Maybe one byte to tell what waveform you are sending. Maybe one more byte to tell which part of the waveform you are sending (1 for the first part, 2 for the next part, 3 ....) in the event a waveform is so long that you needs to be spread acrosss multiple packages. Then you can send the waveform data in a binary format. It might be 2 bytes or 4 bytes for each piece of data depending on the datatype. You may want to include a byte to tell whether or how many more packets of waveform data follow. In the end, you may want to use one or two checksum bytes calculated from all the previous data to determine if the data was received intact.
When you want to receive the data. Use a VISA read to read 2 bytes. These two will tell you how many more bytes to read in the next VISA read command. Then read that much more. The next byte tells the waveform, the next would be the sequential number to know that it is the next one to append to the previous packet of the same waveform. Then the raw binary data that you can typecast back to numeric data. Then the checksum bytes you can use to verify the data came through correctly.
The only other thing left to do is have a means of the PC to tell the microcontroller when to send the next packet of data, or when to send the next waveform. You may want to create some command bytes for this for the different possible commands.
One other thing you may want to do for future exandability is to add an address byte to the commands and the responses so that if you expand beyond a pair of zigbees, each device will know whether the command is intended for it or some other device. Add it to your protocol now if you think you may ever need it later.
Actually, a good reference might be for you to look at the modbus protocol http://www.modbus.org/tech.php. Pretty much all of the features you will need will already be incorporated there. In addition, LabVIEW already has a modbus library you can download and use. It is geared around a register/address scheme for most of the "public" command codes. But they also have "private" command codes that you can use for whatever purpose you may need. The modifications to the modbus library would be minimal for your application. And the benefit is that if you ever need to communicate with other devices that are using a modbus protocol, you can piggyback the communications on the same backbone.
09-01-2010 05:39 PM
Thanks for your reply.
Looks like I have some serious reading up to do as I don't really know much of anything about micro-controller programming.
So I guess the list of to do is as follows:
Build a VI that will use VISA to bring in data from the Zigbee and then split it back up and have it display on three different graphs.
Get the micro-controller code actually working so my team can stop working with theoretical data and start getting some actual errors.
Plan party for completion of project and graduation. 😛
As for your answers to how many samples are going to be in each of the waveforms, we don't really know yet. I was hoping that we would be able to get ~25 or so samples per second so we'd have a total of about 75 samples per second running through the Zigbee. Since we're using a 9600 baud Zigbee I don't really know if that's going to be too much or too little to be honest. It's something that my team and I are going to have to look in to.
I've attached what we have so far as draft2.vi. The problem with this vi right now is there's no Zigbee currently working so I've just kind of put in some simple simulations of waveforms to make up for the lack of anything coming in. I've also attached 1.vi which is what we used with x-ctu to talk to labview. Is there a simple or easy way to get 1.vi into our draft2.vi and have it decode what's coming in so we can play around with waveforms that are being sent over (Once it's actually working...)
09-11-2010 03:10 PM
Coder still isn't done with the software for the microcontroller so I've gone ahead and done what I can do to the best of my ability in LabView but I've hit another snag.
Here's the problem that we're going to be having. We don't know how to convert the string that is going to be coming off of the VISA Read into a data type that we will be able to fit into the waveform graphs.
Ideally, we're looking for a numerical value of the amplitude of the signal one at a time. Check the attached .png for a visual of what I'm trying to describe (I'm a biomed, not an English major. 🙂 )