10-04-2017 10:31 AM
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
10-12-2017 02:53 AM
Hello,
unfortunately this is an expected behavior.
The USB-6212 doesn't support the HW change detection feature.
What are you trying to do? Why HW change detection?
10-12-2017 03:03 AM
Thank you for the reply..
I wanted to check some emergency sensors and report any anomalies if they change status without having to constantly check them through my software.
My solution will be my background task that will control the state of the lines every X time.