Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

X4-Encoder application combined with interrupt

My intention is it to realize a X4-encoder reader (A,B,Z - channel). This works quite fine, i just modified the gpct_ex7.cpp file for the reset, to reload my counter with a puls of the zero channel.

So the counter will allways have the value i want.

What I like to add is to transfer the counter value via HW/SW register on a rising edge of a gate-impuls.

The encoder itself allready uses 3 input pins, thats A(PFI37, Pin40, UP/DOWN_0),B(PFI38, Pin3, GATE_0) and Z(PFI39, Pin2, SOURCE_0/AUX_LINE).

Well for the gate i would need an other on, to start the interupt?

Anyone has an idea, if i can have a fourt input line on the counter, to transfer the counter values into the HW/SW register and transfer them than with
an interrupt handler to pcmemory?

Maybe I can use an other counter to do so, but well at least on TIO0 allready use all the counters, so i maybe have to access the second TIO1?

I use Redhat 8.0 and Kernel 2.4.18 with the DDK.

Thanks a lot

Mario Behn
0 Kudos
Message 1 of 2
(8,072 Views)
Mario;

There is no way you use a fourth counter input due to the hardware limitation. You can also use another counter to do that, however, you won't have the ability of hardware reset it, neither to use the counter's gate input for a encoder channel.

Regards
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(8,072 Views)