From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

restrict the movement of cursors on xy graph

hello.

I have an XY graph, with values of 0-10 in X, and of 0-10 in Y. I have two cursors in the graph.

I do not want the cursor is out of the graph area of 10 * 10, I disabled the auto scale, but the cursor can get out of the area of 10 * 10.

I also hope that the value of X of the cursor0 does not exceed the value of X of the cursor1.

I hope you can help me with these restrictions on movement, thank you very much.

0 Kudos
Message 1 of 5
(2,521 Views)

Right click on the graph and unselect Advanced>Cursors Scroll Graph.

0 Kudos
Message 2 of 5
(2,517 Views)

that's excellent, thank you.

Now I only need restrict that the value of X of the cursor0 does not exceed the value of X of the cursor1 when moving the cursors.

0 Kudos
Message 3 of 5
(2,511 Views)

Hey there, If you want to restrict the value of the cursors you can use property nodes to do so..

 

Here is an example; you just need to get the value on X of the active cursor (0 or 1) and then compare those values; if the value is smaller; you can use a case structure and a property node to coerce the values.

 

 

cursor.png

 

Hope this info helps.

 

Greetings

0 Kudos
Message 4 of 5
(2,474 Views)

If your UI is using an event structure (of course it is, right?), you can register for various cursor grab/move/release events on the XY graph.  That way you don't have to poll for where the cursors are all the time.

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 5 of 5
(2,458 Views)