10-19-2009 04:53 PM
Are there any examples using the NI-DAQmx C/C++ API in an application that illustrate how to read all 8 analog channels (differential) on a USB-6215 or similar device? I can find examples to read a single channel, but nothing for multiple channels. When I try to read all 8 channels, I only get input on the first channel. Any help would be appreciated.
Regards,
Bob
Solved! Go to Solution.
10-20-2009 05:26 PM
Hello Bob,
Thank you for using NI forums. What you would need to do is use a range of channels in your create analog input function. There is a character input called physicalChannel[] and this is where you specify what channels this task applies to. If you wanted to sample more than one channel then you could use something like "Dev0/ai0:7". This will configure your analog task for channels 0-7. Try this out and let me know if you encounter any problems.
Regards,
10-21-2009 07:00 AM
Brandon:
Thanks for the advice. I have it working now.
Regards,
Bob
02-02-2010 08:17 AM
i,
i've a same problem with this topic.
i've 2 channel input..and i've used this method ai1:2..But it mixed or merged together into 1 graph..
what i want is to appear these data seperated
ai1 appear in 1 graph and ai2 appear in 1 graph too..
how can i seperate this?
Hope help,
Thanks before
02-02-2010 08:57 AM
Have you switched to C/C++ since your last post?
Since your question is unrelated to the original question, you should have started a new thread. To show the signals in separate graphs, you would use the Index Array function on the output of the DAQmx Read.
04-06-2013 01:57 AM
Hi,
I have the same Project and want to acquire multiple channels synchronously in C++. First of all I tried to use multi threading but thanks your forum I've got that I was wrong. In order to obtain and save these data I have written "Dev1/ai0:1" as 5th parameter of the function "DAQmxReadAnalog64" and I've changed the definition of the parameter, in which data will be saved to a 2-D Array as "float64 data[2000][2]".But I face the error:
cannot convert parameter 5 from float64[2000][2] to float64[]
Sure it is due to the definition of the function "DAQmxReadAnalog64" which gets 1-D Array as 5th parameter. Whould you Plz help me how can I get acquiered data from multi channels and save them for example in a 2-D Array?
best regards,
Mohammad
04-08-2013 08:09 PM
Hello Harati,
You should check this DAQmx reference help:
http://zone.ni.com/reference/en-XX/help/370471W-01/daqmxcfunc/daqmxreadanalogf64/
*There you can read for "read array" description: The array to read samples into, organized according to fillMode.
FillMode: Specifies whether or not the samples are interleaved.
Interleaving: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/interleaving/
Regards
07-29-2013 02:24 AM
Dear frind,
i wrote a program in VC++ which acquires some analog voltage channels using NIDAQmx. By means of the "DAQmxCreateAIVoltageChan()" function it works properly, but I've faced a question:
When I measure a sine wave as a input channel whith diffrential terminals (pins) on NI-Device, there is no problem but if I connect the input signal in single ended form (connect input signal to each single terminal and connect GND of NI-Device and Signal generator together), there is a irrigular and alternative offset (DC value) in aqcuiered data that shows there is an error in connection of GND's. (I'm sure about function generators)
Is there any specific function to assign exactly that input data should be measured in differential or single ended form? I mean, should I write seperate codes in C++, if I want to measure input signal in both forms of differential and single ended or does the mentioned function satisfy both needs (if so wherefrom does this fault emerge)?
Thanks a lot for your helpfully reply in advance,
yours,
Mohammad
09-22-2013 03:53 AM
Hello
I'm interested in programming analog input data set (multiple entries) that came from piezoelectric sensors, for this I use C + + buider 6.0.
Could you share some code?, I thank you in advance.
09-23-2013 09:13 AM
Hello wecj,
You can find examples for C++ using NI-DAQmx, you can open them by navigating to Start>>All Programs>>National Instruments>>NI-DAQ>>Text-Base Code Support. You can use the examples and select several channels from your device and then read from all those channels.