02-23-2011 11:54 AM
My current application acquires data when it sees a TTL trigger line. Then it wait until the next TTL pulse and continues taking data until the user stop the data acquisition process. I use "counter 0" as counter source. The program works well. However I need to read digital data everytime I take AI data. I plan to use "counter 1" to read the digital data. The trick is that I need to synchronize both AI and counter 1 readings. Therefore the counter 2 will acquire data when AI acquires data.
Here is the code I implemented and would like to know if it is correct. The new code (implementation of second counter) is in the bottom part of the code. I will really appreciate your help.
Yajai
02-24-2011 06:01 PM
Hi DrObb,
What is sounds like you want to do is to specify an external sample clock for your analog acquisition and a digital acquisition. Is there a reason in particular that you're using a counter? What hardware are you using? If you simply want to sample a digital and analog channel on the same clock edge, this won't be very difficult (provided your hardware supports hardware-timed digital IO). You can find an example of this being done in C by going to:
Start » All Programs » National Instruments » NI-DAQ » Text-Based Code Support » ANSI C Examples and then navigating to Synchronization\Multi-Function\ContAI-Read Dig Chan
Regards,
Sean