05-31-2012 03:54 PM
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.
06-07-2012 12:35 PM - edited 06-07-2012 12:36 PM
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?
06-09-2012 11:58 AM
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?
06-10-2012 02:27 PM
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.
06-13-2012 11:19 AM
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.