LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx digital change detection reconfiguration

I want to capture a timestamp every time a sample passes through my photo-sensor. I have a system in which I have connected the digital output of my photo-sensor to a digital input channel. I am monitoring the digital line using a DAQmx task with Change Detection event registration, derived from this example: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000004AvPSAU&l=en-US

The issue I am seeing is that I am acquiring more "change events" than I expect. My hypothesis is that the change detection code is not "re-arming" after the first change has been detected, and DAQmx proceeds to just sample at the rate of the while loop. The reason I think this is because when I hold my finger in the photo-sensor for 0.5-1sec, I am logging >20 timestamps, each of which should be tied 1:1 with a change event.

 

Does anyone have any experience with this use case? I am curious if I could make some changes in my code to "re-arm" the change detection task. 

0 Kudos
Message 1 of 2
(856 Views)
  1. You are monitoring Change Detection Events in both directions, are you sure you want that?
  2. A photodiode/photosensor is really not a digital line. How's is it wired, what kind of signal conditioning is being used for it? Seems like you want a threshold trigger on the photodiode.
0 Kudos
Message 2 of 2
(835 Views)