Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Using global tasks

Can anyone tell me how to use a globally saved task using the NIDAQmx C library?  The help files describe the DAQmxSaveTask() function but do not appear to describe any mechanism to use the tasks.  My hope is that I can create a global task that samples analog inputs on an M series PCI-6229 and then have multiple programs that access the data from the channels of that global task.  Am I on the right track?  Where do I get more information on how to do this?
 
Note that I have used DAQmxSaveTask() and the task appears in MAX with all the channel and timing information as expected.  I just need to know how to do the next step.
 
Thanks

Message Edited by quester on 10-24-2005 11:29 AM

0 Kudos
Message 1 of 2
(3,084 Views)

Hi Quester,

You are on the right track by creating and saving a task.  The DAQmxSaveTask() function saves the task in Measurement and Automation Explorer (MAX). You will be able to call this task from multiple programs, but not simultaneously.

Since you have already configured your task, you will not need to create a new task or configure any of the timing in your program. You will have to load the task using the DAQmxLoadTask function and then start the task with the DAQmxStartTask function. After that, you will perform the read or write operation and clear the task.

A good programming sequence structure is available under "Tasks in DAQmx" in the NI-DAQmx C Reference Help which is in Start >> All Programs >> National Instruments >>NI-DAQ. More information about specific DAQmx functions is also located there. I also recommend taking a look at some example programs. The  DAQmx example programs for Visual C++ are located in C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C. 

Regards,
Hal L. 

0 Kudos
Message 2 of 2
(3,060 Views)