Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1250

Synching Counter Start to Analog Output Start

$
0
0

Hello,

 

I am using NIDAQmx to send signals that control the line and frame acquisition of an imaging device, with the code being written in C++. I have attached the portion of the code that deals with my current issue and removed the irrelevant sections.

 

For context, I have an analog signal controlling a scanner which should be synced to a counter that handles frame acquisition. The analog signal is a triangle waveform, with one slope encompassing one low and high pulse of the counter (I have illustrated the expected oscilloscope output below)

Expected Oscilloscope outputExpected Oscilloscope outputThe issue that I have been running into is that the analog signal experiences latency, and ends up being very slightly delayed from the start. Instead of being perfectly aligned at the start of the low pulse as shown above, the "peaks" and "valleys" fall somewhere in the middle of the low pulse.

 

Unfortunately, this delay is different at every startup so adding a constant initial delay does not solve the problem. One solution I have tried implementing that did dramatically decrease the delay (but not entirely) was to pre-commit the tasks before starting them. I am skeptical that the solution would have something to do with the sample clock, as the signals are being sent at the same frequency.

 

I am hoping that this is not an uncommon problem or that there might have been a C++ function I overlooked. However, if this delay is inevitable, I can try to account for the delay in the post-processing step (of course, this is much less desirable). Any help or other suggestions would be greatly appreciated!

 

- Morgan

 


Viewing all articles
Browse latest Browse all 1250

Trending Articles



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