06-06-2011 03:28 PM
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.
06-06-2011 05:15 PM
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.
06-06-2011 05:17 PM
When I move the cursor with the mouse, it doesn't stay attached to the plot.
06-06-2011 06:36 PM - edited 06-06-2011 06:36 PM
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.
06-06-2011 06:37 PM
Seems like for the price we pay for CVI, this should be included.
06-06-2011 07:00 PM
Agree!
A comment is added in the CVI idea exchange for this purpose:
NI doesn't seem to care......
06-15-2011 10:42 AM
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
06-15-2011 11:23 AM
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
06-15-2011 01:50 PM
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
06-15-2011 01:52 PM
No, it's not.