04-22-2009 10:01 AM
I'm a beginner of CVI, I could acquire data from a single channel, but I don't know how to acquire data from multi-channel
The steps of acquisition data from a single channel are below:
DAQmxErrChk (DAQmxCreateTask("",inputTaskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan (*inputTaskHandle, inputChan, "", DAQmx_Val_Diff, minIn, maxIn, DAQmx_Val_Volts, NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming (*inputTaskHandle, "OnboardClock", rateIn, DAQmx_Val_Rising, DAQmx_Val_ContSamps, sampsPerChanIn));
DAQmxReadAnalogF64 (taskHandle, sampsPerChan, 10.0, DAQmx_Val_GroupByChannel, data, bufferSize, read, NULL);
I don't know how to set these for multi-channel and how to get data from different channel,
I would appreciate very much !
04-22-2009 01:43 PM
Hi Joybee!
The easiest way to do this would be to specify the range of channels in the DAQmxCreateAIVoltageChan function. In the secont parameter (inputVhan) specify the device and the channels you want to read. For ecample, if my device is dev1 and i want to read the first 2 channels available i would use: "/dev2/ai0:1" as the paremeter in the function. You have to check for the buffer size and the rate you are using to adjust to your new needs or you will most likely get a buffer overflow error.
Hope this helps!
Have a great day!!
Oswald Branford
04-23-2009 05:52 AM