07-26-2023 04:06 PM
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
Solved! Go to Solution.
07-26-2023 05:29 PM
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));
07-26-2023 06:37 PM
Thank you! I was wasting my time defining separate tasks for each channel and getting confused how I could make them simultaneous. 🙂