From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-26-2010 01:35 AM
I am trying to find the peak and valley of the signal. I am able to find it but I dont want to get the zero's with the peak. I just want to get the peak and valley value. Is there any way to stop queuing the values in the case structure? As I have a multiple signals whose peak/valley is to be found I can't use the Library functions.
Solved! Go to Solution.
11-26-2010 01:59 AM
Well, you have to output something, Outputting NaN would probably be better. Simply ignore the output in the calling program when NaN is received back.
Of course you might want to look into the existing Peak Detector PtByPt VI function. 😉
Compare your function to it! It seems pointless to return the same value as the input as you do (or zero). The calling program is fully aware of the current value because it just submitted it to the subVI. Outputting two booleans, one true for peak and one true for valley, seems more reasonable. Right?
11-26-2010 02:08 AM
Hi Kanye,
You have no choice than passing a value in any case diagram.
But what you can do is to generate a boolean output and put it to True when you found a new valley or peak. Then, in your calling VI, you just have to process the data only when this boolean is True.
Would that do the trick?
Olivier L. | Certified LabVIEW Developer
11-26-2010 02:41 AM - edited 11-26-2010 02:43 AM
@kanye wrote:
I am trying to find the peak and valley of the signal. I am able to find it but I dont want to get the zero's with the peak.
First of all and in addition to what has been mentioned, there are some serious flaws, making the subVI not very universal.
11-26-2010 05:13 AM
Hi altenbach,
Thanks for pointing out that the valley can also be positve. I didn't thought about that. I have made the VI re-entrant. I am planning to use this VI for over 100 channels to find peak/valley and log data with time stamp for each peak/valley.