Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Angle Encoder for Position measurement on SC-6281

Hi,

I'm trying to connect a quadrature angle encoder with 3600 ppr to the general purpose counter/timer of a M-Series SC6281 DAQmx board. We use C and have tried using the AngularPosition-Buff.c example code but to no avail. We simply want the counter to tell us the angle of the encoder at any given time....can you help ? We've wired up the encoder correctly (i.e. A connected to PFI 8, B connected to PFI 10 and Z connected to PFI 9) on an SCB-68 connecter block. The C example works as such but it sems to require an extyernal clock sample ? Why is this if we're only counting pulses ?

We also need to determine direction so any help anyone can provide will be gratly appreciated.

Cheers, Shaun.
0 Kudos
Message 1 of 4
(4,402 Views)
Just to expand a bit: We have succeeded in generating a continuous pulse train on ctr1 ?(using DigPulseTrain-Cont.c example) and we have been able to feed this into ctr2 and count it (using the BuffSemi-Period-Finite.c example)

We have also managed to feed the pulse train from ctr1 into ctr2 and use it as the sample clock for the AngularPosition-Buff-Cont.c example. The problem is we're getting gobbledygook back as results.

Can anyone help here ?


Here's our resulting code:


0 Kudos
Message 2 of 4
(4,397 Views)

Hi Shaun,

I've been having a look at your encoder code and it looks OK to me. The clock needs to be generated as the counters don't have their own internal clocks, so for buffered acquisition the clock is required to synch when to put samples into the buffer.

When you say you are seeing gobbledegook as your result, what exactly are you seeing? If you're seeing a large static value, it could mean that the counter has overrun or is even running backwards.

Which inputs are you connecting your signals into?

Best wishes,

Mark

Applications Engineer

National Instruments

0 Kudos
Message 3 of 4
(4,327 Views)

Just to close the thread on this...I downloaded the code above and ran it and it worked perfectly without any modifications.

Thanks!

0 Kudos
Message 4 of 4
(3,820 Views)