Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

reading xbee data

Hi guys

 

I just developed an vi to receive data received from an xbee RF module and it can pick up the data I want to receive and the source address, also I can display the content from different sources on different indicators. I enabled the receiver's API mode. If I can reveive "hello" from a remote(address 5351) xbee, the data I got will look like 7E 00 0A 81 53 51 24 00 68 65 6C 6C 6F A2 in hex. But now I received just "7E A2" or "7E 00", or other incomplete string of data. The vi worked before, but somehow it did not any more. 

 

Can anyone help me?

 

Thanks a lot!!

0 Kudos
Message 1 of 11
(3,924 Views)

Better put the "configure serial port outside the while,just as the close. And in the while wait a few ms before reading the number of bytes.

Th rest seems OK.

greetings from the Netherlands
0 Kudos
Message 2 of 11
(3,923 Views)

Thanks for your help first!

 

I just did what you suggested, but it wouldn't help.

 

Some other problems I encountered are sometimes I couldn't get the data in a proper order or what's even worse was sometimes the indicator could not display any data I have received.

0 Kudos
Message 3 of 11
(3,921 Views)

Albert

 

Your help is really helpful. Now I can get all the data that I received. But the problem is the bytes are not in order which is quite disturbing.

0 Kudos
Message 4 of 11
(3,919 Views)

Indeed

I overlooked the concatenation order. Swap the inputs of the concatenate string, and your order will be ok.

greetings from the Netherlands
0 Kudos
Message 5 of 11
(3,917 Views)

Actually the disorder of bytes has nothing to do with the concatenation function.

I am supposed to get the data via "raw data" but what I have is in disorder. That' s the problem

0 Kudos
Message 6 of 11
(3,916 Views)

Sorry I have misunderstood you 

you are right

I think the problem is fixed!

Thank you !

0 Kudos
Message 7 of 11
(3,915 Views)

I wonder why I have to swap to input of concatenate strings. Because the my other functions are always focus on the first element of the output of concatenate strings. If swap the inputs, the whole vi seems to be kind of meaningless.

0 Kudos
Message 8 of 11
(3,910 Views)

You are adding to the beginning of the string or to the end of the existing string.

Your first situation added the newest characters at the beginning while they came later.

Now you are adding to the end of the original string because the characters are rreceived later.

greetings from the Netherlands
0 Kudos
Message 9 of 11
(3,908 Views)

Thanks Albert

But I still wonder if I can add the new string to the beginning at the existing string

0 Kudos
Message 10 of 11
(3,900 Views)