01-04-2006 06:36 AM
01-09-2006 03:10 AM
Hello,
First of all the DAQmxCreateTask() function doesn't create a thread. The DAQmxCreateTask() function creates a context where software and hardware resources required for the task are allocated.
The DAQmxCreateDOChan() function specifies the digital lines that we want to use.
The DAQmxStartTask() function starts the generation task. From this point the hardware resources are allocated. If you run another application that tries to use the allocated digital lines, an error will be returned.
The DAQmxStopTask() functions stops the generation task.
The DAQmxClearTask() releases the allocated resources.
I precise that the DAQmxStartTask() and DAQmxStopTask() functions have a meaning only in a buffered generation (id est if you generate digital patterns on a clock). In this case a timing function must be used (the DAQmxCfgSampClkTiming() function for example) to precise the number of pattern to generate on the digital lines and the update rate. Before the start of the generation (DAQmxStartTask() call), the pattern must be written in the driver internal buffer with a function like DAQmxWriteDigitalU32().
01-09-2006 07:12 AM
Hello,
thank you for your answer.
this line:
if( DAQmxFailed(miError=DAQmxCreateTask("tache0",&mtaskHandle0)))creates a thread in my software, and this thread is never stopped or terminated by any DAQmx function.
Si I'm very surprised by your anwer...
I don't know where is this problem, but I don't think that the window task manager gives wrong information.
Are you sure that DAQmxCreateTask does not create any thread?
Thank you.
01-09-2006 08:21 AM
01-12-2006 03:14 AM
Thank you for your help, but there is no language problem, even if my english is poor.
When I execute DAQmxCreateTask 's line with Visual C++ debugger, a new thread is created in my application. It's the Windows Task Manager that is showing this.
For me, it's because DAQmxCreateTask creates a thread. That why I don't understand why DAQmxClearTask doesn't terminate this thread.
Where is the bug? Is it the Windows Task Manager, which badly detect the thread number of an application?
Or does DAQmxCreateTask create a thread, which could be logical...
Thank you.
01-12-2006 04:02 AM
01-12-2006 04:05 AM
10-01-2007 04:21 PM
Hello NI support and DAQmx C API users,
I am still very new to legacy DAQ and DAQmx C/C++ function calls, so I hope I this is the place to ask my question 🙂
If i have created a bunch of TaskHandles in my code and I call DAQmxStartTask() for each task, does the DAQmx driver run the tasks in parallel?
e.g.
Taskhandle a
Taskhandle b
DAQmxCreateTask(&a)
DAQmxCreateTask(&b)
// .... code to create DAQmxCreateCIPulseWidthChan for ctr0 and DAQmxCreateCITwoEdgeSepChan for ctr1 measurement
DAQmxStartTask(a)
DAQmxStartTask(b)
Is PCI-6602 hardware going to run finish running taskhandle a before starting taskhandle b? Are they going to run at the same time?
Thanks,
Geoff
10-02-2007 08:07 AM - edited 10-02-2007 08:07 AM
Message Edité par Mathieu Steiner le 10-02-2007 08:08 AM