Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

physical channel can't appear more than once in a task

All,
 
I would like to sample a grounded channel between my actual signal channels.  This is in an attempt to reduce bleed-over from one signal to the next.  In the traditional NI-DAQ world I was able to set up a channel list which included the same grounded channel more than once.  e.g. chanlist = {0,15,1,15}.
 
When I try to do this in DAQmx, I recieve an error message that a channel with the same name can not be added to the task.  Is there another way to add a physical channel more than once to a task?
 
Thank you,
 
Phil Mulhall
Physical Sciences Inc
 
0 Kudos
Message 1 of 6
(3,401 Views)

Hello mulhall,
I'd like to point out a couple things.  First, NI-DAQmx automatically chooses a convert clock rate such that the ADC has time to settle within the specifications of the device.  The convert clock is what controls the multiplexing of successive channels to the ADC.  So you might not need to add a grounded channel between each input channel.  Second, you can also manually set the convert clock rate.  So you could slow down the convert clock to allow for maximum settling time between channels.  This can be done in LabVIEW with a DAQmx Timing property node, using the AI Convert Rate property, or in C with the DAQmxSetAIConvRate function.  You would need to calculate your minimum convert clock rate based on the number of channels in the scan list, and your desired sample rate.

Having said that, yes, there is a way to add the same physical channel multiple times in the same task.  It does require the use of NI-DAQmx global channels.  You can create multiple global channels in Measurement & Automation Explorer (MAX) that all contain the same physical channel.  Then you can add all of these global channels to your task.  For example, if channel 15 is your grounded channel, and you wanted to sample from channels 0, 1 and 2:  Create five global channels:  gndA, gndB, ai0, ai1 and ai2.  Where the global channels gndA and gndB both contain physical channel 15.  Global channel ai0 is physical channel 0, etc.  Then and add the global channels to the task in this order:  ai0, gndA, ai1, gndB, ai2.

Note, If you need to re-post, you might want to mention what device you are using.  I am fairly certain that the above statements apply to most NI-DAQ devices, though I believe some (or all) S Series devices don't support the multiple globals with the same physical channel trick. 

-Alan A.

Message Edited by Alan [DE] on 02-22-2006 01:58 PM

0 Kudos
Message 2 of 6
(3,390 Views)

Alan,

 

Thank you for your suggestion.  I am using an M series PCI-6251, DAQmx 7.3, CVI 7.1.

I will try adding the global channels under MAX but I am concerned that this extra step makes it challenging for my application to be portable.  I would prefer to handle the issue programatically in CVI.

In response to your first suggestion, we are using the full bandwidth of this board in an attempt to average many scans in a short amount of time.  I have to weigh the advantages and disadvantages of slowing down my scan rate to reduce the channel to channel cross-talk.  It has been a continous problem for us over the years.

Thank you

Phil Mulhall

0 Kudos
Message 3 of 6
(3,382 Views)
Ok, couple other things.
If you go with the globals idea, a suggestion to make your app more portable would be to use the Export Configuration feature of MAX (File>>Export).  Then you can simply distribute the export file with your app.  On your target systems, do a File>>Import.  A couple extra steps, but pretty easy.
 
As far as your the other idea, let me clarify one other thing.  I previously mentioned slowing down the Convert Clock Rate, not your Sample Rate.  Again, the convert clock is what controls the multiplexing of input channels to the ADC.  You can adjust the convert clock without changing your sample rate.  The max convert clock rate is usually equal to the max sample rate on the device.  That is the limiting factor in a multi-channel acquisition.  So if you want 4 analog input channels and the max sample rate of your device is 1MSample/sec, the the fastest you can acquire from those 4 channels is 250kHz (the convert clock will be running at 1MHz).  The simple calculation for the slowest possible convert clock for a given acquisition is (Sample Rate * Number of Channels).  Current versions of NI-DAQmx automatically choose a convert clock rate that is pretty fast, to achieve as close to simultaneous sampling as possible (See this KB on how NI-DAQmx sets the convert clock:  How is the Convert (Channel) Clock Rate Determined in NI-DAQmx and Traditional NI-DAQ?).  But, you can change this rate with the property I mentioned in my previous post. 
 
Anyway, the more channels you have in your task, the faster your convert clock rate must be.  That is why I suggested removing the grounded channels from your scan list and instead, slowing down the convert clock.
 
To make a long story longer, it looks like for your app (especially if you want easy portability), you really might want to consider the convert clock approach.  A few reasons:  1) M Series devices have excellent settling time specs.  2)  You can increase the settling time by manually adjusting the convert clock (programmatically of course) and 3) You wouldn't have to worry about global channels in MAX.
 
Well, there's my two cents.  I hope that helps some.  And please re-post if I was unclear about something.
 
-Alan A.
Message 4 of 6
(3,375 Views)

Hi mulhall,
 
I understand your concerns about portability.  However, I would like to point out that you don't need to use MAX to solve this problem.
 
Yes, with DAQmx, you can programmatically add the same physical channel twice.  However, you must specify a different channel name every time you call create channel.  The physical channel name and channel name can be different.  You can make up whatever channel name you want, e.g. "Foo1" -"Dev1/ai0" and "Foo2" - "Dev1/ai0". 
 
Hope this helps!
 
 
Message 5 of 6
(3,358 Views)

A very old post, but VERY helpful!  Just saved me from re-spinning a PCB or  a MAX config headache. This knowledgebase article led me to believe it was not possible, you have shown otherwise.  This channel list: Dev4/ai1,Dev4/ai0,Dev4/ai2,Dev4/ai0,Dev4/ai3 is valid as long as Name to assign is: Ai1,Gnd1,Ai2,Gnd2,Ai3 or similar.

0 Kudos
Message 6 of 6
(2,728 Views)