LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to acquire data from multi-channel

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 ! 

0 Kudos
Message 1 of 3
(3,448 Views)

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

0 Kudos
Message 2 of 3
(3,436 Views)
Thank you very much,the problem is solved.
0 Kudos
Message 3 of 3
(3,414 Views)