LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw line from cursor to fixed point on XY graph

How do I draw a line from a moving cursor to fixed point on XY graph?  Do I need to insert into an array to add another element, then initialise the element to the fixed point?

How would I do this?

 

Many Thanks

0 Kudos
Message 1 of 9
(3,749 Views)

Hi Zonda,

 

read the cursor position, add one more point (your "fixed point") to create a plot in your XY graph:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,724 Views)

It's just another plot with two known points, right? What is moving the cursor (user? Code?)

 

Sorry, posting by phone. Cannot post example.

0 Kudos
Message 3 of 9
(3,719 Views)

It depends if you mean by cursor "mouse cursor". You can draw a line based on the mouse coordinates without using the graph cursors. You simply use the corresponding event from the XY graph in an event structure and draw on one of the picture plane of the graph (I selected front) along with the proper invoke node to convert from XY graph to mouse coordinates. Below is an example using the "Mouse move" event and (0,0) as the fixed point. VI is attached in LabVIEW 2016.

 

Line to mouse cursor.png

Marc Dubois
0 Kudos
Message 4 of 9
(3,700 Views)

Thanks for the replies, to clarify I'm trying to create a pendulum simulation on a XY graph.  The Labview coding makes the cursor move on the graph, I'm trying to draw a line from the moving cursor to a fixed point so that it resembles a pendulum in motion.  

0 Kudos
Message 5 of 9
(3,690 Views)

Something like this:

 

pendulum.png

Tim
GHSP
0 Kudos
Message 6 of 9
(3,682 Views)

Hi Tim,

 

Please can you attach the VI file of that image.

 

Thank you

0 Kudos
Message 7 of 9
(3,676 Views)

it is a snippet. You can drag it into your block diagram. Save it to your desktop and drop it on your block diagram.

 

 

Tim
GHSP
0 Kudos
Message 8 of 9
(3,674 Views)

Maybe something a little simpler ... Make sure you understand every single part.

 

altenbach_0-1575498935591.png

0 Kudos
Message 9 of 9
(3,662 Views)