Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Get list of tasks

M-Series DAQ-Device PCI-6220, Driver DAQmx 7.3 in use with a Visual C 6 application

How is it possible to get the tasks that are defined for measuring?

*status = DAQmxCreateTask("MyTask",taskHandle);

If I try to create a task with the same name (for example after an abnormal termination of my application and a restart of it), I get the error -200089 = "Task name specified conflicts with an existing task name."

O.k. the task can be deleted with DAQmxClearTask(taskHandle).
But what if I lost the information about the taskHandle? I still know the name "MyTask" because it is a constant in my application.

I would like to make sure to clear all existing tasks.
This is not possible with DAQmxResetDevice, only by restarting the PC. At least I did not find another solution.

Thanks!
Ralph
0 Kudos
Message 1 of 4
(3,722 Views)
Hi Ralph,

i looked in the NI-DAQmx C Reference manual and found following interesting information:

Tasks

Data Type: char*
Description: Indicates an array that contains the names of all tasks saved on the system.
Restrictions: Not Settable

You can get this property using:

DAQmxGetSysTasks


Hope it helps

Indiana

Message Edited by Indiana on 07-05-2005 02:49 AM

0 Kudos
Message 2 of 4
(3,711 Views)
Hello Indiana,
 
thank you for this function. I did not know it because it is not available in my help reference. But it is available in the library and header file.
But this function does not really help me because it returns only the task names and not the handles. Without the taskHandle it is not possible to clear the task or reuse it.
 
I also tried to use DAQmxLoadTask, this returns the task handle according to a task name, but only if it has been defined in MAX and not if it has been defined by DAQmxCreateTask.
 
Greetings
Ralph
 
0 Kudos
Message 3 of 4
(3,680 Views)
Hi Ralph64,

i didn´t find any other function which solve your problem at the easy way.
But i have an other suggestion:
Save each created taskhandle in an array and you will know at the end of your intention, how many taskhandles are opened (size of array).

Regards

Indiana

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