04-23-2016 01:15 PM
Hello.
I am using LabVIEW 2013 for myRIO. Im facing a problem with implementing a few things with clusters.
Problem Statement : Map co-ordinates logged from a GPS onto a map and use cursor functionality to check value of different sensors on different parts of the track.
I have been able to map the logged co-ordinates onto a map in LabVIEW. I create an array of the co-ordinates, bundle them and then feed it to an XY graph. Cursor has also been implemented. I click the map and drag my mouse and it takes me to various co-ordinates.
What I cannot do is display the other senors data for those co-ordinates of X,Y.
My plan is to bundle all the sensors data into a cluster and then try and search the cluster for needed points of X,Y.
How do I search within a cluster specifying only X,Y
eg: I give X,Y and i get the value of all sensors for that pair of X,Y ?
Thanks 🙂
Solved! Go to Solution.
04-23-2016 01:27 PM
We would understand much better what you are doing if you attach your code (the VI or a ZIP file with the entire Project). It would also be a good idea to give us some idea of the expected magnitude of the problem -- for example, if you are talking about 5-10 clusters, a brute-force "test every cluster" is certainly easy to program and probably within a factor of 2-3 of the best you could do.
Bob Schor
04-23-2016 01:39 PM
XY graphs take a rich variety of data types so you have a choice to pick the best representation for the problem. (complex array, array of points, cluster of x and y arrays, etc)
I am assuming you currently have an array of xy clusters ("points") and not some fancy more complicated clusters. Is the data quantized to a grid or does it have near infinite resolution? Do you want the closest sensors (e.g. sorted by distance from the clicked coordinates) or only the exact locations?
Yes, please show us some simplified code with simulated data.
04-23-2016 01:45 PM
Okay, as of now what I am doing is creating two random arrays of X and Y co-ordinates to plot on the map and creating 2 more arrays of random numbers to represent sensor data. All this has been combined into a cluster. Now what I want to do is input X,Y and find the data value of the other sensors for that pair of X,Y. Basically I want the data of all sensors at that co-ordinate of the map.
Attached is a very rough VI I am working with
04-23-2016 01:52 PM - edited 04-23-2016 01:54 PM
Use the "cursor index" property and index into the array of point of the xy graph. (I would even use a complex 1D array instead)
Similarly, if the sensor data is also in an array withe the same number of points and arranged the same way, index into those to to get the seonr data.
04-23-2016 01:57 PM - edited 04-23-2016 01:57 PM
04-23-2016 02:17 PM
Why doesnt this work ?
04-23-2016 02:54 PM
Also, where is the part where I can search for sensor data giving X,Y as inputs ?
04-23-2016 04:15 PM
04-24-2016 01:33 AM
@deepen_solanki wrote:Why doesnt this work ?
OK, looking at you code...
I don't expect it to work, because none of it makes much sense.
Try something along my earlier suggestion. Here's a very rough draft.