Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How does one un-register a callback?

I want to be able to change the number of samples associated with my EveryNSamples callback/event. If I try, however, to register the event again, with a different value for the nSamples argument, I get an error message stating that the event is already registered, and that I should un-register the event first.

 

How does one un-register an event in DAQmx? I don't see any function to do this in the documentation. I'm using DAQmx 8.8 at the moment.

 

 

0 Kudos
Message 1 of 3
(3,504 Views)

Hello Vijay,

In labVIEW you can use Unregister for event.vi in DAQmx advance pallete, in C you can use DAQmxRegisterSignalEvent function and pass a NULL value for the event callback function pointer.

Note: You cannot register or unregister an event in NI-DAQmx while a task is running.

Note: Refer to the Asynchronously Reading and Writing with the NI-DAQmx Visual C++ Class Library topic in the NI Measurement Studio Help for information on unregistering events in the C++ API.

 

Cheers

 

NIyer

 

0 Kudos
Message 2 of 3
(3,485 Views)

Thanks for reply. I will try this shortly when I have a chance. I am working with the C API. You suggest using the DAQmxRegisterSignalEvent() function to unregister an event. However, if the event was registered with the DAQmxRegisterEveryNSamplesEvent(), shouldn't I just re-use that function with a null pointer to unregister the event?

 

In any event, will try this weekend.

 

Thanks
Vijay

0 Kudos
Message 3 of 3
(3,475 Views)