04-02-2009 04:58 AM
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 ?
Solved! Go to Solution.
04-02-2009 05:07 AM - edited 04-02-2009 05:09 AM
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
04-02-2009 05:26 AM
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.
04-02-2009 05:46 AM
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.
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.
04-02-2009 05:49 AM
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
04-02-2009 07:10 AM
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 ?
04-02-2009 07:43 AM - edited 04-02-2009 07:45 AM
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
04-02-2009 08:00 AM - edited 04-02-2009 08:01 AM
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 ?
04-02-2009 10:10 PM
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.
04-03-2009 01:01 AM