LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting a task specified is invalid or does not exist error?

Solved!
Go to solution

I am getting this error
dakotasmith2_8-1734386197876.png
The source of this error is coming a cloneable instance of my Card module in DQMH. 

dakotasmith2_9-1734386541885.png

The above screenshot is the front panel for the DO card (Card Module with Module ID = 2). 
Here is the RQST Stop Card Event that has the Stop Task call which is causing the error

dakotasmith2_16-1734386812465.png

The task is getting started in another case called RQST Start Card which is here

dakotasmith2_11-1734386643491.png
Here is that START CARD VI

dakotasmith2_13-1734386678090.png

Here's the True case. The True case is used in another module where there is a Timed Loop that should start this task automatically so the start task VI has been removed from there.

dakotasmith2_14-1734386721649.png
I'm pretty sure the task is being created but I'm not sure if it's being done correctly so from the error message I'd guess that there is something invalid with the task rather than it not existing. Also the timing for that task should be using the sample clock from the AI card as shown here

dakotasmith2_17-1734387435343.png

That timing source OUT gets fed into a timed while loop here which should start all the tasks for all the cards after the all get stopped first

dakotasmith2_19-1734387508947.png

 

The cards are being started for continuous samples when the PXIe-8861 controller starts up then when the real time model starts, the cards all get stopped, then started again except for in hardware timed single point for the cards that allow it.

Is there something wrong with the way I'm setting up the DO card or is it something else in my code?

 

0 Kudos
Message 1 of 3
(74 Views)

This is one of the reasons that I recommend creating your Task in the project.   Just use the DAQmx Wizard and test the Task during development.   Then, at runtime, simply control the Task.  Nothing can go wrong that you didn't resolve during development and Unit Testing for the DAQmx IO operation.   The lvproj will contain all of the Task stuff in xml format that is human readable in any text editor.   Bonus, your build output will automagically convert the DAQmx stuff into a ini format configuration file for you in a NI DAQ folder (which can also be edited AFTER being deployed if you need to adjust some stuff)  

 

I don't know how many times I've seen developers waste time trying to rewrite existing DAQmx features that just plain work correctly and conveniently right out of the box.

 


"Should be" isn't "Is" -Jay
Message 2 of 3
(28 Views)
Solution
Accepted by topic author dakotasmith2

I'm not sure exactly why this got rid of that error but I stopped and cleared the DO task in the CLOSE MODEL VI and it's no longer there. Before I was just stopping and clearing the AI, Bridge Input, and AO tasks. I haven't thought to create a task in the project so I might look into seeing if this would be a better approach. Thanks!

0 Kudos
Message 3 of 3
(23 Views)