Minh;
I'm not sure if I understood your application, but I'm assuming you have a two channel encoder that will mirror the state change of the motor and another pulse that will make the motor to change its state. If that is the case, you want to record the time in between the event of that pulse and the pulse of either one of the encoders.
If that is the case, the only way to accomplish that will be to have an external OR gate ORing both the trigger pulse and encoder pulse, have the output of the OR gate going to the gate of the counter and configure the counter as Buffered event counting. Actually, since you want to do that in both encoder channels, you need to repeat the setup for each encoder channel using both counters available on your board.
After tha
t done, since you know the trigger pulse will happen before the encoder pulse, you know that the counter will buffer first the count value at the event of the trigger pulse and then buffer the count value at the event of the encoder pulse. You will need just to subtract both values and multiply the result by the TimeBase you connected to the counter source.
Hope this helps.
Filipe A.
Applications Engineer
National Instruments