Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Must Samplesperchannel be a multiple of the number of channels?

Solved!
Go to solution

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.

 

0 Kudos
Message 1 of 2
(4,289 Views)
Solution
Accepted by topic author skinnedknuckles

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/

0 Kudos
Message 2 of 2
(4,267 Views)