LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cursor crosses curve in 2 points: find 2nd point

Solved!
Go to solution

Hello,

 

Here is emulation of a part of my mesuerement setup.

Here are keypoints:

  • measurement curve (emulated by sinc function)
  • 2 free cursors TOP and BOTTOM
  • 1 locked cursor "MIDDLE": its Y is calculated as mean value of TOP and BOTTOM
  • 1 crossing point can be derived from Active Cursor property (PosX and PosY)

Does exist a simple way to find 2nd crossing point.

 

Thanks in advance

 

 

 

MIDDLE_cursor_handling (0).png

Message 1 of 7
(3,824 Views)

Here is a solution which is a little bit tricky.

It works as follows:

  1. On cursor release (TOP or BOTTOM) the mean value of Y is calculated
  2. Cursor MIDDLE (locked to the curve) is set
  3. Coordinate X of the cursor MIDDLE is derived
  4. Index of the coordinate X is found in the original array
  5. Original arrays X and Y is cut next to X coordinate index
  6. New curve is built on supplementary graph "XY graph 2"
  7. Coordinate X of the cursor on supplementary graph is found
  8. Coordinate (X1, Y) and (X2, Y) are applied to Annotation List collection

The probelem here is when I hide "XY graph 2", the method isn't stable - sometimes original curve is cut correctly, sometimes - NOT.

 

Any comments ?

 

MIDDLE_cursor_handling (1).png

0 Kudos
Message 2 of 7
(3,803 Views)

Here is approach (still a bit complicated) that works:

MIDDLE_cursor_handling (2).png

 

0 Kudos
Message 3 of 7
(3,784 Views)

this here would get more than two crossings

 

2016-05-18_mod.PNG

 

 

Message 4 of 7
(3,771 Views)
Solution
Accepted by Pavel_47

Ok, sorry for hijacking this thread, case "all" was quite easy:

 

0# all:

 

0_all_g.png0_all_b.PNG

 

getting the first x-position wasn't too bad

 

first:

2_last_g.PNG1_first_b.PNG

 

 

getting the last x-position of a crossing was slighty harder but feasible without queues:

 

 

 

last:

1_first_g.PNG2_last_b.PNG

 

 

 

....but getting the middle was quite tough, is there an alternative besides using queues ?

 

median:

3_median_g.PNG3_median_b.PNG

 

 

Regards,
Alex

 

0 Kudos
Message 5 of 7
(3,756 Views)

Hello Alex,

 

Your approach is quite ingenious. Congratulations !

Especially I liked "median" case, actually it's what I need.

 

Thanks

0 Kudos
Message 6 of 7
(3,731 Views)

@Pavel_47 wrote:

Hello Alex,

 

Your approach is quite ingenious. Congratulations !

Especially I liked "median" case, actually it's what I need.

 

Thanks


you are welcome 🙂

 

This version of the median case mighty be a bit more comprehensible:

2016-05-20_median.PNG

Regards,
Alex

 

0 Kudos
Message 7 of 7
(3,709 Views)