Hi,
Sometimes I get a System.AccessViolationException, here is the C# code:
StopTask(tsk);
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
tsk.Control(TaskAction.Verify);
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?
Thanks,
Jochen