01-26-2007 02:48 PM
01-29-2007 05:49 PM
Hi Pingpong,
We are limited on support for MATLAB, but would like to find
out more about what software and hardware you are using. Also, what is you
application doing and what kind of signals are you reading? Thanks!
01-29-2007 08:32 PM
01-30-2007 11:03 AM
Hi pingpong-
Your single call to AcqNUpdates in the NI-DAQmx Tools for Matlab interface is creating all channels with the same voltage range. You are specifying a -0.2..2V range which is coerced to a -2V..2V range that is then used for all channels. You don't list all of your calls to DAQmxCreateAIVoltageChan, but I'll assume that you're setting the mV-range channels to -0.2V..0.2V and the V-range channels to -2V..2V. This change in gain settings during scanning creates a step on the input of the device and is probably resulting in prolonged settling of the inputs (which manifests itself as ghosting in your signals). So, NI-DAQmx is not reordering your channels when you call the Cpp interface directly, it's just that the situation is a bit different.
You have a few options to try. First, if the accuracy of using all channels on the -2V..2V range (as in your Matlab Tools implementation) is acceptable then you could do the same when you call the Cpp interface directly. This can be accomplished by a single call to DAQmxCreateAIVoltageChan with the same format for the scan order as in your Matlab Tools example and a range of -2V..2V. Alternatively, if your sample clock rate allows, you can extend the interchannel sample delay by manually overriding the AI Convert Clock Rate via DAQmxSetAIConvRate(TaskHandle taskHandle, float64 data);. The longer you can extend this (up to a slowest limit of Sample Rate X # of channels in the task) the better leeway you give for settling between channels.
Hopefully this helps-
01-30-2007 02:55 PM
Hi Tom,
thanks for the reply. Yes, the variable voltage range is also one of the reasons we went with C functions instead of AcqNUpdates. The voltage settings for the calls to DAQmxCreateAIVoltageChan are as you have assumed - 0.2 V for ai1, ai3, ai4 and 2 V for ai2. The interchannel delay idea is something we will certainly try. We also noticed that simply decreasing the sampling frequency accomplishes significant reduction in crosstalk. We would still be interested in specifying the channel scan order but your reply seems to imply that this is not possible. If still there is a way to accomplish this somehow, we would appreciate it if you could instruct us how to do it.
Thanks again
01-30-2007 02:59 PM
Hi pingpong-
The channel scan order can certainly be set- I apologize if my earlier post was misleading. The order in which you add the channels to the task will dictate the scan order in all but a few cases where the hardware does not support random scanning (this mostly only applies to older SCXI modules). Your hardware should still be scanning in the order you have specified, but the interchannel delay may need to be extended to ensure more adequate settling time. How fast are you setting your Sample Clock rate? This KB explains why you might see different behavior with the default Convert Clock rate based on the Sample Clock rate you have specified.
01-30-2007 06:23 PM
Tom, thanks a lot, this explains everything.