Why Do I Have Delay When Using WriteSingleSampleSingleLine in .NET?

Updated Jun 29, 2018

Reported In

Hardware

  • Digital I/O Device
  • NI-9476

Driver

  • NI-DAQmx

Programming Language

  • Visual Basic .NET
  • C# .NET

Issue Details

I want to generate a single pulse using software timing in NET. 
When calling the functions WriteSingleSampleSingleLine , I see a delay of several msec.
Why?
 

Solution

In order to make faster calls, you will need to manually force the task action from the Running state to the Committed state by using the function:
task.Control(TaskAction.Start); 
after the DigitalSingleChannelWriter function.
and before the WriteSingleSampleMultiLine set as false

When finishing writing, you can put the task on a commit state by using the function
task.Control(TaskAction.Commit); 
 

Additional Information

Using the Start, Stop and Disposed functions you could improve performance by keeping the tasks in the Running and Committed state. This state basically uploads the configuration to the hardware so it's ready for the signal to be outputted. 
 
The task state model consists of five states—Unverified, Verified, Reserved, Committed, and Running. You call the Start Task function/VI, Stop Task function/VI, and Control Task function/VI to transition the task from one state to another. 
 

WAS THIS ARTICLE HELPFUL?

Not Helpful