11-10-2011 07:14 AM
i have a analogmultichannelreader for ai0:7 on a ni6218.
now I modified the software, and need to read also channels ai17:19
the open ai0:7 channel does not allow me create a new channel for ai17:19
i'm also not able to expand the ai0:7 reader.
what can I do to read these channels?
this is part of my code:
tmpTask =
NewTask()
tmpTask.AIChannels.CreateVoltageChannel(szAIAddressText, szAIIndex, AITerminalConfiguration.Differential, -10, 10, AIVoltageUnits.Volts)
tmpTask.Timing.ConfigureSampleClock(
"", m_iSamplingFrequency, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples)
tmpTask.Start()
aiMultiChannelReader =
NewAnalogMultiChannelReader(tmpTask.Stream)
WaitEvent.WaitOne()
Try
dblValArray = aiMultiChannelReader.ReadMultiSample(m_iSampleCount)
11-11-2011 10:11 AM
got it working by myself, just added the new input to it,
had to call it "Dev1/ai0:7,Dev1/ai:17:19"
Peter