03-15-2014 02:14 AM
Hey guys thanks for all the help, including SammyK.
One last question,
Thanks to NI I was able to go through their tutorial's and get a GPS working now lastly I have an xbee, the model in question is a xsc s3b. I've included the following dataset as well.
After fumbling around with XCTU's interface I quickly back to labview and it's MUCH more user friendly approach.
Now after rambling my question:
I have to include a GPS unit, which is already programmed, and send it's data over the myrio into an x-bee module that is also connected to the Myrio. I will be using UART side A for the GPS and UART side B for the X-bee module. My general approach as I am trying to do is connecting the longitude and latitude and wiring them into the write visa function which will be UART side B and connected to the X-Bee. The X-Bee will then transmit the directions to the a Xbee development kit and received from XCTU, Xbee's onboard program.
But I have a couple of questions
1. Is my general approach correct? Does anyone see anything I should add?
1. How do I connected both latitude and linguine to the write VISA node?
Time is of the essence here, so any help anyone can give me quickly is much appreciated. Any help, edit of code or suggestions is very helpful.
Caleb
03-17-2014 09:51 AM
Hey Caleb,
First you'll need to make sure the Xbee is in serial passthrough mode and you'll need to know what baud rate it is set to (you'll have to match that baud rate on your VISA opensin LabIVEW).
It sounds like you're getting GPS data fine and currently have latitude and longitude as Double data types. Is that correct?
If you need to transfer doubles using UART you will, as you mentioned need to convert them to a string format. You can do this using the flatten to string primitive on one side and the unflatten from string primitive to convert the value from a string back into a double. One thing to keep in mind is that you're transferring binary data in this case, not ASCII characters. As a result you'll need to make sure you turn end Termination Characters off on the VISA open. This is because the Lat Long data could include a termination character since its binary data, not ASCII.
There are several options for including both the Lat and Long. You could send them in two separate transmissions or build some sort of packet that contains both Lat and Long. I think if you're using doubles they will always turn into 8 Byte strings when you flatten them to strings. So you could just concatenate the two strings together and then split them on the output side.
Let us know if that helps or if you have more questions.
-Sam K
Join / Follow the LabVIEW Hacker Group on google+
03-18-2014 11:09 PM
Sorry about the delay yeah the GPS is double's, so what I did is flatten them out into string like you suggested.
And I added the termination character off like you suggested.
Sorry about the long delay if you have any experience with XCTU it's a fight, if you don't what your doing, expecially if your using new xbee's not simple series 1 or 2.
And their community is not NEARLY as helpful as NI's. I'm using the cluster icon to bring together Long and Lat, and i'm using the numeric value of 101 together as a clear divider between the two in case transmission gets kinda funny. Hopefully i'm testing this tomorrow after, if you have any suggestions between then and now let me know.
Caleb
03-19-2014 10:33 AM
Hey cwatts26,
That should probably work as long as you use the same type of cluster when you unflatten from string. However the cluster really just adds complication. Instead I would use a concatenate strings prim to join the Lat and Long strings into a single string. You could add an extra terminal and put some separate text in between the LAT and LONG if you need to.
The main reason I would use the concat strings over the cluster is that it's easy to tell what your transmission looks like. The double flattens to 8 bytes, then concat simply joins the 8-byte strings for lat and long into a 16-byte string. What happens when you flatten a cluster? How many bytes does that turn into? There has to be some extra bytes to describe the cluster but the number required probably varies based on the number of elements and types in your cluster. You can defiantly get this to work with a cluster, its just more complicated and will require more testing.
Let us know if you have any more questions.
Thanks!
-Sam K
Join / Follow the LabVIEW Hacker Group on google+