Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous reading (width measure) with high frequency

Hi, everyone! At first, I work in VC++ with DAQPad-6020E. I have to process PWM signal in continuous mode with high sample rate (T=10ms Fr=100Hz). After all advices I began used General-Purpose CTR set of functions (ND_BUFFERED_PULSE_WIDTH_MSR) with double buffer. But it works not correct => I received data not with sample rate 100Hz. I receive only 25values/second!!!
I think that it's problem of double buffer. Maybe It cannot work with high frequency? But 100Hz isn't high, isn't it? 🙂
Can U advice me where is my problem? Maybe there is other methods to process signal? Can U send me example (c++ better;)

And another. I tried read data from DInput by Line and Port functions in the loop. => eve
ry iteration take 4ms!!! I don't understand how read more frequently?

Sorry, my runglish 🙂
P.S. I set source ND_INTERNAL_100_KHZ, PWM input connect to ND_COUNTER_0 (PFI9)

I collect all information in file...
0 Kudos
Message 1 of 3
(3,283 Views)
Hello;

The best way to go about that is to start with one of the NI-DAQ shipping examples that shows how to configure counters to operate as buffered event counting.

You can find that example at C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr, and the example name is STCsingleBuffEventCount.c.

Regarding your second question, the digital line update is taking that much due to the fact that board only does Software timed digital update, meaning that the digital line will be updated through Software calls. Since Windows manages all tasks on your machine, the time it takes for the digital line to update is totally system dependent.

To achieve faster rates on digital updates, you need to work with a DAQ device that allows hardware timed
updates, such as the 653x family.

Hope this helps.
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,283 Views)
Hello, Filipe

But I created my program from this source (STCsingleBuffEventCount.c), I'm only studing and use example yet ;-).
I have another question about analog doubleBuffer reading. When I read data from one channel (using DAQ_Start to initialize reading) time of reading is about data reading time, but when I read from 2 and more channels (using SCAN_Start) time of reading increased in 4 and more, why?

Of course, I used sample (DAQdoubleBuf.C 🙂

thanks for your answer
Spivot
beginer
0 Kudos
Message 3 of 3
(3,283 Views)