05-16-2012 06:52 AM
I am trying to create a program to cont the number of pulses over 5 seconds. i have written a program to the stage where it displays a 1 for every pulse. however I cant figure out a way in which to count these 1's over a period of time (5sec).
The over all idea is to be able to count the number of times there is an interuption/ break in my photo gate within 5 seconds.
The photo gate circuit is designed to give 2.6V when not blocked and a 5V when blocked.
I cant use the counter on the DAQ because ill will be useing two photogates and the DAQ only has the one counter.
can anyone help me with this?
attached is my attemt at a program so far.
05-16-2012 10:50 AM
Please post your actual VI so we can play around with it and figure out more easily a possible solution.
05-16-2012 10:51 AM
this is the VI .
05-16-2012 11:10 AM - edited 05-16-2012 11:19 AM
First of all, I'd make the DAQ task capture N samples at a specific rate. For example, set your sample rate to 100Hz (10ms/S) and number of samples to 5sec*100S/sec = 500. You can then work on that array. That would eliminate your for loop.
My second thought is that you need to count the number to transitions from low to high. There was a recent thread that talked about this. I'll have to see if I can find it for you.
Edit: Found it: http://http://forums.ni.com/t5/LabVIEW/is-how-can-I-calculate-how-many-transitions-are-inside-an-arr...
05-17-2012 07:00 AM
hi thanks for the help, however when change the DAQ parrameters to Nsamples an so on. it then diplayes an error =>
Error -50405 occurred at DAQmx Control Task.vi:5
Possible reason(s):
No transfer is in progress because the transfer was aborted by the client. The operation could not be completed as specified.
Task Name: _unnamedTask<17>
i was wondering if u could shed any light on this. ?
05-17-2012 07:13 AM
hi ya i solved the problem the DAQ wasn't properally connected.
thanks for the link . going through it now. looks great thanks