LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous readings from all channels of three-axis accelerometer with DAQmx C API

Solved!
Go to solution

Hello,

 

I'm trying to get simultaneous readings from all three channels of my three-axis IEPE accelerometer using DAQmx C API. I'm able to collect data from any single channel without issues with the below:

 

 DAQmxErrChk (DAQmxCreateAIAccelChan(taskHandle,"Dev1/ai0","",DAQmx_Val_PseudoDiff,-10.0,10.0,DAQmx_Val_AccelUnit_g,13,DAQmx_Val_mVoltsPerG,DAQmx_Val_Internal,0.004,NULL));

 

But I haven't been able to do it with all three channels simultaneously. I've seen that I can pass something like "Dev1/ai0:2" to above function but the question is, how do I set the sensitivity of individual channels? 13 is the sensitivity of ai0 in above example, how do I set say 14 and 15for ai1 and ai2?

 

Thank you 

0 Kudos
Message 1 of 3
(736 Views)
Solution
Accepted by topic author vygr0

Easily Synchronize and Trigger NI-DAQmx with Channel Expansion

You can call DAQmxCreateAIAccelChan multiple times to the same task handle, configuring one channel with its sensitivity in each call.

 

DAQmxErrChk(DAQmxCreateAIAccelChan(taskHandle,"Dev1/ai0","",DAQmx_Val_PseudoDiff,-10.0,10.0,DAQmx_Val_AccelUnit_g,13,DAQmx_Val_mVoltsPerG,DAQmx_Val_Internal,0.004,NULL));

DAQmxErrChk(DAQmxCreateAIAccelChan(taskHandle,"Dev1/ai1","",DAQmx_Val_PseudoDiff,-10.0,10.0,DAQmx_Val_AccelUnit_g,14,DAQmx_Val_mVoltsPerG,DAQmx_Val_Internal,0.004,NULL));

DAQmxErrChk(DAQmxCreateAIAccelChan(taskHandle,"Dev1/ai2","",DAQmx_Val_PseudoDiff,-10.0,10.0,DAQmx_Val_AccelUnit_g,15,DAQmx_Val_mVoltsPerG,DAQmx_Val_Internal,0.004,NULL));

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 3
(705 Views)

Thank you! I was wasting my time defining separate tasks for each channel and getting confused how I could make them simultaneous. 🙂

0 Kudos
Message 3 of 3
(692 Views)