LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Have cursor track plot so I can get data point from it

How can I have a cursor locked onto a plot so that I can read it via something like 'GetGraphCursorIndex' and be able to get the actual y-datapoint from the plot for the user?  This seems like basic functionality for a cursor on a graph, but I can't figure out how to do it.

0 Kudos
Message 1 of 17
(4,268 Views)

The function GetGraphCursor should be what you are looking for, provided you set the cursor to "snap to point" either in the UIR edtor or programmatically using SetCursorAttribute with attribute ATTR_CURSOR_MODE set to VAL_SNAP_TO_POINT.

 

When using GetGraphCursor you may suffer an approximation error due to screen resolution, as described here: the document gives you the way how to avoid this error.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 17
(4,267 Views)

When I move the cursor with the mouse, it doesn't stay attached to the plot.

0 Kudos
Message 3 of 17
(4,265 Views)

Again, this is one of the weakness of CVI's UIR graph.  Many analytical functions on a graph that plots collected data are in need for engineers like us, but they are not provided by CVI.  CVI's graph is really not designed for this purpose.  It's just a temporary display of the data you've taken. 

 

Try DPlot (www.dplot.com).  It's a much better choice for generating more useful and more functional high quality graphs.  Its DLL library is free to use and can be seamlessly integrated with CVI.

 

 

0 Kudos
Message 4 of 17
(4,261 Views)

Seems like for the price we pay for CVI, this should be included.

0 Kudos
Message 5 of 17
(4,258 Views)

Agree!

 

A comment is added in the CVI idea exchange for this purpose:

http://forums.ni.com/t5/LabWindows-CVI-Idea-Exchange/Improved-Accelerated-Graphic-Performance/idc-p/...

 

NI doesn't seem to care...... 

0 Kudos
Message 6 of 17
(4,255 Views)

Kaveh,

 

I don't completely understand what it is that you would like to be able to do with a snap-to-point cursor that you can't do today? Would you mind elaborating on that a bit?

 

Thanks,

Luis

0 Kudos
Message 7 of 17
(4,213 Views)

Hi Luis,

 

I want to be able to use a vertical cursor to get the data values for all the plots on a particular graphic.  To do this, the cursor needs to snap to at least one of those plots, but every time I move the cursor with my mouse, it ceases snapping to a plot.

 

Kaveh

0 Kudos
Message 8 of 17
(4,209 Views)

Hi Kaveh,

 

Thanks for following up. I'm still not completely sure what you mean by "it ceases snapping to a plot". After you move the cursor and you release the mouse button, the cursor should snap back to the nearest plot point. Is that not happening in your case?

 

Luis

0 Kudos
Message 9 of 17
(4,204 Views)

No, it's not.

0 Kudos
Message 10 of 17
(4,201 Views)