C3D.get_ad_chan_arr

Previous  Next

 

nFrames = C3D.get_ad_chan_arr( BYVAL Fid          AS HANDLE,

                               BYREF array        AS ARRAY,

                               BYVAL nChanNo      AS INTEGER,

                              [BYVAL nFrameOffset AS INTEGER=0],

                              [BYVAL ixChan]      AS INTEGER=0] ) AS INTEGER

 


 

Returns the entire channel into an array.  The array must be a REAL array with number of frames as first dimension.  If the last argument, ixChan, is used, then the array should be multi-channel array declared as REAL( NoOfFrames, NoOfChannels ).  The array can be passed as an array or as REFERENCE.

 

The optional Frame Offset will start the reading of data at the frame 1 + nFrameOffset and then read as many frames as the array can hold or to the end of the channel whichever comes first.  The output from the function is the number of frames that was read into the array.

 

Please Note; ixChan uses OPTION BASE since it's an index into an array while channel numbers always starts at 1.

 

Example:

 

PRINT "Analog Channels with Get Array...........",

 

DIM adS( nFrames )    AS REAL

DIM adM( nFrames, 4 ) AS REAL

 

n = C3D.GET_AD_CHAN_ARR( hFid, 1, REF( adS ) )

m = C3D.GET_AD_CHAN_ARR( hFid, 1, REF( adM ), 0 )

 

IF ( n = C3D_SUCCESS ) AND ( m = C3D_SUCCESS ) THEN

  FOR i = nFirstFrame TO nFirstFrame+nFrames-1

     PRINT FORMAT( "Frame %3d: %10.3f | %10.3f", i, adS( i-1 ), adM( i-1, 0 ) ),

  NEXT i 

ENDIF