The application we use PCI-6052E is pretty straight, based on .net and C# for development. 
 
One analog channel is setup to read the analog signals from PMT, and another counter channel is to count encoder outputs from motor driving the rotation stage. So, our goal is to use encoder counts to timestamping analog input data from PMT. 
 
The way I did for this is described below: 
 
We used the onboard internal clock for sampling the analog signals, and also use this same clock as the gate signal for activating the counter reading. 
 
In C#: 
 
{
.....
 
// set up the analog channel 
analogInTask = new Task();
                    
analogInTask.AIChannels.CreateVoltageChannel(mcPhysicalChannel, "",
                        AITerminalConfiguration.Rse, Convert.ToDouble(mcMinValueNumeric),
                        Convert.ToDouble(mcMaxValueNumeric), AIVoltageUnits.Volts);
// use the internal clock 
analogInTask.Timing.ConfigureSampleClock("", Convert.ToDouble(mcRateNumeric),
                        SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples,
                        mcSamplesPerChannelNumeric);
// create the analog channel 
analogInReader = new AnalogSingleChannelReader(analogInTask.Stream);
 
// rotation counter setup 
tkRotCounter = new Task();
tkRotCounter.CIChannels.CreateCountEdgesChannel(counterNames[1], "",
                        edgeType, Convert.ToInt64(0), countDirection);
// 
tkRotCounter.Timing.ConfigureSampleClock("/Dev1/ai/SampleClock", Convert.ToDouble(mcRateNumeric),
                        SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples,
                        mcSamplesPerChannelNumeric);                  
                                        
// 
RotCounterReader = new CounterReader(tkRotCounter.Stream);
 
// synchronization
analogInReader.SynchronizeCallbacks = true;
RotCounterReader.SynchronizeCallbacks = true;
// verification  
analogInTask.Control(TaskAction.Verify);
tkRotCounter.Control(TaskAction.Verify);
 
// specify callback functions  
analogCallback = new AsyncCallback(AnalogInCallback);
rotCounterCallback = new AsyncCallback(RotCounterInCallback);
 
......
}
 
Two tasks are created for analog and counter reading, and they share the same internal sampling clock (90kHz). 
Two asynchronized callback funtion are used to fetch the data available from the buffer. 
 
After the above configuration, we use the following C# code the start the process with a trigger signal. 
 
{
...
analogInReader.BeginReadMultiSample(mcSamplesPerChannelNumeric, analogCallback, null);
RotCounterReader.BeginReadMultiSampleInt32(mcSamplesPerChannelNumeric, rotCounterCallback, null);
... 
}
 
I am not sure whether the above configuration is correct or not, since it looks like we have some mismatch issues between the analog channel and the counter channel? 
 
Your information is highly appreciated!
 
Thanks.
 
Daniel Xu