Hi,i'm new in this Forum.
In my VI i need to extract xy graph's data from a cursor to another one,how can i do that?
I want to extract all the data between the two cursors,for elaborate it.
Thank you 🙂
Solved! Go to Solution.
You need to show us what you have. Please attach a simplified version of your VI containing typical data.
In addition to everything altenbach said, you want the Cursor List: Index property. That will tell you where in the array of data the cursors are.
The attached VI shows how it can work and also how meaningless it can be with common types of XY data.
Ok sorry,this version is better.I don't need while loop here,this is only a very small part of my program.
It works,but i can't undertand why it not extract the data correctly...in the graph with the extract data i don't have the portion between the two cursors!
thanks for your time
Thanks John,you solved my problem 🙂
Well, you required "from generic cursors", while Lynn's code uses cursors locked to a plot (as I already suggested here).
It only works if the X-values are sorted, and this cannot be guaranteed in the general case. (have you tried the "random" option in Lynn's code 🐵
It seems wasteful to get the entire cursor list if all you want is the cursor index.
You should also use the max&min function as I suggested. This way the two cursor positions don't need to be sorted.
Also note that if you would use complex data as I suggested, you would only need a single array subset operation, simplifying the code.