Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Name conflict with Task using VB.NET 2010

I am having a problem disposing of a task and then trying to create new ones. It is giving me the error shown in the attached file. I have searched online and only found 2 posts that address this issue, neither of which has worked. One was to dispose of the task first, which as you can see by the attached file is the code immediately preceding the problem. Also referencing the watch value in the red rectangle below, the task is Nothing yet I still get the error. Another suggestion was to reset the device. I have also tried that with the same resulting error.

 

Can anyone tell me how to get rid of a task and then create a new one? This is a roadblock that I need to get around very soon.

0 Kudos
Message 1 of 3
(2,776 Views)

It seems that this New Task is within a for loop. Is it possible that you are creating the same task many times with the same name? Maybe you could try apending another variable other than iCntr to AITask_ that is simply a number and not converted to a string.

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

Thanks for the response.

 

I figured out how to fix my problem. I checked the rest of the code and I didn't use the task name anywhere. So I removed the task name and let Nidaq generate a unique name for the task and everything worked fine. I believe that there is still a bug when you create a task with a user assigned name as that name doesn't seem to go away by disposing or exiting the application or anything short of rebooting the PC. I'm up and running, but National may want to investigate what's up with the task name hiccup.

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