LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200587 occurred at DAQmx Start Task.vi:7

I am running the attached code Merrit_Coil_calibration, and I get the following error:
 
Error -200587 occurred at DAQmx Start Task.vi:7
 
Possible reason(s):
Requested operation could not be performed, because the specified digital lines are either reserved or the device is not present in NI-DAQmx.
It is possible that these lines are reserved by another task, the device is being used through the Traditional NI-DAQ interface, or the device is being reset. You might also get the error if the specified resource is currently in use by LabVIEW network variables bound to the DAQ Channel, or if the DAQ Channel is being used in any OPC Client software.
If you are using these lines with another task, wait for the task to complete.  If you are using the device through the Traditional NI-DAQ interface, and you want to use it with NI-DAQmx, reset (initialize) the device using the Traditional NI-DAQ interface. If you are resetting the device, wait for the reset to finish.
Device:  Dev2
Task Name: _unnamedTask<F>
 
I am calling the same DAQ, many different places in my code and I think that is the problem, but I can not figure out why or hw to fix it.  Anyone have any suggestions?
0 Kudos
Message 1 of 7
(11,790 Views)
You cannot have an individual virtual task and individual DAQmx start for each of your DIO lines on a single DAQ card
You have to canifgure all lines into a single task and use a single DAQmx Start.
Message 2 of 7
(11,788 Views)
Hello Musser,

I've taken a look at your program and it seems fine.  Your controlling the order of execution of your multiple DAQmx Tasks using the For loops, so that only one DAQmx Task is open at a time.  You actually can have multiple digital input or digital output DAQmx Tasks at the same time, as long as they are software timed.  You will run into problems trying to perform multiple analog input or analog output tasks simultaneously with the same card, because you cannot share the timing engine and multiplexing circuitry in your device between two tasks.

I'm wondering what DAQ devices you are using in your program.  I would try testing each DAQ device using the test panels in Measurement & Automation Explorer (MAX).  If any of the devices fail the self-test or test panel, try resetting them by right-clicking on the device and selecting 'Reset Device'.  If that doesn't help, reply back with what DAQ devices you are using and how the ports on these devices are separated into the several digital output tasks you have in your program.

I hope this helps,

Travis G.
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 3 of 7
(11,775 Views)
Thank you both for your input.  I slightly changed my code to Merritt_Coil_calibration (updated code attached) and the first error went away, but now I have a different one which is:
 

Error -200429 occurred at DAQmx Write (Digital U32 1Chan 1Samp).vi:1

Possible reason(s):

Value passed to the Task/Channels In control is an empty string (or I/O control).

The value must refer to a valid task or valid channels.

 

As far as what DAQ device I am using, it is the NI USB 6009.  I am only using digital port 0.  During different pieces of my code I send different values to port 0.  I am using this to drive some stepper motors.  I thus send square waves on the different pins on port 0.  I do not know if this is exactly what you were asking. 
 
Whatever the case, I was wondering if anyone knows why this error occurs and how I could fix it. 
 
thanks.
0 Kudos
Message 4 of 7
(11,756 Views)
Hello Musser,

So I'm not sure, but I think you attached the wrong folder to your post.  The VI's in that folder are using Traditional NI-DAQ functions, which are not compatible with the USB-6009.

The error you are seeing is saying that the task being wired into the 'task in' input of the DAQmx Write VI is not a valid task.  This may be just a case of forgetting to wire the task out of the DAQmx Start VI to the DAQmx Write VI.  It may also be that there is a problem that is occuring during the creation or configuration of the task, so that a valid task reference is not generated and passed to the DAQmx Write VI.  Try using highlight execution or probes to determine where in your program the error occurs, and post back with an updated copy of your program.

Regards,
Travis G.
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 5 of 7
(11,745 Views)
woops, your right, I attached the wrong code.  That is a different part of my project.  Here is the right stuff.  It is the Merritt_Coil_calibration that gives me the error. 
0 Kudos
Message 6 of 7
(11,734 Views)
Hello Musser,

I think I see the problem with your code.  The error you are receiving occurs because you are clearing the DAQmx Digital Output Task in your program after the first DAQmx Write, and then trying to write to it again after the task has been cleared.  The task is no longer in memory after it is cleared, so when your program gets to the second DAQmx Write, the 'task in' your passing to it is invalid, resulting in the error your seeing.  I like what you've done by moving the DAQmx Create Virtual Channel and DAQmx Start VI's outside to the left-hand side of your case structure so that they are only executed once at the beginning of your program.  You should take this a step further and move your DAQmx Clear VIs outside of the case structure so that the task is cleared only after the ALL the DAQmx Writes have executed.  You'll only need to clear the DAQmx Task once at the end of your program, so I recommend using the Merge Errors function to consolidate all the errors from the multiple DAQmx Write VIs in your program, and passing the error and a reference to the DAQmx Task to a single DAQmx Clear VI and a single Simple Error Handler VI at the end of your program, outside the right-hand side of your case structure.

I hope this helps, and let me know if you have any further questions,

Travis G.
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 7 of 7
(11,725 Views)