07-21-2023 02:39 AM
Hi
using USB NI-6009 with my own C# code
I'm trying to read multiple AI channels (single task) in continuous mode but I can't understand how to do it.
I have already read a lot of documentations.....
can you help?
Thank you
Hanan
Solved! Go to Solution.
07-21-2023 05:11 AM
I just figured it out.. 🙂
here is the C# code for any future reference / needs
Task MyAnalogInTask = new Task();
AIChannel MyAIChannels;
MyAIChannels = MyAnalogInTask.AIChannels.CreateVoltageChannel("dev1/ai0:6", "MyAIChannels", AITerminalConfiguration.Rse, 0, 5, AIVoltageUnits.Volts);
MyAnalogInTask.Timing.ConfigureSampleClock("", 6857, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, 10000);
AnalogMultiChannelReader daqMultiReader = new AnalogMultiChannelReader(MyAnalogInTask.Stream);
double[] VoltageLevel_Multi;
VoltageLevel_Multi = daqMultiReader.ReadSingleSample();