Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxRegisterEveryNSamplesEvent called again inside the callback

Solved!
Go to solution

Hi,

 

I am wondering if after using  DAQmxRegisterEveryNSamplesEvent to give me a callback at N Samples, I can call again the same function or another without restarting the task to change the number of samples before I receive a new callback. 

 

Thanks

Alex 

0 Kudos
Message 1 of 2
(6,271 Views)
Solution
Accepted by topic author lourman

Dear laurman

 

It is recommended to have only one thread per task. You should place your DAQmxRegisterEveryNSamplesEvent in the same thread as your task and callback function. The DAQmx driver is designed to have the task, event and callback all in the same thread. If you have it in a separate thread than your callback will not be able to see this event and be triggered because it is not in the same thread as the task.  In summary,once you call this for your task, you can't define it again without restarting the task.

Many thanks for using the NI forums and I look forward to your reply.

Kind regards

David

Applications Engineer
National Instruments UK
0 Kudos
Message 2 of 2
(6,241 Views)