LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to acquire from various AI channels simultaneously with a different range for each one?

Solved!
Go to solution

How to acquire from various AI channels simultaneously with a different range for each one?

In LabView I have found some examples but in C there isn't seem to be any.

0 Kudos
Message 1 of 3
(4,372 Views)

One possibility is to create virtual channel in MAX, each with the appropriate range, and then programmatically add the channels to the acquisition task with DAQmxAddGlobalChansToTask



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(4,362 Views)
Solution
Accepted by topic author Franchesco

Or you can add channels one by one with individual instructions: the follwing code compile and runs with no errors on a vitual daq device:

 

err = DAQmxCreateTask ("", &taskH);
err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai0", "AI0", DAQmx_Val_Cfg_Default, -5.0, 5.0, DAQmx_Val_Volts, "");
err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai1", "AI1", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, "");
DAQmxStartTask (taskH);
err = DAQmxReadAnalogF64 (taskH, 5, 10.0, DAQmx_Val_GroupByChannel, val, 10, &read, 0);
DAQmxClearTask (taskH);


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 3
(4,359 Views)