Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 1999

Why does stopping & disposing of task in TdmsContAcqVoltageSamples_IntClk_LogOnly example take so long (~500ms)?

$
0
0

Hello,

 

If I run the TdmsContAcqVoltageSamples_IntClk_LogOnly example under "National Instruments\NI-DAQ\Examples\DotNET4.5.1\Analog In\Measure Voltage" and I modify the stopButton_Click() function as follows and run the example:

            if(myTask != null)
            {
                var sw = new Stopwatch();
                sw.Start();

                // Dispose of the task
                myTask.Stop();
                myTask.Dispose();
                Debug.WriteLine("Stop & dispose time (ms): " + sw.ElapsedMilliseconds);
                myTask = null;
                stopButton.Enabled = false;
                startButton.Enabled = true;
            }

I am seeing the following print out:

Stop & dispose time (ms): 495

I am seeing similar (even higher) stop & dispose times in a custom application that uses a very similar analog input task. The lengthy time the stop and dispose operations take on an analog input task that is only logging is making it difficult for me to meet timing requirements in my application.

 

Why on earth does it take half a second to stop the analog input task and dispose of it? Is there any way I can improve the performance of these operations?

 

Thanks!


Viewing all articles
Browse latest Browse all 1999

Trending Articles



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