Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter Missing Triggers

Hi,

 

Running a hardware based sampling setup (attached). I keep getting error 201027 stating that more than 3 samples got lost due to hardware to software buffering. I am getting 6.6 - 33.4 khz of samples based on a 720 tooth encoder with 1 piece of data per sample. Please let me know if I did something wrong.


0 Kudos
Message 1 of 9
(6,624 Views)

Hi bronco9588,

 

I am wondering, why is your sample rate set to 1Hz? Could you sample faster?

 

Regards,

Nathan S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(6,613 Views)

The sample rate is 1 HZ because I only want 1 sample per hardware trigger. Is there a better way to do this? Wouldn't bumping this up greater than 1 cause an array to be inerted into the while loop?

0 Kudos
Message 3 of 9
(6,602 Views)

I swiched to a for loop and everything seems fine... I would like to go back to a whil loop, but if it means that I collect data...

0 Kudos
Message 4 of 9
(6,598 Views)

Hey All,

 

Hoping to fix this problem before Tuesday:

 

"Counter task detected three or more missed Sample Clock pulses. Samples
were lost before the application could read them. Decrease the Sample
Clock rate or restructure the application so that DAQmx Read runs more
frequently. Setting the Convert Error to Warning property to True does not
eliminate the error, because samples were lost."

 

That is the error code 201027. I have attached my latest code. Please note that the code does just fine at 550 RPM, but bumping up to 1100 RPM is causing it to trip the error signal. I need not only go 2X faster, but 5X faster. I have created an error rejection device that will only add 720 piece arrays with zero at the front of each array. Is there a way I can force the program to keep running despite the error? Are 5 shift registers and a case structure too much?

0 Kudos
Message 5 of 9
(6,588 Views)

When using a counter to count pulses from a rotating shaft, there is a lot to consider. 

1) getting the voltage levels right - sounds like your counter is incrementing on the pulses it sees.

2) synchronizing the counter with the analog input tasks - this requires sharing the base clock (could be 1Mhz for general DAQ for example)

3) runnig the counter in buffered event count mode - it collects an array of timestamps in tthe DAQ base clock counts - that can then be used to calculated intervals and of course speed. 

 

Our Sound and VIbration Measurement Suite has this built in, via a series of examples.  However - if you use buffered event counts, run the counter at full speed, and have it time stamp events in the DAQ clock domain, you will have the basics. 

 

 

Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 6 of 9
(6,582 Views)

Is there a way I can force the program to keep running despite the error? The code is made to reject a compiled array if there is not 720 units in the array. I just need to keep it from crashing. 

0 Kudos
Message 7 of 9
(6,560 Views)

Which hardware are you using for this application?

0 Kudos
Message 8 of 9
(6,547 Views)

Got it figured out... I had a broken encoder...

0 Kudos
Message 9 of 9
(6,545 Views)