Jump to content

getting random 'task invalid or doesn't exist' errors


Recommended Posts

I have an application that moves an assembly back and forth using a voltage analog output signal to an external motor controller to control the speed and direction of a DC motor.  I'm using a counter connected to an encoder to determine the distance traveled and to determine when to reverse direction.  Randomly I get error # -200088, 'task invalid or doesn't exist'.  This can happen when I try to read the counter or when I try to set the analog output.  Sometimes it will happen every time I start the program, other times it will happen after a minute of running, or after days of running.  LabVIEW seems to forget the task.  Creating the task doesn't generate any errors.

 

The PC is Windows 7, the application runs as a LV2012 exe, the hardware is a cDAQ (USB version), and I'm using DAQmx 14.2. 

 

I've attached a simplified version of the program to show how I'm setting up the tasks.  In the full version I start with a home routine and I count the encoder pulses to determine when to reverse and reset the count to 0.  The full program also has some other 'unrelated' things going on:  sending serial commands to stepper motors, reading some gas sensors, monitoring operator input, handling and logging errors, ...

 

I have not been able to figure out why this is happening or what stops it from happening.  Rebooting the PC and hardware isn't a reliable fix, nor is it desirable. 

 

Some history:

At first I had the DC motor control encapsulated in a subvi and had two reentrant copies running two different assemblies, ran this way for several days.

Started getting errors and removed the second copy because it wasn't needed -- error went away for a couple days.

Removed the control loop from the subvi and put it on the block diagram of the main program -- error went away again.  Ran fine for about three days continuously until the error returned on the analog output.

I could run the simplified program (attached) without error, but the full program always gave the error on the analog output.  Rebooting didn't help.  Finally, out of desperation, I rewrote the program to create the task, write the analog output, and clear the task every time I updated the output.  Error went away.  It has been several days since the change and I have my fingers crossed, but I'm not convinced this is a real solution.  Especially since I've had the error on the counter read as well as the analog write.

 

Has anyone dealt with something like this, and what did you do to resolve it?

DC simple test LV2012.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.