Hello,
I am using a M-series PCI-6280 board, and I would like to use counter zero divide an external digital frequency down to a lower frequency, which I can then access externally on the counter's output terminal. I think I have done everything correctly (after researching documentation and sample code in the NI developer knowledge base) but no signal shows up on the counter 0 output terminal (pin 2, or PFI 12). I am working with C++ and NI-DAQmx.
Here is a summary of the code I use to set up the task:
// Using C++ string class from standard library
std::string clockSource = "/" + GetDeviceName() + "/PFI0";
std::string clkDivCtr = "/" + GetDeviceName() + "/ctr0";
// Divide 576kHz down to 36kHz
ErrorCheck( DAQmxCreateCOPulseChanTicks(
GetTaskHandle(), // returns the task handle we are configuring
clkDivCtr.c_str(),
"",
clockSource.c_str(),
DAQmx_Val_Low,
10,
8,
😎 );
// The ErrorCheck() function logs error messages if DAQmx function fails.
ErrorCheck( DAQmxCfgImplicitTiming(
GetTaskHandle(),
DAQmx_Val_ContSamps,
1000) );
After starting the task, with no errors, the output terminal of counter zero remains blank!
Please help!!
Regards,
Markus Svilans.