Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Detection stop detecting changes

Well the title pretty much say everything!

 

I'm using an NI-9401 module in an NI-9178 cDAQ chassis and try to configure change detection on some digital lines. For the development I'm using a momentary push button switch to trigger the change events. It works for a few on/off transition and then stops registering any change (no error message generated). This is my main issue.

 

A minor issue is that warning 20010 is always issued at Stop Task.vi when I stop the vi, even when there is no change on the digital lines (just start/stop the vi).

Error 200010 occurred at an unidentified location

Possible reason(s):

Finite acquisition or generation has been stopped before the requested number of samples were acquired or generated.

 

And last point, if I used 2 DI lines in my change detection task what would be the simplest/efficient way to identify which line triggered the change detection event.

 

Here is the code I'm using fot development:

ChangeDetectionIssue.png

 

Ben64

0 Kudos
Message 1 of 2
(2,528 Views)

1. Given the 200010 warning, it appears that by not wiring the sampling mode in DAQmx Timing.vi, you've defaulted to Finite Sampling.  My guess is that the default # samples used when unwired is small enough that a few toggles fills the buffer and ends the task.  Note that some mechanical buttons may produce multiple transitions per button press, hence the common use of debounce filters and algorithms.  Here, bounce would produce a lot more change-detection samples than you would have expected.

 

2. As far as I know, you'd have to cumulatively track the state of all the lines in your change detection task in order to know which specific one(s) changed on any given sample.  When the states of those lines are unchanging at program start, a technique I've used is to first configure a regular software-timed DI task to query the initial state of those lines, then stop & reconfig for change detection.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(2,490 Views)