Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

02-19-2020 03:37 AM - edited 02-19-2020 03:55 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

Highlighted
Options

02-19-2020 04:17 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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"!

Best regards,

GerdW

CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

GerdW

CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

Highlighted
Options

Solution

Accepted by topic author Ben121

02-19-2020 04:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

Highlighted
Options

02-19-2020 05:10 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

Highlighted
Options

02-19-2020 05:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi pragya,

did you read the (context) help for ArrayMinMax and cbutchers excellent message?

Why don't you use the min index to solve your requirements?

Best regards,

GerdW

CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

GerdW

CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

Highlighted
Options

02-19-2020 05:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thank you. Not I got it.