I program with LabVIEW so I'm afraid I can't offer any C++ sample code. But here's some info on the hardware:
Your 6052E produces an internal signal called "AI SCAN START" (sometimes called "STARTSCAN" in the docs). In LabVIEW, one can call Route Signal.vi to push that signal out to the terminal block on pin 38. Plan to do that with NI-DAQ calls from your C++ program. Then a pulse will be produced on pin 38 once for each scan of AI channels.
Physically wire from pin 38 of the 6052E to one of the "Gate" pins of your 6601. Specify that Gate pin when you set up your buffered encoder acquisition. That'll give you one sample of encoder position for each scan of analog channels. Voila! (Well, except for the actual C++ implementation details...)
-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.