03-17-2015 11:59 AM
Here is how I setup my USB-6211-OEM for continous data collection on channels 1, 2 and 3. I'm using DAQmx ver 9.1.20.15.
_task = new Task();
_task.AIChannels.CreateVoltageChannel("Dev1/ai1:3", "",
AITerminalConfiguration.Differential,
Convert.ToDouble(minVoltage),
Convert.ToDouble(maxVoltage),
AIVoltageUnits.Volts);
_task.Timing.ConfigureSampleClock("", Convert.ToDouble(4000),
SampleClockActiveEdge.Rising,
SampleQuantityMode.ContinuousSamples,
SamplesPerChannel);
_task.Control(TaskAction.Verify);
_analogInReader = new AnalogMultiChannelReader(_task.Stream);
_analogInReader.SynchronizeCallbacks = true;
_analogInReader.BeginReadMultiSample(SamplesPerChannel, handleAnalogIn, _task);
My experience is that SamplesPerChannel must be an integer multiple of the number of channels (if not it will be set equal to the number of channels (3 in my case)). But I haven't been able to find this documented anywhere. Can anyone verify this? If this is true, SamplesPerChannel is an unfortunate variable name since it implies the number of sample for a single channel while it is in fact the total number of samples to be collected for all the channels. Please let me know if I have this right or correct me if it is wrong.
Solved! Go to Solution.
03-18-2015 09:59 AM
Hi;
The SamplesPerChannel property specifies the number of samples to acquire for each channel. That means that it does imply the number of samples for a single channel and not the total.
http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/37e5460c/