Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

daqmx read analog inputs

$
0
0

Hello,

I would like to read the value of multiple channels on a NI USB-6229 BNC. I created one task to my programm and 4 AI VoltageChan. Is it correct?

 

DAQmxErrChk(DAQmxCreateTask("DAQMonitoring", &taskOut));

DAQmxErrChk(DAQmxCreateAIVoltageChan(taskOut, "Dev1/ai0", "Tension_0", DAQmx_Val_RSE, 0, 5, DAQmx_Val_Volts, ""));	
DAQmxErrChk(DAQmxCreateAIVoltageChan(taskOut, "Dev1/ai1", "Tension_1", DAQmx_Val_RSE, 0, 5, DAQmx_Val_Volts, ""));	
DAQmxErrChk(DAQmxCreateAIVoltageChan(taskOut, "Dev1/ai2", "Tension_2", DAQmx_Val_RSE, 0, 5, DAQmx_Val_Volts, ""));	
DAQmxErrChk(DAQmxCreateAIVoltageChan(taskOut, "Dev1/ai3", "Tension_3", DAQmx_Val_RSE, 0, 5, DAQmx_Val_Volts, ""));
	

 

Now, if I click on a start button on my GUI, I would like to read the 4 input values and change 4 register meters values (still on my GUI).

But I do not understand how to do on my program. Do I have to create 4 tasks? One task for each analog input?

 

I know that I have to start a task, read analog input (or inputs but I dont't know how to do that) and stop the task.

Could you please help me?

 

tx,

gold5


Viewing all articles
Browse latest Browse all 5339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>