Germanherman49
2008-04-25 13:40:10 UTC
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 forwardAndreas