Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to latch encoder value on an index with a PCI-6602

I am currently using a PCI-6602 to read 6 encoders for a 6-axis positioner.  Because these encoder values are being used in a feedback system, I can not have them jump to zero when the index is crossed.  Instead, I would like to latch the encoder value when crossing the index.  Then, I can stop the positioner and change the encoder value and the command in a controlled way.

If I can't latch the encoder value, is it somehow possible to route (in software not hard wire) the A, B, and Z signals from one counter to a spare counter.  Then I could have one of the counters zero on an index and the other not zero.  After the index is crossed, I could stop the axis in question and read both encoders to determine how far I was from the index.  During the homing routine, I could repeat this for all 6 axes. 

I also have a PCI-6220 and a PCI-6733 in the system, if their counters would help.

I am using Linux and DDK

Many Thanks,
Greg
0 Kudos
Message 1 of 5
(7,917 Views)

Hi Greg,

You can route the counters internally on the PCI-6602 because each counter comes as a pair that you can route internally. I've linked some resources below, but since you are using Linux and DDK, the most applicable may be the Register Level Programming Manual found under PCI-6602 Manuals.  I'm assuming otherwise that you are using DAQmx Base for Linux and I searched the C Function help for the driver and found the function "PairedCtrOutputPulse" through a search that should help you if you decide to go that route.

KnowledgeBase: How Do I Internally Route a Signal from One Counter to Another on the PCI-6602 board?

PCI-6602 Manuals

Good luck,

Alex A.
Applications Engineer
0 Kudos
Message 2 of 5
(7,904 Views)
Hi Alex,

Thanks for the fast response.  I took a look at the example you listed, how to route a signal from one counter to another.  I think because I am using 6 of the counters simultaneously I don't think I will be able to take advantage of the counter pairing.  They also mentioned in the example that if you could not use the pairing that it is possible to use the RTSI bus.  Looking at Figure 3-7 (RTSI Signal Connection Scheme for PCI) in the NI 660x User Manual it appears that you can route the source, gate, and aux of a counter to and from the RTSI bus.  In the NI 660x register-level manual, I can see where you can use the signals from the RTSI bus by using the Gi Input Select Register and the Gi Second Gate Register.  How would you output the source, gate, or index to the RTSI bus?

I have all six encoders working with the first six counters of the 6602.  Do you think it is possible to set up the seventh counter to read an encoder, but instead of hardwiring the encoder to the seventh counter, use the signals from the RTSI bus? 

Thanks again,
Greg
0 Kudos
Message 3 of 5
(7,893 Views)

Hi Greg,

So from what you are saying as I understand it, you want to route the Counter 7 lines to the RTSI lines so that you can input on those lines?  If that is correct, then you simply need to route the corresponding PFI lines to the RTSI lines.  In this case, I used MAX to determine the PFI lines for counter7 (9 Source,10 Gate, &11 Aux).  You then simply use the route commands mentioned in both manuals or the previously mentioned Knowledgebase to connect the various RTSI and PFI lines.

Regards,

Alex A.
Applications Engineer
0 Kudos
Message 4 of 5
(7,853 Views)
Hi Alex,

Yes, say I want to configure counter 7 to read the encoder that is physically hooked up to counter 0.  I want to route counter 0's gate, source, and aux (PFI 39,38, and 37) to the RTSI bus.  Then I would like to route the corresponding RTSI lines to counter 7's gate, source, and aux (PFI 11,10, and 9).  I am using DDK not the DAQmx.  Looking through the NI-6602 register level manual, I can not find any information on routing to the RTSI bus, I only see where it is possible to use signals from the RTSI bus.  Is this possible?  Are there missing registers in the NI-6602 register level manual?

The reason I want to route internally, is because while the above example would output counter 0 to counter 7, I want to be able to switch from counter 0-6 to counter 7 in software.

Another way would be to route any PFI to PFI pins 5, 6, and7 then I could hardware pins 5, 6, and 7 into counter 7.  I just can't find any information on the register levels regarding routing PFI signals.

Thanks again for your help,
Greg
0 Kudos
Message 5 of 5
(7,843 Views)