ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

ReadSingleSample

How many dimensions does the ReadSingleSample function have for a AnalogMultiChannelReader have?

 

I have an analogInTask with 16 channels that I'm trying to read a single sample of all 16 channels into an array.  Visual Studio tells me "Number of indices is less than the number of dimensions in the indexed array"

 

analogInReader = New AnalogMultiChannelReader(analogInTask.Stream)
tcdata() = analogInReader.ReadSingleSample()

 

What am I doing wrong?

 

Dave

0 Kudos
Message 1 of 3
(1,787 Views)

Hello

 

I would expect one dimention with 16 elements, but to be sure use c# function to know how many rows and colums your array has.

 int rows = myArray.GetLength(0);
 int columns = myArray.GetLength(1);

 

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

I need to pass an array with the correct dimensions to the function and I can't figure out the array size to define.

0 Kudos
Message 3 of 3
(1,651 Views)