From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Output clock on general data pins using 6536?

Hello,

 

   I have an NI PCIe-6536 DIO card, using latest DAQmx drivers, using C language.

 

   I would like to output the sample clock (or other clocks) on a few general DIO pins, like port0/line3 and port1/line6.

 

   What's the best way to accomplish this?  Is it best to use Task-based or 'independent' signal routing?  Am I missing a code example that will make my question seem even dumber?

 

   This seems to work when I try to connect to PFI4:

 

    DAQmxErrChk (DAQmxConnectTerms("/Dev1/DO/SampleClock","/Dev1/PFI4",DAQmx_Val_DoNotInvertPolarity));

  However when I try to also connect that terminal to port0/line3 I get an error:

    DAQmxErrChk (DAQmxConnectTerms("/Dev1/PFI4","/Dev1/port0/line3",DAQmx_Val_DoNotInvertPolarity));

Destination terminal to be routed could not be found on the device. Make sure the terminal name is valid for the specified device. Refer to Measurement & Automation Explorer or your hardware documentation for valid terminal names. Source Device: Dev1 Source Terminal: PFI4 Destination Device: Dev1 Destination Terminal: port0/line3 Status Code: -89121

 

   This error sounds like a trivial terminal name issue, but I'm fairly sure the terminal name is Ok.  Am I wrong?

 

I have tried another method using task-based signal routing and DAQmxExportSignal, which also returns an error:

 

    DAQmxErrChk (DAQmxCreateTask("",&clockTask));
    DAQmxErrChk (DAQmxCreateDOChan(clockTask,"Dev1/port0/line3","SCLK",DAQmx_Val_ChanPerLine));
    DAQmxErrChk (DAQmxExportSignal (clockTask,DAQmx_Val_SampleClock, "/Dev1/port0/line3"));
    DAQmxErrChk (DAQmxStartTask(clockTask));

Sample Clock Output Terminal requested is not supported given the requested Timing Type. To use the requested Timing Type, do not set the Sample Clock Output Terminal property. NI-DAQmx automatically selects a compatible Sample Clock Output Terminal. To use the requested Sample Clock Output Terminal, select a different Timing Type. Property: DAQmx_SampTimingType Requested Value: DAQmx_Val_OnDemand Property: DAQmx_Exported_SampClk_OutputTerm Requested Value: /Dev1/port0/line3 Task Name: _unnamedTask Status Code: -200910

 

  I'm guessing my port0/line3 needs to be configured differently, but I'm not sure which timing type to set.

 

So my question is if this is even possible, I'm just doing it wrong?   Or is it true that I can only output a clock on PFI4 and PFI5 pins?

 

As a follow up, should I instead be using the following function to export the sample clock?

DAQmxErrChk(DAQmxSetExportedSampClkOutputTerm(taskHandle,"/Dev1/PFI4"));

Also I see these functions: 

DAQmxSetExported10MHzRefClkOutputTerm

 

DAQmxSetExported20MHzTimebaseOutputTerm

 

Can I use these to output to port0/line3 and port1/line6?   I have some flexibility in clock speeds I can use, but curious if I can output 3 different clock speeds?

Also I could work out a method to use external clocks from other devices, but would prefer to maximize my usage of the internal clocks on the 6536 to keep the hardware requirements as simple as possible.

 

Thanks so much for any advice or insights!

0 Kudos
Message 1 of 2
(4,665 Views)

Hi ghardy,

 

I recommend using task-based signal routing because of its organization. I would probably use the DAQmxExportSignal function to export the sample clock to D I/O ports. You can read more on exactly how to configure it here.

http://zone.ni.com/reference/en-XX/help/370471W-01/daqmxcfunc/daqmxexportsignal/

 

You can use this function both internal and external device signals. Hopefully this helps.

 

Paul C

 

Paul C
0 Kudos
Message 2 of 2
(4,649 Views)