LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx deleting task error

Solved!
Go to solution

Hi everyone.

 

First please note that I'm not very familiar with labview and DAQmx .

 

I try to use two DAQmx  tasks to communicate with an USB 6008 , each task have a unique name of course.

Now i've successfully created those two tasks, i'm trying to make a VI that simply destroy those two tasks (to be used at the end of the program).

 

And .. no matter how i try, there is no way to destroy any task either programatically or  with DAQ assistant created.

 

 

 

First, to test purpose, I created a task with MAX(See first picture)

 

Then,  I try with this .vi to delete it ... but it doesn't works .

 

Am I missing something ?

0 Kudos
Message 1 of 11
(4,415 Views)

First, to test purpose, I created a task with MAX(See first picture)

 

Then,  I try with this .vi to delete it ... but it doesn't works .


What is the problem you are facing.  Are you getting error while clearing a task?

 

The  DAQmx clear task.vi is used to destroy the task that has been created and that is function you are using. post with additional details.

 

Kindly look into DAQ examples that ships with LabVIEW to get the idea to create-run-clear a task

Message Edited by JK1 on 04-02-2009 05:09 AM
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 11
(4,409 Views)

Hi JK1, and thanks for your fast answer.

 

I don't have any error(s) when running this VI, but the task is still there (visible under MAX, for instance).

 

Let me explain to you my goal with DAQmx tasks : 

 

1) Create needed tasks at the beginning of the program (with a dedicated VI)

2) Use existing tasks within the program with differents VI referring to them

3) At the end of the program, clean (delete) previously created tasks (With another dedicated VI)

 

Item 1 is OK, Item 2 needs work, but before item 2 i'm trying item 3 to have a well known start and end.

 

 

I already tried help provided with labview, and searched both english and french forums and tried to apply solutions used there.

 

None of the solutions tried seems to work, that's why i'm asking if i've missed something.

 

 

 

0 Kudos
Message 3 of 11
(4,399 Views)

Hi,

 

The task you create in MAX can be deleted manually.   The clear task function clears the task that is currently running and does not 'delete' the task.  Why is that you want to delete that task that you have created in MAX.

 


1. Create needed tasks at the beginning of the program (with a dedicated VI)

 


 Inorder to create a task programmatically use the DAQmx create virtual channe.vi which creates a tas

 

2. Pass the created task to various vi blocks you would like and accompolish your goal.

3. Use the clear task.vi to clear the active task.

 

Above procedure is the one that can be found in the example vi's.

 

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 4 of 11
(4,392 Views)

HI

You can create the task programatically, you dont need to create the task in MAX.

You can create the task by DAQmx create Task vi and you can add the channels in that task using DAQmx Create Channel vi

For better understanding take DAQmx Assistand express VI > configure channels (more than 1) you require and say OK > then right click on express VI say Generate NI Daqmx code

This will create the DAQmx code showing how to create task and add the channel

Hope this helps

0 Kudos
Message 5 of 11
(4,391 Views)

Hi,

 

 


Above procedure is the one that can be found in the example vi's.


 

That's right . But every example"drops" a visible task in MAX and don't delete it.

 

So I may be wrong, but is the "delete" task VI (step 4 in the attached VI) the right way to really clean and delete a task under MAX ?

 

0 Kudos
Message 6 of 11
(4,377 Views)

HI

I wont think it will create visible task in MAX and wont delete it

Can you please upload your code in LabVIEW 8.5

Have you gone through the example procedure that I have posted in last message

Message Edited by SanRac on 04-02-2009 07:45 AM
0 Kudos
Message 7 of 11
(4,369 Views)

Hi,

 

That is the point.

 You will find 8.0 compatible exeample VI below.

 

I've gone through the example procedure you've posted before but it allows only to see code for building tasks and deleting it, without saving them.

 

The "saving" that I talk about is used there : 

 https://lumen.ni.com/nicif/us/evaldaqmxtools/content.xhtml

 

In other words, after saved once, there is no way to delete a task ?

Message Edité par dbraas le 04-02-2009 08:01 AM
0 Kudos
Message 8 of 11
(4,362 Views)
Solution
Accepted by topic author dbraas

Hi,

 

I executed the vi you have attached and executed it.  Yes it creates a visible task in max.

 

I used the function 'DAQmx Delete saved task.vi' which deleted the 'visible' task in max

 

Find the vi attached with that function and it works fine.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 9 of 11
(4,349 Views)

HI,

 

I didn't found this function before, despite my previous searches ?

 

Anyway, thank you very much, it works just fine.

 

Have a nice week-end  :smileywink:

 

 

0 Kudos
Message 10 of 11
(4,335 Views)