Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Fast Time Measurement (< 1ms) from start to a change in state of any of 2 signals from an encoder

I have a 2 channel encoder on a motor and I want to determine the time from powering on the motor to a change in state of either of the 2 channel on the encoder. It is usually less than 1 millisecond.
So, I wanted to know how to set up my DAQ 6025E card to find that time.
Can you guys please help?
Thanks!
0 Kudos
Message 1 of 3
(3,182 Views)
Opps....forgot to mention OS, working in window 95 and up and using Visual Basic 5 and up.
Additional information, I am looking for setup code in VB if that is possible.
Right now my ch A signal is hooked up to CTR1_Source and ch B is hooked to CTR0_Source and I have a external trigger connected to CTR1_Gate. Am I doing that correctly?
Thanks!!
0 Kudos
Message 2 of 3
(3,182 Views)
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
0 Kudos
Message 3 of 3
(3,182 Views)