Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Read the position and rotary direction of encoder with lab-pc-1200

Hello

I need to read the position and the rotary direction of an encoder with my DAQ (LAB-PC-1200). I know that I can use the Channel Z of encoder as a trigger and one of channel A or B as scan clock but then I can know the rotary direction of encoder. How can I do it without use aditional hardware.

thanks!
0 Kudos
Message 1 of 5
(3,804 Views)
Have a look at the following URL:

http://digital.ni.com/public.nsf/websearch/C6C6632A54DBA7DD86256275005E18E2?OpenDocument

Lab-PC-1200 is a non-E Series board, so the paragraph that applies to you is the following:


"The AM9513 counters (the STC found on some other National Instruments data acquisition boards, including the non-E Series MIO boards) will also work. What you do is use two counters. Make one count when rotating in one direction. The other counts when rotating the other direction. So make the counters count when the gate is high. For example, Counter1 counts when phase B leads phase A and Counter2 counts when phase A leads phase B. Put phase A into Source1 and phase B into Gate1. Also put phase B into Source2 and phase A into Gate2. You can fi
nd the total amount of rotation by subtracting the count of Counter1 from Counter2."

Hope it helps.
César Verdejo
Training and Certification | National Instruments
0 Kudos
Message 2 of 5
(3,804 Views)
Thanks for the answer.

But, if I have the Lab-pc-1200 where the counter timer chip is 8253 then I can't use the AM9513,becouse these are for counter timer 9513?
Then I have to use the VI's that suport 8253, as a ICTR Control. Is this correct?
0 Kudos
Message 3 of 5
(3,804 Views)
You are right.
The strategy to follow to know encoder position/velocity is the same for 9513-based and 8253-based counters. However, the way of programming differs.
For 8253-based counters you have to use ICTR Control.vi
You can download an example from:
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3EBE356A4E034080020E74861&p_node=DZ52327&p_source=External
César Verdejo
Training and Certification | National Instruments
0 Kudos
Message 4 of 5
(3,804 Views)
Thanks!

One more question about my aplication.
I want to acquire for every encoder position, one sample fom analog imput.
I can do it using the Channel I of the encoder as a trigger and Channel A or B as a scan clock, but then I don't know who to take the rotate direction and velocity.
I can't use the counters whith ICTR Control.VI becouse I'm using OUTB1,of counter B, as a scan clok.

The question is how can I take the rotate direction and velocity using the first option (trigger and scan clock).

Thanks
0 Kudos
Message 5 of 5
(3,804 Views)