Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting on one port and generating on another.

Hello,

I have a NI 6220, and I need to use one counter to count the ticks of an encoder. The other port is being used to generate a finite tick count for driving a stepper motor.

After reading on the forums, I understand that Counter 1 is used to generate a finite pulse train on Counter 0 (or vice versa. My questions are

1. Is that correct? Do both counters REALLY need to be used to generate a single pulse train?

2. How do I work around this? Is there any other way to generate a finite pulse train using only one counter?

Thanks,
-James
0 Kudos
Message 1 of 5
(4,006 Views)
Can I use a counter to start/stop the freqency generator instead of using a counter to start/stop another counter?
0 Kudos
Message 2 of 5
(3,989 Views)
idbeu

Unfortunately, you cannot use a pause trigger on the frequout counter. And you are correct about the two counter requirement for a finite pulse train generation. Note that you only need a single counter for a continuous pulse train generation. Also, if you are not using your AI or AO circuitry, you could set up a "dummy" analog task and export its clock. For a finite acquisition / generation, you could control the exact number of ticks. Would this be an option?

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 3 of 5
(3,983 Views)
I'm using some AI/AO, but not all (and I'm not using any of them at the same time I want to use the counter). How do I use their clocks?
0 Kudos
Message 4 of 5
(3,979 Views)
1. Ryan's idea to use either the AI or AO subsystem to generate the finite pulsetrain is your best option.
 
2. To use one (let's just say AO), you'll need to stop the AO task that's used at other times and reconfigure it for your stepper control needs.  Specifically, you'd call DAQmx Timing to define a "Finite Sampling" task, setting the # samples and sample rate to the # steps and step rate you need.
 
3. Next you'll probably need to configure to explicitly export the AO sample clock out to a physical PFI pin.  You'd probably use a call to DAQmx Export Signal (sorry, I'm going by memory as my LV computer isn't near my network hookup) to accomplish this.  The M-series boards are quite flexible for signal routing, so you can probably export to any unused PFI pin you like.
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 5 of 5
(3,978 Views)