Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

With the linux c API, how can I decimate the clock to a 10 kHz signal?

Solved!
Go to solution

Hiya.  I know the clock signal is decimated on the board in a couple places... is there a function in the linux c api to export a decimated signal?  Can I choose any arbitrary decimation, or am I limited to the various timebases used on the card (an M series in my case)?

 

Thanks!

0 Kudos
Message 1 of 5
(3,379 Views)

I'm assuming you're wanting to output this signal though a digital out/pfi line?

 

If so I know you can do this using DAQmxCreateCOPulseChanFreq and you can specify the exact frequency you want. This ends up consuming one of your onboard counters. The M-series manual talks about using an onboard frequency generator as well, although I I haven't found the function calls for that, if I do I'll post them.

Message 2 of 5
(3,364 Views)

Ok so I found this: http://digital.ni.com/public.nsf/allkb/0A3749841F401BC186256F90007C7F72

 

If you want to use the Frequency Generator instead of the Counter  you need to do is specify: /Dev#/freqout instead of /Dev#/ctr#

 

This is slightly less flexible than using a counter as a frequency generator as there are on a few frequencies that the card is capable of generating.  

0 Kudos
Message 3 of 5
(3,362 Views)
Solution
Accepted by topic author ImAlsoGreg

Are you using DAQmx (either 8.0 or 8.0.1)?  If so, you have a few options:

 

    Counter Output:  Available frequencies are {80 MHz, 20 MHz, 100 kHz, external} / {2 : 232-1}

 

    Frequency Output:  Available frequencies are {10 MHz, 100 kHz} / {1:16}

 

    Export Clock from AI or AO Task:  Available frequencies are {20 MHz, 100 kHz, external} / {2 : 232-1}, but going too fast will result in a hardware clocking error on the ADC or DAC.

 

 

On M Series DAQ there are two counters, a single Frequency Output, a single AI timing engine, and a single AO timing engine (if your board supports AO).  Just pick whichever subsystem you have available.  If you only need a constant 10 kHz then the Frequency Output is perfectly adequate, it's programmed similar to a Counter Output (reference Dev1/freqout instead of Dev1/ctr0). 

 

If I recall correctly (I'm on Windows at the moment), on Linux the DAQmx ANSI C examples should be installed in \usr\local\natinst\nidaqmx\examples.  There should be a continuous counter output example included.

 

 

Best Regards,

John Passiak
Message 4 of 5
(3,360 Views)

Thanks John and Stuart!  I'm successfully using the counter output.  Looks great!

0 Kudos
Message 5 of 5
(3,317 Views)