Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

DAQmxWriteCtrFreq starts out taking 3 ms to execute and then ends up taking 890 ms 24 hours later.

$
0
0

I have a program that updates CTR/TMR channels for variable PWM signals at 1 Hz.  As the title of the thread states, the function call for the update takes longer over time.  It isn't a continuously increasing amount of time.  It seems to be in steps.  This is messing with the timing of my application.

 

Here is the function call:

DAQmxErrChk(DAQmxWriteCtrFreq (pwmTaskHandle, 1, 1, 2, DAQmx_Val_GroupByChannel , Freq, DC, 0, NULL));

 

I put a timer around this call using clock();  I started the test at 8:35 yesterday.  By 21:35 it was 68 ms, and by this morning around 23 hours later it was 890 ms.

 

DieselPower_0-1769608738002.png

 

For now I am going to get around it by only calling the function if there is a change in duty cycle for any of the channels.  I may also need to pass it off as a thread.  I would still like to know why it is becoming less efficient over time.  The DAQ device is a cDAQ 9401 on a USB 9178 chassis.


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>