Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: sampling rate vs frequency

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  

0 Kudos
Message 1 of 4
(6,219 Views)

Hello,

I'm having the same problem. Someone has fixed it?

 

Thanks

0 Kudos
Message 2 of 4
(5,214 Views)

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

 

 

calc vel from pos.png

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 4
(5,201 Views)

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.

-Joe
0 Kudos
Message 4 of 4
(5,186 Views)