Measurement Studio for .NET Languages

Showing results for 
Search instead for 
Did you mean: 

Digital input change detection in a .NET application

I have written an application in C# that uses the IO card 6518. I am having some problems with detecting state changes for the card's digital inputs.
I am using events in order to detect input changes (Task.Timing.ConfigureChangeDetection). The problem is that the application always stops receiving input change event notifications at some point (it will work again if I restart the application).
Do any of you have any idea of why this happens?
The Task.Timing.ConfigureChangeDetection method has the parameter SampleQuantityMode which I have set to ContinuousSamples. Another parameter here is samplesPerChannel which I have set to 1000 (according to the example code that came with the NI-Daqmx 8.0). samplesPerChannel is used as a buffersize parameter when using ContinuousSamples. Can this buffer size have anything to do with the problem in the application (buffer filling up or something)?
I am also using different threads in the application for other things not related to the IO card. I don't think that this is my problem though because I have made sure that I am executing all code related to the IO card from the UI thread. The Task.SynchronizingObject parameter is also set to 'this', which is the main application windows form. All writing to the IO card's outputs are also done from the main UI thread.
The only other difference between my code and the example code that came with the card is that I set the Task.DigitalFilterEnable to true and the Task.DigitalFilterPulseWidth to 0.1 seconds.
I am also wondering if the issue could be hardware related (voltage fluctuations or something), could this be the problem?
Thankyou in advance for any possible answers.
0 Kudos
Message 1 of 1