Discussion:
How to create a named task and assign physical channels to it?
(too old to reply)
CDancer
2008-06-30 19:40:10 UTC
Permalink
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?
 
MarkGrot
2008-06-30 22:10:09 UTC
Permalink
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.
pdupre
2008-07-02 10:10:12 UTC
Permalink
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 CardRegards
CDancer
2008-07-02 11:10:08 UTC
Permalink
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.
 

Loading...