Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware Timeing with Encoders using NI M-series card

Dear All:
             I got a NI 6221 DAQ card.  The NI example Gen Dig Puls.vi was used to generate a pulse train on one counter and connected to the Sample clock  source (PFI6)  (that we are using ) which was called source A to make clear.   Another counter was used to acquire the encoder reading of a wheel using the NI examples "Meas Angular Position-Buffered-Cont-Ext Clk.vi". The sample clock source comes from the source A. It was working well!  It would not work when I replaced the Sample clock souce with a function generator with the same sampling rate as I want to use two counters to acqure data from two encoders without using one counter to generate pulse train.  Do you have other ways or vi program to use hardware timing  for M-series cards?  Comments are greatly appreciated!
 
 
best regards,
zibin Song
0 Kudos
Message 1 of 2
(3,355 Views)

Hi,

  did you put a scope on the function generator. It's possible that it wasn't generating a perfect signal, and the card being sensitive to extra "glitchy" edges thought that it was the actual clock edge to trigger off.

You could, if you're not using the AI or the AO part of the board at this time, use the sample clock from there, internally routing it to the appropriate gate or source of the counter as requried in the code. You'd just need to setup a continuous acquisition or generation task and then the rate of acquisition / generation generates an internal clock source for you.

I've included an example of this which should work for your two counter setup

Hope that helps

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 2 of 2
(3,288 Views)