LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

Creating a separate Sine function who's only values are above a certian amplitude

I am trying to create and graph a separate sine function on the same waveform graph that is just the first function with any Y value above a preset max amplitude. This is what I have so far. the arrays coming out of the first for loop look correct. All values where -max amplitude < Y < max amplitude are set to NaN, but something goes wrong when converting the 2 1D arrays into a waveform and I cant figure it out.

Message 1 of 6
(502 Views)
Solution
Accepted by id6014

Re: Creating a separate Sine function who's only values are above a certian amplitude

Hi id,

@id6014 wrote:

I am trying to create and graph a separate sine function on the same waveform graph that is just the first function with any Y value above a preset max amplitude. This is what I have so far.

Why so complicated?

See this:

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(482 Views)

Re: Creating a separate Sine function who's only values are above a certian amplitude

I did have to modify it slightly, but that worked perfectly. thank you so much.

Message 3 of 6
(463 Views)

Re: Creating a separate Sine function who's only values are above a certian amplitude

Hi id,

@id6014 wrote:

I did have to modify it slightly, but that worked perfectly. thank you so much.

Instead of using InRange&Coerce and Negate you could also use an Abs() function on the Y data and a simple comparison as I suggested…

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(459 Views)

Re: Creating a separate Sine function who's only values are above a certian amplitude

And why exactly do you think you need to rewrite all these properties with every iteration of the loop? Typically setting them once is sufficient and then whenever one of the inputs change (do they ever?)

(On a side note, You would get significantly better help if you would attach your VI instead of oversized pictures of disorganized code)

Message 5 of 6
(401 Views)

Re: Creating a separate Sine function who's only values are above a certian amplitude

Here's what I might do:

(I typically place the data with fewer points on top so it will show even if the linewidths are the same)

Message 6 of 6
(396 Views)