cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get extract the data between two cursors on an XY graph

Flamboyant
Member

How can I get extract the data between two cursors on an XY graph

How can I get extract the data between two cursors on an XY graph
6 REPLIES 6
Vsh
Active Participant
Active Participant

Re: How can I get extract the data between two cursors on an XY graph

You will know the X positions of cursors. poll the data between these positions. 

 

You can get the index of X positions, get the array subset of Y array from these indices 

Message Edited by Vsh on 11-24-2009 12:56 AM
srikrishnaNF
Active Participant

Re: How can I get extract the data between two cursors on an XY graph

Message contains an attachment

Hi cooldude,

  Actually you can extract the data using cursor events than polling,as polling may load the cpu.For your reference i had attached a program which uses a graph.

 

 

 Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


Highlighted
Coq_Rouge
Trusted Enthusiast

Re: How can I get extract the data between two cursors on an XY graph

Message contains an attachment
I have made a simpler example


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
altenbach
Knight of NI

Re: How can I get extract the data between two cursors on an XY graph

Message contains an image Message contains an attachment

Well, you say xy graph, so this might be a more complicated problem.

 

For a waveform graph it's trivial. Simply get the two cursor indices (property: cursor index) and apply them to array subset of the data. Is that all you need?

 

Here's how the above code would look like. using cursor.index instead of cursor.x elimnates the need to include scaling information.

 

 

For an xy graph, there could be multiple segments (e.g. imagine a spiral that passes the desired x range multiple times from both sides). This would neeed significantly more code for a general solution.

Message Edited by altenbach on 11-24-2009 07:53 AM
altenbach
Knight of NI

Re: How can I get extract the data between two cursors on an XY graph

Message contains an image

altenbach wrote:


Sorry, I made that code during the edit window of posting and run out of time. Of course N should be wired with a 2 to get only the first two cursors.

 

Personally, I would keep the two cursor indices in a shift regsiter and then update only the relevant one via event terminals.

altenbach
Knight of NI

Re: How can I get extract the data between two cursors on an XY graph

Message contains an image Message contains an attachment

altenbach wrote:

Personally, I would keep the two cursor indices in a shift regsiter and then update only the relevant one via event terminals.


Here's a quick draft how that would look like. (note that we might also want to adjust t0 so the x-values are retained correctly).

 

Message Edited by altenbach on 11-24-2009 08:13 AM