Measure a Frequency of Zero Without Getting Timeout Error -200284

Updated Dec 17, 2023

Reported In

Software

  • LabWindows/CVI
  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

When measuring frequency using a DAQmx counter task, the task will timeout and return Error -200284 occured at an unidentified location, when measuring a frequency of 0 Hz. 



In LabWindows/CVI, this can be avoided with custom error handling. In the error callback within your main while loop, create an if statement comparing a created int error to the error # you're experiencing. If they match, do nothing, effectively ignoring the error. Then, in the else statement, have all the normal error handling that is present in the included NI examples. 

Solution

Error -200284 indicates that the DAQmx task is trying to read samples that have not been acquired yet. To stop this error you can set the timeout to -1 but this will not display a frequency of zero only the most recent value.
To display a value of zero for frequency you must allow the system to timeout then manually enter a value of zero into the frequency output and remove the error.

Counter 0Hz. vi shows how to accomplish this. The While Loop that implements this solution is shown below.

If an error occurs, the case structure will pass a frequency value of zero to the Frequency indicator.

               

Additional Information

For this example to work the inputs must be configured correctly:
  • Timeout must be set to the period of the smallest non zero frequency you want to measure.
  • Samples per loop is used to control the timing of the loop as the DAQmx task uses Implicit timing.
  • The Minimum frequency should be the lowest non zero frequency you want to measure.
  • The counter and ports must lineup with your hardware configuration.