Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse width measurement input buffer size and basically comprehension

Hello,

first of all i want to excuse me for my english 🙂


Description of the Problem:
I have to measure pulse width using nidaqmx. So far it works. I create a task and do all necessary settings for timing and so on (DAQmxCreateCISemiPeriodChan...).

The way i do the measurement is the following: I read out a set of samples from the NIDAQmx-internal buffer. Before that i limited this buffer to 2048 Samples (just a testing size) using the "DAQmxCfgInputBuffer". I tested it before read out the samples by "DAQmxGetBufInputBufSize" and get the correct size of 2048.

Now i connect - for example - a 1kHz PWM-Signal to the counter input and start measurement. From my point of view the internal buffer should be overwritten after capturing 2048 samples. After 20s i change the signal to a 20Hz PWM-Signal. When i am repeated reading out the internal buffer using "DAQmxReadCounterF64(...)" i can get the whole generated samples of the first 20s (1kHz-signal) of testing. Not till then i get the results of the 20Hz-signal. How could this be if the internal buffer really is limited to 2048 samples?

Intention is to continually read out the PWM-Signal. As second functionality the last captured sample should be given back if required. I thought i could do this by read out the whole sample-buffer, check how much have been read and giving back the one with the highest number. By the way: it is no problem if i loose a series of samples between two readouts!

Problem is: let assume for 5 minutes a PWM-Signal lies on the ci-port but i don't need to read it out. But after this five minutes the signal becomes important and i have to check it. Now would like to read out the internal buffer (last 2048 samples) and filter out the last sample. To can do this i first have to read out every previous samples (in extrem case 1.000.000) to get the actual ones???

Is my setting incorrect? Do i understand something wrong? I read that NIDAQmx set internal buffer size by sample-rate. Measuring semi period i can not set sample rate. And i read out the internal buffersize correctly.

Please help 🙂

Thanks forward
Andreas
0 Kudos
Message 1 of 4
(2,961 Views)
Hello Andreas,

just a few questions to give you a special answer on your problem:

- What hardware are you using?
- What driver are you using?
-> To answer these questions, could you please post a MAX-protocol: (assuming you are using a German System) Datei->Protokoll erstellen->Technischer Support->Mein System

Could you please post your code that shows your problem?
National Instruments
District Sales Manager
0 Kudos
Message 2 of 4
(2,935 Views)
Hello oyster,

you can find both requested files as attachment. In the c-code in the NISupport1.c-file i just copied necessary information together, cause the whole code is much more.

Thank you
Andreas



Message Edited by Germanherman49 on 04-28-2008 06:04 AM
Download All
0 Kudos
Message 3 of 4
(2,928 Views)
Hello,

sorry for the long delay, I have been out of the office. Does your problem still persist?

I have looked into your code and I'm not sure, if the taskhandle is the same for your task and for the buffer configuration. Why don't you define both exactly the same?
National Instruments
District Sales Manager
0 Kudos
Message 4 of 4
(2,765 Views)