Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

varying sample size

I have a light screen with a 12v pulse output going to a cDAQ 9422 USB deck I have it set up as a counter measureing the period between signals. My problem is that I have varying sample sizes with the data I am collecting.

 

In the data there are always 10 good readings that I want and anywhere from 0-3 false readings per good reading. So I could have a sample size from 10 to upwards of 40. I have no problem filtering the data but I am having trouble making my VI stop and output the data once the 10 good reading have come in.

 

When I tried a finite number of samples it would either be isufficient samples and cut out data or to many samples so that my sample size would not satisfy the VI and recieve no output. I have the same problem on continuous sampleing because the buffer will cut out data on occation with a large sample size.

 

So what I want to do is trigger on the first rising edge and stop on the tenth "good" rising edge and display the data. I am open to suggestions on VI examples to use. I have only tried to modify the DAQ assistant to try to accomplish this. I am pretty green as far as labview so if you have any advise please be specific.

 

Thanks

0 Kudos
Message 1 of 2
(5,477 Views)

Hello,

 

What characterizes a false reading when you are measuring your pulses?  This will be important in determining how your system will acquire data.  Basically, you can either acquire a finite amount of data over a certain time period that accounts for the worst case scenario, or do a counter measurement depending on how your edges look, or try checking the amount of good edges in software.

 

The most reasonable solution I can see is setting your sample rate and finite samples to read so that you will always capture 40 edges, and then filter out any data after the acquisition that looks bad or any data over the 10 good readings that you get.

 

Without knowing exactly how a false reading looks in relation to a good reading, it is hard to say what method would be appropriate for your application.  If you can elaborate a little more on that, it would help greatly.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 2
(5,458 Views)