Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Can PCI-6601 pulse signal over RTSI every Nth encoder count?

Hi All,

 

I have a PCI-6601 counter/timer connected to a quadrature angular encoder.   The 6601 is also connected to a PCI-1422 frame grabber with a RTSI cable.

 

I want to be able to trigger the frame grabber by sending a pulse over the RTSI cable every N encoder counts (or X degrees).

 

How would I go about do this using C++?

 

Thanks in advance,

Brad 

0 Kudos
Message 1 of 2
(4,566 Views)

Hi Brad,

          There are a few resources I think you may find helpful.  First, there's this DevZone article, " Generate and output pulse every no count an encoder traverses".  Generally, the way this would work is:

If you want to output a pulse every 4 counts, you will need to take the total count size of the counter (2^32 bits) and subtract 4 from this. This will be the initial count to set, so that after 4 counts, the counter will reach Terminal Count and the Counter Output Event pulse will be fired. You can then export the Counter Output Event to a PFI line, and use this line as the Z index terminal. If you set the Z index value to be equal to the initial count, the counter will always reset to 4 ticks below the Terminal Count, and will output a pulse on every 4th tick. The only drawback to this method is that it will require that only X1 decoding be used, and that the counter would have to be dedicated to sending out the Counter Output Event (if you want to actually count the encoder and keep track of position, another counter will have to be used).

 

As for specifically doing this in C++, I would recommend referencing the DAQmx C Reference Help (Start»All Programs»National Instruments»NI-DAQ»Text Based Code Support»DAQmx C Reference Help).  Hope that helps, for more assistance on the frame grabber portion of your question, I would reference the post you put in the vision forum.  Have a great day! 

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