-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Description
I'm building a GUI that can control state of a task. As such, the channels etc. can change (when the task is stopped, of course). In the process of doing this, I end up creating tasks with the same name multiple time. This raises an error (status code -200089), as expected. However, I would like to destroy the current task, and build a new one. However, I cannot do this as an error -200088 is raised in the meantime, thought I do not understand where.
Here is an example. I would expect the this to print "Tried to create duplicate task" and "finishing". Instead, an error -200088 is raised in a Task.__del__, somewhere in between the two print statements.
from nidaqmx import Task, DaqError
from nidaqmx.error_codes import DAQmxErrors
t = Task("task")
try:
u = Task("task")
except DaqError as err:
if err.error_code == DAQmxErrors.DUPLICATE_TASK.value:
print("Tried to create duplicate task")
else:
raise
finally:
print("finishing")
t.close()Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels