LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronize cursor and mouse

I would like to synchronize the mouse and the cursor of my graph. When I click on a waveform graph, I would like the cursor to come at the position clicked.
Is it possile?

Thank you
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 19
(5,975 Views)
You could use an event structure to detect the mouse click.  Then use the Coords element to set the Cursor.Posistion property fo the waveform graph.  Unforntunately, Coords is measured in pixels on the pane and Cursor.Position reference the X and Y scale of the graph, so some amount of conversion is necessary to get the cursor to the right spot.

Personally, I use the cursor button on the graph palette.
0 Kudos
Message 2 of 19
(5,970 Views)


jasonhill a écrit: ...Unforntunately, Coords is measured in pixels on the pane and Cursor.Position reference the X and Y scale of the graph, so some amount of conversion is necessary to get the cursor to the right spot.

Actually, the conversion is straight forward, since there is a little known function, as invoke node, that do the conversion for you. Beware, the graph reacts to any click, even on the cursor button, and you need to use the Map to XY boolean output.

All this is demonstrated in the attached vi.

Enjoy !

Message Edité par chilly charly le 06-16-2006 07:15 PM

Chilly Charly    (aka CC)
Download All
Message 3 of 19
(5,973 Views)

Excellent post CC!

I salute you sir.

Ben

PS This post is worth 25 stars!

Message Edited by Ben on 06-16-2006 12:49 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 19
(5,952 Views)
Excellent CC!
25 stars indeed!  With thanks!
 
Milles merci
Message 5 of 19
(5,924 Views)

Unfortunately, if memory serves, that method is
a) a private method (at least before 8).
and b) not working in 7.0.


___________________
Try to take over the world!
0 Kudos
Message 6 of 19
(5,913 Views)
Thank you!! It works very well !!
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 7 of 19
(5,903 Views)


tst a écrit:

not working in 7.0.



Really... Smiley Surprised... not problems in 7.1.1...

Very nice trick CC !


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 8 of 19
(5,865 Views)

Speaking of CC... Where is he these days?  I haven't seen him around..

0 Kudos
Message 9 of 19
(5,854 Views)
Hello CC,

very nice example!

One problem arised when I tried to use this:
How can I set a certain cursor, when there are more than one?
Somehow LabView doesn't tell me the correct activated cursor... Even when I activate a cursor by mouse clicking in the cursor palette, LabView always sets a different cursor...

Message Edited by GerdW on 06-23-2006 10:07 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 19
(5,838 Views)