ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
06-06-2019 03:52 PM
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!
06-06-2019 04:37 PM
It seems to me that it is the automatic logging that is making the stop & dispose so slow. When running the example, if I don't enter a TDMS file path, then stopping & disposing of the task takes ~50ms.
So, why does attaching a logger to an analog input task slow down it's stop & dispose so much? Are asynchronous writes being used under the hood when I call ConfigureLogging() on a task? Can I achieve better performance by doing the logging myself?
06-06-2019 06:03 PM
Update: I am going to abandon built in task logging. Using explicit logging and continuous, asynchronous analog input reads I was able to eliminate the analog input task control bottleneck.