My project is to count the number of analog pulses. I've tried the VI as below. The problem I'm facing is, it automatically resets to initial count without counting the entire pulses. I'm using ELVIS 2.Please help me to perform better. I've attached my file. Please reply soon.
Are you using the Run Continuously button by chance?
Also, when is it automatically resetting to initial count? Is "# found" and "count" both resetting? Try using highlight execution (the light bulb button) to see if you can get any more information about when it is occuring. I'm on a Mac, so I don't have DAQmx installed and can't run your VI.
Nothing obvious jumped out at my as far as coding goes as to why it would reset.
First of all thanks for the reply. yes i do use the run continiously button during the execution.
i coudnt find exactly find when it gets resetting. i ll try to send another vi without DAQmx.
please help me to alter this vi. i need to count analog pulses of time period 200ms which come from a push switch
i also add the block diagram of my project for your referance.
Hoping for you reply
The Peak Detector function in labview counts the number of peaks of whatever signal you are supplying to it, which means if your signal is continuous (collected via a daq), the Peak Detector will always start from zero and only give you the number of peaks in the chunk of signal that it receives each time from the daq (the size of this chunk depends of your sampling rate and your buffer size). The Peak Detector does reset its count every time it is called by your code.
However, you can retain the previous count by placing your daqmx and your Peak Detector function inside a while loop. This way you can pass the "# found" through each iteration with a shift register. This will allow you to add the new "# found" to the previous one. Because you have a while loop, you do not need to press Run Continiously. The program will run continously if you click Run until you press the Stop button for the while loop.
You can read a little more about shift registers here: http://learnlabview.blogspot.com/2008/06/programming-labview-shift-register.html
Also attached is your code modified.
I hope this helps.
hola yo estoy utilizando el peak detector. vi para detectar pulsos analogicos pero quiero obtener la frecuencia por minuto de ellos, y para esto quisisera resear el peak detector en cada ciclo, pero sin detener el programa, en si quiero que en cada ciclo "found" vuelva a reiniciar su cuenta, ¿Alguien me podria ayudar? se los agradeceria muchisimo