03-07-2013 12:08 AM - edited 03-07-2013 12:10 AM
Hi,
I am using NI 6210 and the maximum sampling rate is 250kHz. But if I sample 5 channels, each channel can have a rate of 50kHz. I am using DAQmx in .NET and I know I can set this using the following command:
myChannel = analogInTask.AIChannels.CreateVoltageChannel( "Dev1/ai0:4", //The physical name of the channel "myChannel_v1,myChannel_v2,myChannel_v3,myChannel_v4,myChannel_v5", //The name to associate with this channel AITerminalConfiguration.Nrse, 0, //10v minimum 10, //10v maximum AIVoltageUnits.Volts //Use volts ); sampleRateInKHz = 30; analogInTask.Timing.ConfigureSampleClock( "", // external clock source line or use "" for internal clock sampleRateInKHz*1000, // expected rate of external clock or actual rate of internal clock SampleClockActiveEdge.Rising, // acquire on rising or falling edge of ticks SampleQuantityMode.ContinuousSamples, // continuous or finite samples 500000 // number of finite samples to acquire or used for buffer size if continuous );
I can also choose single channel by replacing "Dev1/ai0:4" with "Dev1/ai0". However I can't find a way to select 2, 3 or 4 channels by choice, for example if I want to use only channels ai1 and ai3, then how do I set this in the code?
Thanks.
Solved! Go to Solution.
03-08-2013 07:44 PM
Hi Xichan,
To use channels ai1 and ai3, you can separate them by commas:
analogInTask.AIChannels.CreateVoltageChannel("Dev1/ai1,Dev1/ai3", ...)
or you can call CreateVoltageChannel() twice:
analogInTask.AIChannels.CreateVoltageChannel("Dev1/ai1", ...)
analogInTask.AIChannels.CreateVoltageChannel("Dev1/ai3", ...)
Calling the create channel function multiple times is helpful when you want the other parameters to be different on each channel.
Brad
03-10-2013 07:38 AM
Exactly what I needed, thanks.