Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9423 Simultaneously get speed, direction and total count of 4 quadrature encoders

Hi,

 

I am using the cDAQ-9178 chassis and the 9423 card connected to 4 quadrature encoders. I am programming in C# using the National instruments DAQmx DLL.

 

I have a few questions:

 

1. Can I change the PFI connections for each counter? I would like to connect 4 quadrature encoders A&B signals to the module such that:

Encoder 1 A -> PFI0

Encoder 1 B -> PFI1

Encoder 2 A -> PFI2

Encoder 2 B -> PFI3

Encoder 3 A -> PFI4

Encoder 3 B -> PFI5

Encoder 4 A -> PFI6

Encoder 4 B -> PFI7

 

2. I need to get speed (RPM), direction and count from 4 quadrature encoder simultaneously. Is there a virtual channel that does all of this or do I need to use seperate virtual channels and combine them into one task?

To count I think I should use CIChannels.CreateCountEdgesChannel. To get the speed I think I should use CIChannels.CreateFrequencyChannel. Is this correct?

How would I get direction?

How can I make sure that count goes both up and down when the quadrature encoder direction is reversed? I think I would use the direction to toggle the count up/down?

 

What is the best way of doing what I need? 

 

Thanks in advance

 

Joe

0 Kudos
Message 1 of 2
(6,070 Views)

Dear Joe,


Thank you for posting this; have you been able to make any progress with this issue?  My knowledge of C# is rather limited but I was able to find this community example that you may find useful ( https://decibel.ni.com/content/docs/DOC-16563 ).

 

Kind Regards,

Robert Ward
Applications Engineer, NI
0 Kudos
Message 2 of 2
(5,969 Views)