Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a named task and assign physical channels to it?

Looking for some help with DAQmx as I am tying myself in knots here.
 
In a program I wrote a few months ago I used DAQmx Create Task.vi to create a task with a name of my choosing and assign a global virtual channel to that task.
OK, now I want to do exactly the same, but on a system that does not have global virtual channels defined. Instead, I want to assign a physical channel to the task. I tried using DAQmx Create Channel.vi to create a virtual channel from the physical channel, and then call DAQmx Create Task.vi using that virtual channel name, but it won't accept it, presumably because it is not a global channel.
It seems very arbitrary that you can create a named task with a global virtual channel that you have created in MAX, but not a physical channel or virtual channel that you have created programmatically.
The reason I want to define the name of the task is that I am converting my vis to Matlab functions using Math Interface Toolkit, and I want the functions to work without the user having to pass a task name from one to the other. That's what my other program did and it worked very well.
 
Anyone know how to do this?
 
0 Kudos
Message 1 of 4
(3,643 Views)
Create Channel will create a task if you do not supply it with one.  To add a physical channel to a named task, call Create Task first with your desired name and pass the task output of it into the Create Channel.
0 Kudos
Message 2 of 4
(3,639 Views)
Hello,

In my opinion, what you said works for the AI, but it fails for the AO (at least on my computer) with a Pci-6251 Card

Regards
0 Kudos
Message 3 of 4
(3,612 Views)

Thanks guys. I tried what Mark suggested and it works fine. Don't know why I didn't try that particular arrangement.

I am doing single channel waveform output with a PCI-6221. Using Labview 8.5.

 

0 Kudos
Message 4 of 4
(3,608 Views)