LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Searching data points in a cluster

Solved!
Go to solution

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 🙂

0 Kudos
Message 1 of 12
(3,307 Views)

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

0 Kudos
Message 2 of 12
(3,303 Views)

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.

 

0 Kudos
Message 3 of 12
(3,296 Views)

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

0 Kudos
Message 4 of 12
(3,292 Views)

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.

 

 

 

0 Kudos
Message 5 of 12
(3,284 Views)

for example like this....

 

0 Kudos
Message 6 of 12
(3,277 Views)

Why doesnt this work ?

0 Kudos
Message 7 of 12
(3,270 Views)

Also, where is the part where I can search for sensor data giving X,Y as inputs ?

0 Kudos
Message 8 of 12
(3,243 Views)
Sorry, posting by phone. Cannot see your VI. Make sure the cursor is locked to a plot (obviously does not work with free cursors). As I said, if your sensor data is arranged as your points, there is no need for "searching".
0 Kudos
Message 9 of 12
(3,232 Views)

@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.

 

 

0 Kudos
Message 10 of 12
(3,215 Views)