Hello Rossi,
The best reference for programming DAQmx applications in C is the
'DAQmx C Reference Help' located under Start > All Programs >
National Instruments > NI-DAQ. In order to create a DAQmx
application to read from multiple analog input channels, you will first
need to specify the channels in the DAQmxCreateAIVoltageChan
function. If you find this function in the reference help, it
explains for the parameter 'physicalChannel', you can specify an
individual or range of physical channels to acquire from. There
is a link to another page title 'Physical Channel Syntax' that explains
how to enter the channel string into this function. To sample
from analog input channels 0 through 1 on Dev1, you would enter
"Dev1/ai0:1". With a multiple channel task created, you read from
that task using the DAQmxReadAnalogF64 function. Find this
function in the DAQmx C Reference Help, and it explains that the
readArray output of this function produces an array of data for all the
channels. Whether the data in that array is grouped by channel or
interleaved is specified by the fillMode parameter of the
DAQmxReadAnalogF64 function. This should help you get started
with acquiring data from multiple channels using the DAQmx functions.
As far as extracting data from an array, you can extract an individual
number from an array by specifying it by its element, or order in the
array. Doing a quick search, I found many helpful tutorials on
working with arrays in C.
Here's one I found especially helpful.
I hope this helps.
Regards,
Travis G.
Applications Engineering
National Instruments
www.ni.com/support