Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

C++ with NIDAQmx library : I would like read counter's value.

Hello,
 
In C++, I use the NIDAQmx library. I would like to know if it is possible to read the counter's value while counter runs.
 
For example:
 
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateCOPulseChanTime(taskHandle,"Dev1/ctr0","",DAQmx_Val_Seconds,DAQmx_Val_Low,1.00,0.50,10.00));
DAQmxErrChk (DAQmxStartTask(taskHandle));
while (!kbhit())
  {
    // here, I would like to read the counter's value
    cout << "?????" << endl;
  }
 
Sorry if I speak badly, English is not my first language.
 
Thank you.
 
0 Kudos
Message 1 of 3
(3,859 Views)
You can read the current count on an output task using:
 
DAQmxGetCOCount(TaskHandle taskHandle, const char channel[], uInt32 *data)
 
I hope this helps!
gus....
Message 2 of 3
(3,845 Views)
It is exact. Thank you very much.
 
0 Kudos
Message 3 of 3
(3,836 Views)