LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

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. 

 

c1.PNGc2.PNG

0 Kudos
Message 1 of 6
(835 Views)
Solution
Accepted by topic author id6014

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
(815 Views)

c3.PNG

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

0 Kudos
Message 3 of 6
(796 Views)

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
0 Kudos
Message 4 of 6
(792 Views)

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?)

 

altenbach_0-1700159009636.png

 

 

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

 

0 Kudos
Message 5 of 6
(734 Views)

Here's what I might do:

 

altenbach_0-1700159687346.png

 

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

0 Kudos
Message 6 of 6
(729 Views)