Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to export a clock

I have a very simple question.

I am using PCI 6534 and I would like to export the sample clock to an output pin.  The code is as following:

.....

    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev4/port0/line0:7","",DAQmx_Val_ChanPerLine));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle, NULL,1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
    DAQmxErrChk (DAQmxExportSignal(taskHandle, DAQmx_Val_SampleClock, "/Dev4/pfi2"));
.....

In the last line, I exported the sample clock to pin pfi2.  But when I hooked up an oscilloscope to pfi2 (pin 2 on PCI 6534) I observed no clock signal.  All I saw was a signal at ground voltage level.  What's wrong?

Thanks,
-Andrew

0 Kudos
Message 1 of 5
(3,519 Views)
Hello Andrew,

The sample clock for your task will not actually start until you start the task.  Try including a DAQmxStartTask function call after the configuration function calls you've already made.  Let me know if that doesn't solve the problem.

Regards,
Travis G.
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 5
(3,503 Views)
Hey Travis:

Yes I started the task using DAQmxStartTask just as you described, but still the sample clock signal was not present.

Thanks!  Please continue to help me as I am very stuck at this point.

-Andrew
0 Kudos
Message 3 of 5
(3,499 Views)
Hello Andrew,

You may just not be seeing the sample clock because of a sampling rate of the oscilloscope you are using.  The duty cycle of the sample clock pulse is extremely small, and hard to capture with a scope.  See the following Knowledgebase for more information:

KB 2VU9C4YB: Configuring the REQ Clock Output Pin for an NI 653X Device

Even though you can't see the clock on a scope due to the small duty cycle, it is probably being generated from that PFI pin.  If you have a second DAQ device with a counter, you can use that to count the edges on the PFI line in order to verify the sample clock is being exported.  I hope this helps,

Travis G.
Applications Engineering
National Instruments
www.ni.com/support
Message 4 of 5
(3,484 Views)
I see, that's correct.  Thanks,

-Andrew
0 Kudos
Message 5 of 5
(3,477 Views)