03-12-2013 02:29 AM
Hello,
first of all I just want to say hi and introduce myself:
I'm student, work at the moment for a company and write my bachelor thesis. I work for half a year with different NI-DAQs, but never had to use more than one analogue in- or output.
So I'm a bit confused, because I need to handle 3 tasks for my new project, but have to use them by their "taskHandle"s ... This is a bit problematic, because I want to use all the time just one name for "taskHandle" and use the tasks by their "taskName"s.
For example:
Initialization
03-12-2013 03:08 AM
I see no real utility in using the task name. All DAQmx functions need the task handle to operate on a task and there is no function I know of that can retrieve the handle associated to a specific task name. Keep also in mind that the task name could be changed internally by DAQmxCreateTask () as you can see in the help.
You can create and store your tasks in MAX: DAQmxLoadTask can then retrieve the tasks by name, but after this moment all the matter will be managed using the task handle returned by the function.
I also see no such complication in using three different variables to store the handles for the tasks you are using in your program.
Can you detail a bit more your application and explain why you don't want to rely on the task handles?
03-13-2013 05:05 AM
Thank you for this fast response.
Well eitherway I'd have to create just one TaskHandle and could've spared 3-4 other Taskhandles.
It could look like:
TaskHandle taskHandle
but now it looks like:
TaskHandle taskHandle1;
TaskHandle taskHandle2;
TaskHandle taskHandle3;
etc. pp.
And well I'd have changed this TaskHandle everytime, but inside these tasks it'd be the same all the time. I was looking for a function like:
DAQmxUseTask("TASK ONE",&taskHandle);
DAQmx ......... ("TASK ONE",...,...,)
...
DAQmxUseTask("TASK TWO",&taskHandle);
DAQmx ......... ("TASK TWO",...,...,)
...
So if I've a big project with 20 different tasks I'll need 20 different TaskHandle's than just one.
But if there's no function I'll have to use it this way.