Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter triggering

Hello,
 
I'm creating a program to control a gear tester. It works by driving a master gear which drives a test gear which is on a spring loaded slide hooked up to a linear probe. Both the motor's encoder and the linear probe have quadrature outputs. These are wired into a PCI-6602. Currently, I am reading from these simultaneously in a while loop that occurs at a set time interval. What I would like to do is set my program up such that data is taken from the linear encoder every 5 or 6 pulses from the motor encoder. I'm assuming I would use a trigger for this, but I can't seem to figure it out. Got any advice?
 
Thanks
0 Kudos
Message 1 of 2
(3,500 Views)
Hello Wildcat,

I think a buffered counter program is the way to go.  There is a shipping example called Meas Angular Position-Buffered-Cont-Ext Clk.vi.  This example takes data from an angular encoder every time it sees a tick on PFI9.  You could modify this example to use a linear encoder by changing the DAQmx Create Channel to Counter Input > Position > Linear Encoder.  You could then feed the pulse from your motor encoder to PFI 9.  Now this setup will read data on every motor pulse instead of every fifth/sixth.  You can get around this by simply ignoring the extra data or by using another counter to divide down your motor pulses.  Give the example a look and tell us what you think.  

Best Regards and congrats on the Gillespie hire,

Jeff Tipps
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,483 Views)