04-14-2016 07:42 AM
Hey Guys,
So I'm currently working on a project that involves an external device with sensors, transmitting the data via XBee modules. This is received by an XBee module attached to a USB breakout board which maps directly to the comms port (see here). I've got basic experience with LabVIEW, but not sure how to go about this. I'm aware VISA is the package to deal with serial communications, but htat's about as far as I've got.
I've seen quite a bit online for XBee & LabVIEW, but pretty much everything I've found makes use of an Arduino (which isn't the goal here). Are there any definitive guides, or even better libraries / example programs, to kick me off with this one?
Thanks for any help!
04-14-2016 08:22 AM
Your Sparkfun electronic board will be seen as a COM port on your computer.
You should take a look at Serial Communication in LabVIEW Examples. You'll find a lot of ressources to read/write on your COM port.
And indeed, it'll rely on VISA functions !
07-12-2017 06:39 AM
Hi,
I have the same problem with the connection with XBee. I have also used a SparkFun XBee Explorer Dongle.I want to use the VISA to communicate with the XBee without Arduino. I can find the XBee im device manager, but LabVIEW does not recognize the XBee. Do you know why? Any idea will be appreciated.
Best regards
07-17-2017 07:59 AM
Hi!
In your device manager, do you see it as a serial port ? Also, in MAX, do you see it listed in the serial ports ?
07-18-2017 06:40 AM
Hi, thanks for your reply.
I can see the number of port in the device manager und NI MAX. But I still could not read anything from the other XBee.
I would like to post my code here. Please have a look, if there is any wrong configuration.
Best regard!
07-18-2017 10:17 AM
If COM16 is listed automatically by LabVIEW and corresponds to your Xbee device, then VISA should be able to adress it.
Are you sure of the port settings are correct ? Also, your while loop is not timed, you should try waiting at least 200ms before reading the port buffer.
I dont' know about your device, but often you have to send a request to the device before it starts publishing on the serial port.
Take at the Simple Serial example (Help -» Find Examples), it gives the minimum you need to investigate further.
07-19-2017 03:16 AM
Hi,
thanks for your replay! The COM 16 is listed automatically by LabVIEW. When I run the program, there is no error code for the Initialization of VISA, so I think the LabVIEW has builded the connection with XBee successfully.
I have configured the XBee with XCTU. After the configuration, I plugged the two XBees with two computers and could send massage via XCTU. Then I disconnected the XCTU with one XBee and ran the LabVIEW program. I tried to write massage in XCTU on one computer and received the massage with the LabVIEW program on another computer. The LabVIEW runs with no error, but could receive nothing.
I am new with XBee S6B. Sorry for some stupid questions. Do you have any example LabVIEW example program for XBee?
Best regard
07-19-2017 01:01 PM
Hi!
Xbee is not really 'the problem'. I do not know very well XBee and I do not have examples, but I do know how to communicate with a device on a serial port.
What you should look at is how the XTCU (I guess it is a software delivered with your XBee device) is communicating with your device. The LV program won't return any error if you ask to read for 0 characters (nb of bytes at port).
Usually to get data in your input buffer, you have to tell your device that you want to get data (initalize a connection, or whatever commands it may require).
07-19-2017 01:14 PM
Another thing I noticed is that S6B doesn't seem to have a RS232 port, only SPI access ? Am I wrong ?
Also S6B is not listed into the XBee devices compatible with your dongle... Are you sure they can communicate together ?
How are you communicating between the XBee S6B and XCTU ? Using the dongle or your wifi connection ?
07-20-2017 02:21 AM
Hi,
I have used a SparkFun XBee Explorer USB to connect the XBee with computer, so that the X-CTU could find the XBee. I configured the XBee S6B with X-CTU, and sent massage with X-CTU to another XBee S6B, which was connected with another computer, on which the X-CTU is also installed. Then I could read the massage in the console working mode.
Now I could read the massage in LabVIEW. I have programmed for the Arduino Board, which is connected with the receiver XBee.
Best regard