LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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
0 Kudos
Message 1 of 7
(4,606 Views)

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
0 Kudos
Message 2 of 7
(4,590 Views)

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


0 Kudos
Message 3 of 7
(4,573 Views)
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)
Message 4 of 7
(4,566 Views)

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
Message 5 of 7
(4,546 Views)

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.

0 Kudos
Message 6 of 7
(4,534 Views)

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
0 Kudos
Message 7 of 7
(4,529 Views)