LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get graph curve interpolation

Hi,
I've to interpolate the point corresponding to 3E-4 on y axis from the following measurements (see attached VI).
Before coding a classic linear interpolation vi, I'd like to know if we can directly read the value interpolated by LabVIEW when plotting the curve. In other terms, get the x value of a cursor placed on the curve from its y axis?

Thank you in advance.

Bim
0 Kudos
Message 1 of 5
(3,420 Views)
You can do this pretty easily by using the cursor position property of the graph.  You will need to create a cursor for the graph (easiest way is to use the cursor legend on the front panel).  You can select free floating or locked to points - you will want free floating.  Your accuracy will be limited by the resolution of your display, so make the graph big.  You can also zoom into the point of interest.

Also, depending on your LabVIEW version, you may want to check out the analysis VIs.  There are a variety of interpolation schemes available (linear, polynomial, etc.).
0 Kudos
Message 2 of 5
(3,407 Views)
Thank you for answering,
I've tried using cursors, but I can't find a way to lock it programaticaly on the curve and read the value corresponding to an y. It seems to only be able to return the known points values, whereas I 'd like it to be as free but locked on curve.
...?


0 Kudos
Message 3 of 5
(3,402 Views)
To my knowledge, LabVIEW does not offer a cursor mode which locks to the curve, but does not just skip between the points.  It is either totally free or on the points.  My apologies for not understanding your original question.  My previous answer assumed you would use the free version and position the cursor over the line, then read the position (subject, of course, to screen resolution).

You will need to do a simple interpolation yourself.  As I mentioned, LabVIEW includes some interpolation routines which may be useful.  Look in the analysis VIs.  However, a linear interpolation is pretty simple if you want to do it yourself.

If you are up for a challenge, you can make LabVIEW do what you want to do.  You can use the mouse down and mouse move events in an event structure to move a free cursor to the proper location on the graph.  This will give you the functionality you want.  You probably want to set the Cursor.AllowDrag property false so that the mouse does not move the cursor.  You will be doing that programmatically.

Alternately, you can use the coordinates of the free cursor to simply calculate and display a linear interpolation of the Y value at the cursor X position.

Good luck.  Let us know if you need more help.
0 Kudos
Message 4 of 5
(3,391 Views)
If you know that the curve always has the same slope sign, you can just use "threshold 1D array" with a cluster input. See attached simple example (Since the slope is negative you need to flip y).
0 Kudos
Message 5 of 5
(3,383 Views)