Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Find active DAQmx tasks?

Is there a way to retrieve all the open tasks in DAQmx? I want to be able to clear all open tasks without having to specifically know the task names.
 
George
0 Kudos
Message 1 of 3
(4,087 Views)
Hi George,

Well, there is a way to retrieve all saved tasks in DAQmx.  The DAQmx System property called Tasks returns an array of the names of all saved tasks.  This has nothing to do with which tasks are running, but rather which tasks have previously been configured and saved in Measurement and Automation Explorer.  Just so you know, here's how to retrieve this property in each programming language:

In LabVIEW:  Use the DAQmx System Property Node with the Tasks property selected.
In C:  Call the function DAQmxGetSysTasks.
In .NET:  Use the DAQSystem.Tasks property.

If you want to be able to programmatically clear all open tasks, you should probably build an array of the names of all the tasks you start in your application.  This way, you could just index through the array and call the Clear Task function for each element. 

I hope this information helps!

Best regards,
0 Kudos
Message 2 of 3
(4,074 Views)

My tasks aren't saved so I can't use the DAQmx System Property node. I was hoping there would be a slick way to get all the open tasks (that sure seems like it would be a useful function), but I guess I'll have to keep track of the tasks that I open. Thanks for confirming that I didn't miss something.

George

0 Kudos
Message 3 of 3
(4,068 Views)