From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

Showing results for 
Search instead for 
Did you mean: 

AccessViolationException using DigitalSingleChannelWriter.WriteSingleSampleSingleLine



Sometimes I get a System.AccessViolationException, here is the C# code:

tsk.Timing.SampleTimingType = SampleTimingType.OnDemand;
DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(tsk.Stream);
writer.WriteSingleSampleSingleLine(true, data);

This happens, if the Task "tsk" has done other actions (waveform output) before calling the StopTask.


I already found a solution for this: calling


 after stopping the task.


I'm lucky to have a solution, but now I want to understand what is happening here:

- what exactly is TaskAction.Verify doing?

- is it a good practice to call TaskAction.Verify after every TaskAction.Stop every time? Are there any risks?




0 Kudos
Message 1 of 2

Hello Jochen,


Have you had a chance to review this info?

The best way to thank, is to give KUDOS
0 Kudos
Message 2 of 2