Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Exception during reading port after starting changedetection Task

Hello, I have a simple question.

 

I try to read a port with NIDaq Ni9421 after starting the corresponding task:


// Create the task.

myTask = new Task();

 

// Create channel

myTask.DIChannels.CreateChannel(physicalChannelComboBox.Text, "",

ChannelLineGrouping.OneChannelForAllLines);

// Configure digital change detection timing

myTask.Timing.ConfigureChangeDetection(

risingEdgeLinesComboBox.Text,

fallingEdgeLinesComboBox.Text,

SampleQuantityMode.ContinuousSamples, 100000);

// Add the digital change detection event handler

 

myTask.SynchronizeCallbacks = true;

 

 

myTask.DigitalChangeDetection +=
new DigitalChangeDetectionEventHandler(myTask_DigitalChangeDetection);

// Create the reader

myDigitalReader = new DigitalSingleChannelReader(myTask.Stream);

 

// Start the task

myTask.Start();

 

bool[] data = myDigitalReader.ReadSingleSampleMultiLine();

 


After reading the port I get the Exception Error -200284

Some or all of the samples requested have not yet been acquired. To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

 

What do I have to change to get my code running. I there a method to wait until all samples are acquired.

 

 

Thanks for your help

0 Kudos
Message 1 of 2
(3,074 Views)

Hello Aldo Platz,

 

please have a look at the following KB, which explains this error:

 

Why Do I Get Error -200284 from my DAQmx Read VI?

 

hope this helps,

Tobias

0 Kudos
Message 2 of 2
(3,059 Views)