04-23-2013 10:38 AM
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.
04-24-2013 03:55 PM
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.
04-24-2013 06:13 PM
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.