05-31-2007 11:12 AM
05-31-2007 04:19 PM
It sounds like you might be able to put the built-in cursors in graph controls to good use. You can have a cursor that snaps to the nearest data point and easily determine which data point it is. Check out ..\samples\userint\graphcursors.prj, and take a look at all the various forms and behaviors that the cursors can have.
Hope this helps,
Ian
05-31-2007 05:18 PM - edited 05-31-2007 05:18 PM
Message Edited by Alex D on 05-31-2007 05:19 PM
Message Edited by Alex D on 05-31-2007 05:19 PM
Message Edited by Alex D on 05-31-2007 05:20 PM
06-02-2007 01:57 PM
Thanks Ian and Alex,
I tried the graph sample project, but apparently the "snap to" feature does not work when you use PlotLine rather than PlotY. I've asked NI about this but don't expect to hear back until next week.
I'll keep trying the other suggestions.
Dave
06-04-2007 11:19 AM
06-04-2007 04:05 PM
06-04-2007 04:31 PM
Hi Colin,
Thanks for the response. There is a piece of the puzzle missing (sorry). That is, I can plot up to 72,000 points. Each point is plotted as the data is received. Snap to only works with PlotXY (and maybe the other plot functions too) if you plot all the data at once. So I think the standard NI functions aren't going to be able to do it for me. I'm going to take a look at what Alex mentioned and see if there is something there I can use.
Thanks again.
Dave
06-05-2007 04:47 AM
Well, this must be combined with your need for execution speed...
You could:
1. Allocate an array when your process starts
2. Keep an index of how many data you collected
Processing loop:
3. Acquire one measure and append to the array (index++)
4. Delete all plots from the graph
5. PlotXY the whole array for <index> samples
Delaying the DeleteGraphPlot will improve user interface performance since the graph is update only once on PlotXY.
06-05-2007 08:27 PM
Thanks Roberto. After talking with James today, it doesn't appear that the standard cursor functions for a graph will work for me. I have too many data points and my data is arriving far too quickly (as fast as every 50 msec) to delete the graphs and redraw them from the beginning for each point. Without plotting the entire graph, the cursor functions won't give me what I want.
I'm going to try to capture the mouse position and convert that into an index on my x-axis.
Dave