Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Max global channels be programmatically added to a created task?

I need to add Max created globals analog input channels to a programmatically created task.
The idea is to be able to create a Analog Input Task that contains a mix of Physical and Global
channels in any order.  It seems like this should be possible but I do not see a LV8 interface for
doing this.
0 Kudos
Message 1 of 8
(4,017 Views)
This certainly is possible.  All you need to do is use a DAQmx Create Task.vi and have your MAX virtual channels as the input.  That will add your virtual channels to the task.  Then, use the DAQmx Create Channel.vi to add your physical channels.  Check out the attached VI, I modified the shipping example called "Acq&Graph Voltage-Int Clk.vi" to do exactly what I described.  I have two virtual channels called "M_Series_AI0" and "M_Series_AI1" that I created in MAX.
 
There is also another way to attack this problem.  You can create a Task in MAX, and add all of your virtual channels to that task in MAX.  Then, simply pass that task to the DAQmx Create Channel.vi to add your physical channels to the task. 
 
-Alan A.
0 Kudos
Message 2 of 8
(4,016 Views)
Thanks for the reply, but it does not solve the problem for me.  I need to be able to create an arbitrary channel list comprised of Global and Physical channels in any order, that means they may also be interleaved.
0 Kudos
Message 3 of 8
(4,014 Views)
0 Kudos
Message 4 of 8
(4,009 Views)

Ok, I'll admit your good...

But I think that NI should create an 'Add Global Channel to Task' vi.  Your solution may be the only way to do this but it has the unfortunate side effect of invoking MAX which can be painfully slow. 

0 Kudos
Message 5 of 8
(4,001 Views)
Thats not a bad idea, though I think you are the first person that has ever requested this functionality (most use physical or virtual channels, not usually both).  We do, of course, always welcome your feedback:).  If you would like, you can fill out a product suggest about this particular issue.  Go to ni.com, click Contact NI, then click the feedback link (bottom left-hand corner).
-Alan A.
0 Kudos
Message 6 of 8
(3,987 Views)

Old thread, but let me pipe in as the 2nd person you've heard of who'd like this feature. 

Use case: I'd like to interleave app-defined global virtual channels with the internal physical channel named something like "_aignd_vs_aignd" because various global channels require very different gains from the daq board and I'm seeing ill effects like bleed-through or cross-over or whatever the right term is.  By interleaving a scan that ties both differential inputs to AI Gnd, my "real" channels appear to show better isolation.   (Note: project is at a stage where software fix is far preferable to electronics hardware fix, such as adjusting bias resistors.)

I downloaded the example above and will try it out.   The earlier comment about slow speed of dealing with MAX may drive me to adapt the suggestion shown in this similar thread.   Question: when you feed an existing task in as an input to "Create Task.vi", the help says that the task is copied.  Since I will ultimately want the app to use a single task containing all the channels of interest, doesn't that imply that I should Clear the input task immediately after copying it with "Create Task"?

Other note: I know that I could drop a channel property node to determine the physical channel associated with a global virtual channel.  Then I could do the config based on physical channels alone.  But I would lose the association to each global channel's unique parameters such as scaling, etc.  In short, yeah there are workarounds, but they're more of a pain than they ought to be.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 7 of 8
(3,699 Views)
Quick followup:  the method I ended up using was to wire my Global Virtual Channel into a DAQmx Channel property node, extract the physical channel(s) and all other associated config properties to wire into DAQmx Create Channel.  This includes wiring a comma-delimited list of the Global Virtual Channel names into the 'name to assign' input.  Buncha wires, looks kinda sloppy, feels kinda inelegant, but it seems to do the job.   Screenshot below:


-Kevin P.




Message Edited by Kevin Price on 01-17-2008 06:22 AM
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 8 of 8
(3,683 Views)