LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Task name specified conflicts with an existing task name.

I'm using DAQmx in a large application, much of the code I inherited.  DAQmxCreate Task is at the start of the call chain, this VI creates a Task Name defined by a hardwired String.  During debug, sometimes I stop the application before DAQmx Clear Task has executed.

The next time I try to run, I receive the error "Task name specified conflicts with an existing task name".

LabVIEW help is clear in explaining that you must execute DAQmx Clear Task within the same loop to avoid the error.  But how do I recover for the ungraceful stop that can happen during debug?  Can I programmatically clear all tasks as part of an initialization routine?

0 Kudos
Message 1 of 7
(4,775 Views)

During your debug is there an error entering your DAQMX VIs ? If yes it can prevent a proper closure / clear. 

0 Kudos
Message 2 of 7
(4,743 Views)

The problem is that Clear is not executed, the application has stopped.  I then want to recover the situation without closing LabVIEW.  I know how to prevent it, but it can happen during debug when my code fails to complete a sequence.

0 Kudos
Message 3 of 7
(4,740 Views)

Sorry haven't read well 🙂 

 

You have to close / clear the task before running it again if you don't close LabVIEW. Maybe take a standalone VI which open / clear / close the task (using clear errors) freeing you from the problem. Then you should be able to restart normally.

0 Kudos
Message 4 of 7
(4,735 Views)

Try placing a Clear Task before the Create Task like this:

daqmx init.png

steve

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Message 5 of 7
(4,723 Views)

many thanks, I did look through the available VIs, it never occurred to me that I could connect a String to the Task input.

0 Kudos
Message 6 of 7
(4,683 Views)

Hello, I'm having the same issue using the nidaqmx python api.  I forgot to close the task before exiting the python interface, and now I don't know how to get back to that task to close it. Could you tell me the script to close the task now so I can re-use the task name?

 

What I should have done before exiting the python terminal is:

tsk=nidaqmx.task.Task('task')

tsk.close()

 

 

0 Kudos
Message 7 of 7
(3,758 Views)