Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Unregister event

I have a similar setup and issue as described in this post here.

I use DAQmx task and register 'Signal Event", when I am done I call Unregister for Events funciton and Stop DAQmx. Runs first time but on next iteration it returns error when trying to Register for Event. 

 

 

Error details:

 

Error -200949 occurred at Register For Events

Possible reason(s): You can only register one DAQmx Signal Event at a time on a task. DAQmx Signal events include the Counter Output event, the Sample Complete Event, the Sample Clock Event, and the Digital Change Detection event. Unregister the event before registering it again

 

 

Currently using workaround to Register on first call.

 

Thanks!

 

 

*************************************************
CLD
*************************************************
Message 1 of 7
(5,286 Views)

Hi lvrat,

 

Cool name! Are you running one DAQmx task only? How would your application differ if you stopped, cleared the task and then recreated the task and ran through the process again? Also what version of LabVIEW are you using? Thanks!

Best Regards,

Roel F.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(5,256 Views)

Hello Roel,

 

[Are you running one DAQmx task only?]

Yes currently using one DAQmX task only. 

 

[How would your application differ if you stopped, cleared the task and then recreated the task and ran through the process again?]

It does not return the error when task is stopped, clear and recreated. If clear is not perform (which was the initial case), error is received.

 

[Also what version of LabVIEW are you using?]

LabVIEW 2012 PDS.

 

Thanks!!

*************************************************
CLD
*************************************************
0 Kudos
Message 3 of 7
(5,210 Views)

Hi lvrat,

 

Thanks for your response. What I also meant by "How would your application differ...", is,  how would changing it to what I suggested impact the end user functionality? I.e. is the clearing the task and then recreating it not suitable for your purposes?

Best Regards,

Roel F.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 7
(5,191 Views)

Hi lvrat,

 

Could you try stopping the DAQmx task before unregistering the event? Unregistering the event before stopping the task should return error -200986, "DAQmx software event cannot be unregistered because the task is running." However, prior to LabVIEW 2013, the Unregister For Events node did not return this error to the caller, so I think unregistering in the wrong order with LabVIEW 2012 will silently fail to unregister the event.

 

Brad

---
Brad Keryan
NI R&D
Message 5 of 7
(5,100 Views)

Can somebody from NI update this shipping example (anybody with LV 2012 installed can update the file on the community, but I'm assuming the acutal shipping example needs an update as well...)?  I believe I wrote it originally and I'm feeling a little guilty now.  

 

According to the behavior reported here you need to Stop >> Unregister >> Clear if you want to explicitly unregister the task.  It seems that Clear implicitly unregisters the task, but I'm not sure when this started (or perhaps it always has done this and the issue was with the error reporting of the Unregister).

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 7
(5,091 Views)

Hi John,

 

The actual shipping example was fixed in NI-DAQmx 9.8. I uploaded the fixed version to the community site.

 

Brad

---
Brad Keryan
NI R&D
Message 7 of 7
(5,085 Views)