06-29-2015 07:50 PM
Hi, I am trying to use the following file for buffered counter measurents, in order measure angular velocity. It gives me the error 20061 (Frequency must be <= sampling rate/2) and I consider it correctly, but by any selection of sampling rate and frequency, I still cannot fix the error and I am really not sure if it is really an Error or a bug. I found the example from the following link and only deleted one of the tasks since I only have only one incremental encoder.
https://decibel.ni.com/content/docs/DOC-6834
Even by using the orginal file in above link, I still cannot fix the error. please check the attachment file and tell me what might have gone wrong. I posted the question under above link but there was not further explaination. Also I asked in a seprate topic but there was no answer. please kindly help me. thanks
03-10-2016 08:35 AM
Hello,
I'm having the same problem. Someone has fixed it?
Thanks
03-10-2016 10:54 AM
There's a more thorough discussion of the original problem over here.
The error is unrelated to the data acquisition tasks, it is simply due to dubious usage of a sawtooth function generator inside the subvi named "sub_CalcVelocity.vi" in the linked Community example code. It's very highly likely the function is fine but is being fed wrong inputs.
I don't have time for careful study or testing, but it appears that the sawtooth generator is being used solely to create an array of time values for the position samples, which in turn is used solely to do a linear regression to get an average velocity over the set of samples.
Below is a snippet of a quick mod I did to that subvi that creates such an array without using the sawtooth generator. This isn't the most efficient solution, but it's dirt simple to understand and it fits inline. Note that there's a function on the palette to create a time array from a waveform.
-Kevin P
03-10-2016 01:14 PM
It would appear that the makers of the sub_CalcVelocity.VI used the size of the array to set the sample size. Please take a look at the provided code and let me know if this resolves the issue.