Functions > di_strerr

Syntax 

di_strerr outputs error strings (as defined below).

Syntax 

int di_strerr(err_code,err_str);

unsigned err_code;

/* error code returned by function call */

char *err_str;

/* pointer to string to return error */

Parameters

The di_strerr function maps err_code to an error message string. The pointer to the string is passed to the function and the string is modified by the function. The maximum length of the error message string is 255 characters.

Return Value

The di_strerr function returns a number of characters in err_str.

Dependencies

di_open

Remarks

Error Codes

  Error Code
  DI_NO_ERR 0
  DI_DRIVER_ERR 1
  DI_COMM_ERR 2
  DI_RESET_ERR 3
  DI_CLOSE_ERR 4
  DI_INFO_ERR 5
  DI_DIGOUT_ERR 6
  DI_ANOUT_ERR 7
  DI_MODE_ERR 8
  DI_START_SCN_ERR 9
  DI_STOP_SCN_ERR 10
  DI_INLIST_ERR 11
  DI_OUTLIST_ERR 12
  DI_BURST_ERR 13
  DI_LENGTH_ERR 14
  DI_EVENT_COUNT_ERR 15
  DI_OPENED_ERR 19
  DI_ERR_CODE 20
  DI_ALREADY_OPEN_ERR 21
  NEXT_ERROR_CODE 22

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");

di_close();

}

 

Copyright © DATAQ Instruments, Inc.