02-19-2020 03:37 AM - edited 02-19-2020 03:55 AM
Hello!
I am at a beginner's level of LabView programming. I have a small doubt if anyone can help me out with this.
Actually, in an XY graph, I want to have the X value at which Y is minimum (which is changing continuously while running the program continuously) and feed this X value (at Y minimum) as an input to a different waveform graph. Basically I want to see the variation of X value at Y minimum with time in live mode.
Can someone please suggest me how to find the X value at Y minimum of one graph and feed it in other graph at once?
Solved! Go to Solution.
02-19-2020 04:17 AM
Hi pragya,
@Ben121 wrote:
Actually, in an XY graph, I want to have the X value at which Y is minimum (which is changing continuously while running the program continuously) and feed this X value (at Y minimum) as an input to a different waveform graph. Basically I want to see the variation of X value at Y minimum with time in live mode.
When you have a XY graph then you also have an array of X values and an array of Y values.
Now you are asking how to get the minimum from that Y value array? There's a ArrayMinMax function in the array function palette…
Now you just need to build another array from those minimum data to create a plot for your "different waveform graph"!
02-19-2020 04:36 AM
Hi,
As GerdW said, there's an Array Max and Min function which in addition to finding the min+max values, also provides their indices.
You can then use this value to Index Array for your X values.
Use a Shift Register if needed to store previous "time" values, or display using a chart (charts store history - graphs do not).
If your data (in the XY graph) is stored as an array of points (or array of clusters of arrays of points, for multiple plots) then you won't be able to directly use the Array Max + Min function, but you could implement the same functionality in a point-by-point manner using a For loop. If you have control of your data input, it would be better to keep separate X and Y arrays for this reason (and plot the cluster of arrays of X and Y option, instead of the points). See the "Detailed Help" for an XY Graph for more details.
02-19-2020 05:10 AM
Thank you for the responses.
Actually, instead of Y minimum values, I want the X values for which Y is minimum i.e., the value of X (at minimum value of Y). I want to use the X value (at which Y is minimum) for the waveform graph.
02-19-2020 05:18 AM
02-19-2020 05:40 AM
Thank you. Not I got it.