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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

peak detect and boolean

Hi, everyone

why the results is different between waveform peak detection and  Peak Detector PtByPt VI? the signal source and threshold and width is the same. 

 

0 Kudos
Message 1 of 7
(2,410 Views)

Hi frogliang,

 

why the results is different between waveform peak detection and  Peak Detector PtByPt VI?

Because of your programming!

 

the signal source and threshold and width is the same.

No, wrong!

The PeakDetector analyzed ALL samples, while the PtByPt-function only analyzes the first sample of each data block - as you have programmed it!

 

- What's the reason to use a PtByPt-Queue in your VI? Why is it needed?

- Why do you use DAQmxRead in "N chan N samp" mode when you only read one (1) channel?

- Why do those graphs still have no label? Don't you listen to advice?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,377 Views)

Did you right-click the two Peak Detector functions, select Help, and carefully read the LabVIEW Help Messages, including the pointers to supplementary explanations (at least in LabVIEW 2018) about Peak Detection?  Do you understand how peak detection works?

 

If some LabVIEW code in a complicated, somewhat messy Block Diagram, particularly coming from "real" data, behaves in a strange way, figure it out for yourself by writing a small, simple program that generates known data and then does simple analysis of it.  So generate an array of 100 points that has a peak, and see if the peak detector finds it.  

 

Bob Schor

0 Kudos
Message 3 of 7
(2,360 Views)

Hi GerdW,

 

What's the reason to use a PtByPt-Queue in your VI? Why is it needed?

I want to collect all the peaks, I thought the function is giving a "ture" when there is a peak detected. so every time it detect a new peak, I put the value to the array.

 

 Why do you use DAQmxRead in "N chan N samp" mode when you only read one (1) channel?

So sorry, I didn't quite understand this, but only N chan show a corresponding signal on the graph when I connect to the real signal.

 

Why do those graphs still have no label? Don't you listen to advice?

I really appreciate your advice, but I planed to do that in the final step.

 

PtByPt-function only analyzes the first sample of each data block - as you have programmed it!

Could you please explain more in detail? below, the first two is show by PEAKDETECTOR of each 100 samples, the last one is  PtByPt of 1  to 400 samples. It seems that the PtByPt has different detect value during each data block.

微信截图_20180828074747.png

Best Regards

Liang

0 Kudos
Message 4 of 7
(2,352 Views)

Hi Liang,

 

I want to collect all the peaks,

But you have wired the waveform coming from DAQmxRead into that Queue function - which makes NO sense at all…

 

I planed to do that in the final step.

You planned to keep a VI where controls/indicators have NO label?

Have you ever programmed using a text-based programming language? Did you program the same way: give variables a label just as final step???

 

Could you please explain more in detail?

There is an IndexArray function just in front of the PtByPt-PeakDetector, which makes it work with just the first sample of each data block. Pretty senseless, don't you think?

 

It seems that the PtByPt has different detect value during each data block.

Because it is working with very different data…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(2,343 Views)

Hi GerdW,

When I us single channel, the wave is incorrect on the graph, and  myDAQ example also use multi channel, I don't get it.

If I use single channel, I can use get waveform component to get Y value, but multi channel can not. so I use queue function as the threshold example shows, and the index array is in the DAQ examples, use to transform to single point, otherwise the queue function  is useless. I got so confuse of the data type, I try this way to eliminate errors.

What should I use to make the input data source the same ?

Thank you !

0 Kudos
Message 6 of 7
(2,335 Views)

Hi Bob Schor,

The peak example seems also have this problem, when the waveform graph appear two peaks, the indicator only flash once?

Liang

0 Kudos
Message 7 of 7
(2,319 Views)