Functions > di_list_length

Syntax 

The di_list_length function sets input and output scan list lengths (number of channels). di_list_length must be called to acquire input channels.

Note: This function must be called before di_inlist.

Syntax 

int di_list_length(in_length,out_length);

unsigned in_length;

/* sets input list length */

unsigned out_length;

/* sets output list length */

Parameters

in_length

Sets the input scan list length - the number of channels you will acquire data from.

out_length

Sets the output scan list length - the number of channels you will output data to.

Note: For devices that do not support output functions, out_length is reserved for compatibility (0).

Return Value

DI_NO_ERR No error
DI_OPENED_ERR Device not opened
DI_COMM_ERR Communication error
DI_LENGTH_ERR List Length error

Dependencies

di_open

Remarks

none

Sample Code

#include "200sdk.h"

int errcode;

char errstr[255];

main()

{

int i;

if(errcode = di_open()){

/* open the device for comm */

di_strerr(errcode,errstr);

printf("%s",errstr);

}

else

printf("Device installed successfully.....\n");

if(errcode = di_list_length(1,0)){

/* scan one input element (no outputs) */

di_strerr(errcode,errstr);

printf("%s",errstr);

}

else

printf("Length error.....\n");

di_close();

}

 

Copyright © DATAQ Instruments, Inc.