08-18-2011 12:15 PM
hey guys,
I've been trying out the sample code for the DAQmx analog input voltage measurement. The code comes with some instructions but is very unclear about the steps to creating a task. For starters, what is a task? Without the task, the code runs fine and I can use the DAQ and measure an external voltage input. Is the task here for creating a test voltage input to the DAQ? So I could pick up waves from the UIR even without an external voltage?
Thanks for the help
08-18-2011 05:37 PM
Said it simple, a task is the activity you want to perform with a DAQ device attached to your system. The task groups all resources needed for its purpose and can be tailored to accomplish what you want to do.
Tasks can be created using Measurement And Automation Explorer (briefly: MAX) or programmatically in the code. Other resources too can be created from scratch in the code or using MAX (e.g. channels).
Tasks can be used for a variety of activities: analog acquisition or generation, digital acquisition or generation, handling of counters and so on.
The usual structure in a program that is using DAQMx is:
1. Create a task
2. Add resources to the task (e.g. data acquisition channles)
3. Tailor the task
4. Start the task and use it (e.g. acquiring a waveform)
5. At end of activity dispose of the task to free resources
This is generally the way sample programs are structured: they are a good starting point to develop your own application.
Informations on using DAQMx instructions can be found in the oline help and in several tutorials and knowledgebase articles on this site.