06-01-2012 02:22 AM
I'm trying to use a cDAQ-9171 USB / NI9411 combination to make continuous frequency measurements with the code joined to this post.
Most of the time, this code behaves as I expect it to, but it occurs that the "counter read" returns an empty table, and this is not expected as far as I can say. I must be missing something, anybody as an idea of what ?
06-04-2012 05:04 AM
Could you give more details ?
For wich frequency, you see an error, is it for high or low frequency ?
As I can suggest is to increase the timeout to 1 or 10ms, just to be sure we have time to measure a frequency ;-). If you set this value to 0, the function try to read the data in the buffer one time and you will have an erreor if there is no data.
06-04-2012 05:29 AM
Thanks for taking the time to help, Christophe.
Sure, I can give more details. I've had "empty tables" for frequencies in the order of 50 - 500 Hz, whatever the signal frequency.
"Playing" with the timeout value does not lead to any different behavior, even using up to several seconds timeouts for the read counter function. Morevoer, There should always be enough time to get new values, because of the explicit "wait for ms" in each loop. BTW, I've also verifiied that the time difference between to loop iterations (output of the "wait for ms" function) are regular.
Any more ideas ?
06-05-2012 07:39 AM