Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

analogmultichannelreader bocks access to other channels

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)

0 Kudos
Message 1 of 2
(3,724 Views)

got it working by myself, just added the new input to it,

 

had to call it "Dev1/ai0:7,Dev1/ai:17:19"

 

Peter

0 Kudos
Message 2 of 2
(3,718 Views)