Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 1999

Change Detection on single line don't work C#

$
0
0

Hi, 

I'm trying to developp an application to detect the change in a single line of my NI USB-6212.

My code is this:

 

// Create the task.
myTask = new Task();

// Create channel
string channelName = "Dev1/port0/line0";
myTask.DIChannels.CreateChannel(channelName, "", ChannelLineGrouping.OneChannelForEachLine);

// Configure digital change detection timing
myTask.Timing.ConfigureChangeDetection(channelName, channelName, SampleQuantityMode.ContinuousSamples, 1000);
myTask.SynchronizeCallbacks = true;
myTask.DigitalChangeDetection += MyTask_DigitalChangeDetection;

// Create the reader
myDigitalReader = new DigitalSingleChannelReader(myTask.Stream);

// Start the task
myTask.Start();

But when I run the code line: 

myTask.Timing.ConfigureChangeDetection(channelName, channelName, SampleQuantityMode.ContinuousSamples, 1000);

I  have this exception: 

Error=-200077

Message="Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property."

Property: NationalInstruments.DAQmx.Timing.SampleTimingType

Requested Value: NationalInstruments.DAQmx.SampleTimingType.ChangeDetection

Possible Values: NationalInstruments.DAQmx.SampleTimingType.OnDemand

Task Name: _unnamedTask<0>

Status Code: -200077

 

Does anyone have any idea what is the problem ?

 

Thank you in advance for your answers

 


Viewing all articles
Browse latest Browse all 1999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>