From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Xbee API communication

Hello all,

 

So I'm having some issues reading data from an Xbee in Labview. I have two xbees connected to arduinos that are communicating to a single xbee connected to my laptop, I'm using API mode on the xbees and attempting to read and separate the data for each xbee.

 

Reading some past posts I've picked up a nice VI to parse the data by searching for the start delimiter of each packet, using this I've been able to read and separate the data by just checking the address of each (the case structure, BD97 and C220 are just the addresses of my xbees). This worked as far as reading the data went, but running it I've gotten some data corruption somewhere (there will be random spikes that shouldn't be there). 

 

After I ran into this error I added the little checksum check to try and get rid of the bad data, but this led to no data being passed through (checksums are wrong in each packet). I've gone through and actually added up the checksum of some of the packets by hand and they are wrong in my VI. I did the same with each packet in the xbee XCTU software and all the checksums added up correctly so it's not an issue with the xbees.

 

Anyone got any ideas where I might be going wrong here??? I attached the two VI's I've been using (ignore the randomness of it I've been doing a lot of tinkering).

 

and the original thread I was looking off of is here: http://forums.ni.com/t5/LabVIEW/example-code-for-xbee-zigbee-in-API-mode/td-p/1297882

 

Any help is appreciated!

Download All
0 Kudos
Message 1 of 2
(3,153 Views)

Hi dmartin2011,

 

What protocol are you using? 232? 485?  Also, how are they connected to the laptop?

 

In the event that the parser is taking too long, you could consider a producer/consumer design pattern where the producer loop does the VISA read and the consumer loop does the parsing and checksum?

 

Can you explain what you mean by random spikes?  You could also place an indicator on the raw data output from the VISA read and make sure that data is what you expect and that your controls for baud and flow, etc. are set correctly. 

Michael Keane
National Instruments
0 Kudos
Message 2 of 2
(3,087 Views)