07-30-2009 08:58 AM
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.
07-31-2009 11:44 AM
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
07-31-2009 12:26 PM
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