Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

6220 Error Code -200141

I am using a PCI-6220 to measure a period.  The frequency of the flow meter is between 1000 and 10000 Hz.  I randomly get error code -200141.   My DAQ subvi is  running  at 10  hz and I am measuring all periods.  My buffer is set to 10000.  At the highest frequency the vi should measure 1000 periods and data should not be overwritten before it could be read.  What  am I doing wrong?

To configure the DAQ I am using

    DAQmx Create Channel  (CI-Period)
        MIn period is 0.00005
       Max period is 1
       Starting Edge is Falling Edge
    DAQmx Timing (Implicit)
       Continuous Sampling
    DAQmx Configure Input Buffer
       10000
    DAQmx Start Task

To read the period I am using

    DAQmx Read (Counter 1D DBL 1 Channel  NSamples)
       number of samples per channel is -1
       timeout is 0

0 Kudos
Message 1 of 5
(4,220 Views)

Hi,

So the error you are seeing is not related to the 10000 sample buffer size that you are setting programmatically. That buffer is on the RAM on your computer. The error actually has to do with the 2 sample buffer on the device itself.

Make sure that your application is transferring the data via DMA channels and not interrupts. This should be the default setting. Another possibility is that there could be some noise on your signal and that the program could actually be trying to take more period measurements than you intend. Creating a lowpass filter could help alleviate that problem. I hope that you find this information helpful.

Regards,
Hal L.

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

How do you check or change the data transfer method?

Thanks,

0 Kudos
Message 3 of 5
(4,193 Views)

Hi,

The information that you are looking for is in the NI-DAQmx C Reference Help. This help file lists all of the text based functions available with the DAQmx driver and provides descriptions as well. It is located in Start >> All Programs >> National Instruments >> NI-DAQ.

Once you have the file open, go to the index tab and enter in "data transfer methods." This will give you a more thorough description of DMA vs. Interrupts.

You can find the functions to see what method your application is using/change this method by to NI-DAQmx C Properties >> List of Channel Properties >> Counter Input >> Advanced >> Data Transfer and Memory.

Regards,
Hal L.

0 Kudos
Message 4 of 5
(4,171 Views)
Thanks you for your help.  I found it after I posted the question and forced my daq to DMA but the problems still happens.  I can only assume that the orginal method was already using DMA and the problem maybe with my single.  I am probably going to install a Schmitt trigger to square up my input signal. 

Thanks,

0 Kudos
Message 5 of 5
(4,165 Views)