LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get maximum Y-value from an XY Graph

Solved!
Go to solution

What VI's can I use to get the maximum Y-value from an XY graph, as well as its corresponding X-value?

0 Kudos
Message 1 of 9
(433 Views)

Generally you don't get it from the graph but from the data arrays you feed it with. Regardless, there's an Array Max/Min function that should give the result.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 9
(414 Views)

Hello,

 

I can't find the "Unbundle XY By Channel" VI; the only unbundle VI's I can find are the Unbundle and Unbundle By name VI's. Maybe that VI has a different name In version 2015?

 

Also, when using the Index function, I can only get what I assume to be the point number corresponding to the maximum Y-value, and not the X-value itself. Is there a way to display the X-value itself?

0 Kudos
Message 3 of 9
(390 Views)

That is an "AI" generated answer. They like to imagine things that sound plausible but do not exist.

 

What data format do you feed into the graph? It is always helpful to attach code to be sure we are talking about the same thing.

 

If you have an array of XY-points, build an array of Y values and use Array Max & Min.

 

snip.png

 

Message 4 of 9
(370 Views)

The graph was created from the measurements obtained by a machine. Is there a way to obtain the X-value that corresponds to the maximum Y-value?

0 Kudos
Message 5 of 9
(341 Views)

Yes, everything you need should be right there. Find the maximum using array max & min, then use the max index output to index into the x-value array.

If you want further help, please show some code.

0 Kudos
Message 6 of 9
(332 Views)

You used the Unbundle By Name VI right? How can I indicate that the type of data to bundle are DBL types?

0 Kudos
Message 7 of 9
(295 Views)
Solution
Accepted by solarfacility_user

I did not use unbundle by name, just unbundle (without names). To define the data types, create a cluster to use as template or convert it to the desired data type before bundling. You might want to take a look here: https://www.ni.com/de/support/documentation/supplemental/08/labview-arrays-and-clusters-explained.ht...

 

snip.png

0 Kudos
Message 8 of 9
(284 Views)

A couple of options I could think of are given in the snippet. 

 

XYGraph MaxY.png

0 Kudos
Message 9 of 9
(252 Views)