LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph cursor won't snap to plot when dragged

Solved!
Go to solution

I haven't used XY graphs much and have a need to have several plots on the graph and be able to find the value at points on the plot using cursors.  Everything works fine except that I can't drag the cursor along the plot.  Even though Snap to is on and drag is enabled when I drag the cursor it does not snap to the plot.  When I then use the cursor navigation keys the cursor snaps to the last point point it was on before the drag instead of snapping to the plot during the drag.  I want the user to be able to drag the cursor and have it snap to the plot it is attached to.  Any help would be appreciated.

 

I've attached a simple example VI.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 1 of 7
(3,585 Views)
Solution
Accepted by topic author kbbersch

You are using an undocumented data structure for the multiplot. (one x,  two y, e.g. as seen here).

 

Each plot needs it's own x!

 

If you do the following, things work just fine. (same if you use bundle, of course)

 

 

... and please add a wait to that while loop. It is actually not even needed. Cursors lock even back in edit mode, of course.

 

Message 2 of 7
(3,566 Views)

It's so obvious once somebody points out the mistake!  Thanks.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 3 of 7
(3,556 Views)

Assuming that the original VI used something like the 'This works' data type from the idea exchange link (I do not have LV13 in front of me to look) then I am confused.  Either the graph takes it and it should work with the cursors or the graph should reject it.  It seems to be stuck in the middle which smells like a bug to me.  Break the wire or fix the cursor.  (I hope for the latter, I like being able to throw the kitchen sink into graphs).

0 Kudos
Message 4 of 7
(3,529 Views)

Yes, data was an array of clusters, each cluster containing three elements*.

 

I agree that it is a bug. That odd "this works" should be maybe be renamed to "this works, sort of....". I probably wouldn't use it. 😉

 

*This particular data structure for xy graphs is not documented here! So use at your own risk 😉

0 Kudos
Message 5 of 7
(3,516 Views)

I have also found that if you have a plot that contains only NaN values, the single plot cursor breaks completely and will no longer snap to plots on the graph, but roams around free.

 

The case for this is if you are measuring a sensor, the sensor breaks and then returns all NaNs for measurement, you now have a NaN array.

 

Example code is attached

0 Kudos
Message 6 of 7
(3,271 Views)

The issues I described above is submitted to NI as CAR 535039

0 Kudos
Message 7 of 7
(3,192 Views)