Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

run time daqmx task editing

I have defined daqmx task in MAX. How can i allow users to change the task configuaration (like adding/deleting channels)through my application at run time. This can be done through MAX , but can the same functionality be built into user application?
0 Kudos
Message 1 of 4
(3,039 Views)
You can add channels to a DAQmx Task when your application is running. However, dynamically created DAQmx channels can only be added to a task when THE TASK IS NOT RUNNING. (Note the difference between an application running and a task running.) Adding/deleting channels is considered an edit to the task configuration. Task configurations can only be changed when a task is not running. A DAQmx task is started by the DAQmx Start Task VI, the DAQmx Read VI or the DAQmx Write VI. A DAQmx task is stopped by calling the DAQmx Stop Task VI or when the VI hierarchy goes idle.

Global DAQmx Channels can be added to a task at any time since a new task is created when these channels are added to a task. However, you can't run 2 tasks which use the same resources simultaneo
usly, so you'd have to stop the first task before you can start this new task.

To add a global DAQmx Channel to a task use the "Create DAQmx Task" vi. To add a channel you dynamically built in LV to a task, use the "DAQmx Create Channel" vi.

There is not a direct way to delete channels from a task. You must create a new task with the specificied channels. You can use the DAQmx Task property node to get the list of DAQmx Channels contained in it, remove the ones that you don't want, and use the "DAQmx Create Channel" vi to create a new one with the remaining channels.

Deborah
0 Kudos
Message 2 of 4
(3,039 Views)
Thanks , Now I am able to see and change the channel properties of the task. I am using PCI 6014 card. I am trying to use Analog inputs. I have defined task using 4 AI channels , in MAX. User should be able to change the properties like max/min value at run time , which now I think is possible. Are the property changes user makes at run time local to application or global ?Now , as for the problem of adding and deleting the channels , Is it required to create new task using create task.vi , everytime ? Also , should i give new name for the task everytime ? Also , will this new task be globally available?
0 Kudos
Message 3 of 4
(3,039 Views)
All changes to a task or channel made using property nodes or VIs are local to the application.

And yes, you must use the Create Task VI each time you need to create a new task. If your new task should replace a previous task, use DAQmx Clear Task vi to release the memory used by the previous task.

You do not need to name the task. A default name is created if you don't supply one.

Refer to the LV Help on the DAQmx Create Task VI for more understanding of the VI and on task creation and destruction. There's alot of further info here. (To bring up the LV help for this VI, show the help window, move your cursor over this VI to display help for this VI in the help window, then click on "Click here for more help" in the help window.)
0 Kudos
Message 4 of 4
(3,039 Views)