LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak Detector - Error -20013

Solved!
Go to solution

Hello,

 

I'm simulating a DAQ device, and I would like to use the peak detect function, but I'm getting the following error:

error

 

I've attaced my vi, I tried to change the values of width but it doesn't work.

Can someone help me please?

 

Regards

0 Kudos
Message 1 of 3
(3,947 Views)
Solution
Accepted by topic author simo28

It is impossible to tell for sure from your VI without any data. My best guess is that you get the error when the loop iterates fast enough that fewer than 4 points are read from the DAQ device. You sample rate is 300  S/s so it will require >13.3 ms to acquire 4 samples. It is almost certain that the loop runs faster than that.

 

Since you are apparently trying to analyze and ecg signal, the peaks may be on the order of 1 second apart (for human hearts).  Although there are other issues with the method I am about to propose, this should let you see some peak detection: Change the number of samples to read from -1 (all available samples) to 300. This will result in one reading per second. Many times you will get one peak within the data from that reading. Occasionally you will get more than one peak or no peaks. Rarely the peaks may occur very near the edge of the data segment. To handle that case will require carrying some of the data over to the next iteration via a shift register.

 

Lynn

0 Kudos
Message 2 of 3
(3,931 Views)

Thank you Lynn for the nice description! now the error is gone 🙂

0 Kudos
Message 3 of 3
(3,923 Views)