I am using the NI-DAQ API's in VC++ environment, to output X, Y Voltages to analog ports. Just after the output of these, I start a General purpose counter to count number of digital pulses, the gate pulse being generated by an internal 20MHz time base and fed to the counter. (Used the example STCsingleBufEventCount.c ). The task on hand now is to synchronize the analog voltage output with the Gating signal. I would like to output the analog voltages when the Gating signals leading edge occurs. How to detect the Gating signal and issue the API command AO_Update (iDevice) for writing the analog voltages simultaneously.