⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pb_err.h

📁 profibus dp主站于从站通信
💻 H
📖 第 1 页 / 共 4 页
字号:
/* errors 10 to 15 are slave specific */
#define DP_ERROR_ACCESS_INVALID_INDEX  (DP_ERROR_CLASS_ACCESS | 0x00)
#define DP_ERROR_ACCESS_INVALID_LENGTH (DP_ERROR_CLASS_ACCESS | 0x01)
#define DP_ERROR_ACCESS_INVALID_SLOT   (DP_ERROR_CLASS_ACCESS | 0x02)
#define DP_ERROR_ACCESS_TYPE_CONFLICT  (DP_ERROR_CLASS_ACCESS | 0x03)
#define DP_ERROR_ACCESS_INVALID_AREA   (DP_ERROR_CLASS_ACCESS | 0x04)
#define DP_ERROR_ACCESS_STATE_CONFLICT (DP_ERROR_CLASS_ACCESS | 0x05)
#define DP_ERROR_ACCESS_DENIED_ACCESS  (DP_ERROR_CLASS_ACCESS | 0x06)
#define DP_ERROR_ACCESS_INVALID_RANGE  (DP_ERROR_CLASS_ACCESS | 0x07)
#define DP_ERROR_ACCESS_INVALID_PARAM  (DP_ERROR_CLASS_ACCESS | 0x08)
#define DP_ERROR_ACCESS_INVALID_TYPE   (DP_ERROR_CLASS_ACCESS | 0x09)

#define DP_ERROR_CLASS_RESOURCE        0xC0
/* errors 4 to 7 are reserved, errors 8 to 15 are slave specific */
#define DP_ERROR_RES_READ_CONFLICT     (DP_ERROR_CLASS_RESOURCE | 0x00)
#define DP_ERROR_RES_WRITE_CONFLICT    (DP_ERROR_CLASS_RESOURCE | 0x01)
#define DP_ERROR_RES_BUSY              (DP_ERROR_CLASS_RESOURCE | 0x02)
#define DP_ERROR_RES_UNAVAILABLE       (DP_ERROR_CLASS_RESOURCE | 0x03)

                                                            /* error_code_2 */
/* If error_decode is DP_ERROR_DECODE_DPV1, the following is valid */
/* error_code_2 is completely slave specific */


/*****************************************************************************/
/*************            INTERFACE ERRORS               *********************/
/*****************************************************************************/

#if (PB_VER < 500)
#define   E_FATAL_ERROR                    7    /* unrecoverable error on board */
#define   E_INIT_INVALID_PARAMETER         8     /* invalid initialize parameter*/

#define   E_LOADER_ERROR                   9                  /* download error */

#define   E_NO_CNTRL_RES                  10     /* controller does not respond */
#define   E_INVALID_CNTRL_TYPE_VERSION    11 /* inv. controller type or SW vers.*/
#define   E_INVALID_LAYER                 12                   /* invalid layer */
#define   E_INVALID_SERVICE               13      /* invalid service identifier */
#define   E_INVALID_PRIMITIVE             14       /* invalid service primitive */
#define   E_INVALID_DATA_SIZE             15 /* not enough cmi data block memory*/
#define   E_INVALID_COMM_REF              16 /* invalid communication reference */
#define   E_INVALID_FMS_COMM_REF          17     /* invalid FMS comm. reference */
#define   E_INVALID_FMA_COMM_REF          18    /* invalid FMA7 comm. reference */
#define   E_INVALID_CMI_CALL              19                /* invalid CMI call */
#define   E_CMI_ERROR                     20            /* error occured in CMI */
#define   E_RESOURCE_UNAVAILABLE          21           /* no resource available */
#define   E_NO_PARALLEL_SERVICES          22    /* no parallel services allowed */
#define   E_SERVICE_CONSTR_CONFLICT       23    /* serv. tempor. not executable */
#define   E_SERVICE_NOT_SUPPORTED         24           /* service not supported */
#define   E_SERVICE_NOT_EXECUTABLE        25          /* service not executable */
#endif


#ifndef E_OK
#define   E_OK                             0                        /* no error */
#endif
#define   E_IF_FATAL_ERROR                 7    /* unrecoverable error on board */
#define   E_IF_INIT_INVALID_PARAMETER      8    /* invalid initialize parameter */
#define   E_IF_LOADER_ERROR                9         /* download firmware error */
#define   E_IF_NO_CNTRL_RES               10     /* controller does not respond */
#define   E_IF_INVALID_CNTRL_TYPE_VERSION 11 /* inv. controller type or SW vers.*/
#define   E_IF_INVALID_LAYER              12                   /* invalid layer */
#define   E_IF_INVALID_SERVICE            13      /* invalid service identifier */
#define   E_IF_INVALID_PRIMITIVE          14       /* invalid service primitive */
#define   E_IF_INVALID_DATA_SIZE          15 /* not enough cmi data block memory*/
#define   E_IF_INVALID_COMM_REF           16 /* invalid communication reference */
#define   E_IF_INVALID_CMI_CALL           19                /* invalid CMI call */
#define   E_IF_CMI_ERROR                  20            /* error occured in CMI */
#define   E_IF_RESOURCE_UNAVAILABLE       21           /* no resource available */
#define   E_IF_NO_PARALLEL_SERVICES       22    /* no parallel services allowed */
#define   E_IF_SERVICE_CONSTR_CONFLICT    23    /* serv. tempor. not executable */
#define   E_IF_SERVICE_NOT_SUPPORTED      24           /* service not supported */
#define   E_IF_SERVICE_NOT_EXECUTABLE     25          /* service not executable */
#define   E_IF_INVALID_VERSION            26                 /* invalid version */
#define   E_IF_STATE_CONFLICT             27                 /* state conflict  */
#define   E_IF_NO_CNTRL_PRESENT           28        /* controller not available */
#define   E_IF_INVALID_PARAMETER          30   /* wrong parameter in REQ or RES */
#define   E_IF_INIT_FAILED                31  /* init. API or Controller failed */
#define   E_IF_EXIT_FAILED                32   /* exit API or Controller failed */
#define   E_IF_PAPI_NOT_INITIALIZED       33             /* API not initialized */
#define   E_IF_NO_DEVICE_CONNECTION       34   /* no PROFIBUS device connection */

/* error codes available only in Win NT --------------------------------------- */
#define E_IF_SLAVE_DIAG_DATA            0xF0               /* no data available */
                                              /* new diagnostics data available */
#define E_IF_SLAVE_ERROR                0xF1                /* no data exchange */
#define E_IF_INVALID_DP_STATE           0xF2 /* DP is not in state clear/operate*/
#define E_IF_READING_REGISTRY           0xF3          /* error reading registry */
#define E_IF_OS_ERROR                   0xFF       /* OS system (WIN,DOS) error */
                                                /* get detail with GetLastError */

/* INTERFACE ERROR DETAIL CODES (only Win95/98) ------------------------------- */
/* for folLowing INTERFACE-ERRORS                                               */
/* - E_IF_NO_CNTRL_PRESENT                                                      */
/* - E_IF_INIT_FAILED                                                           */
/* - E_IF_EXIT_FAILED                                                           */

#define PBDRV                            PROFIBRD
#define PROFIBRD_INTERNAL_ERROR          0x0030        /* internal driver error */
#define PROFIBRD_GENERAL_ERROR           0x0031         /* general driver error */
#define PROFIBRD_IO_PENDING              0x0032               /* driver timeout */
#define PROFIBRD_IO_CANCELLED            0x0033     /* driver call not finished */
#define PROFIBRD_ILLEGAL_CALL            0x0034        /* driver call cancelled */
#define PROFIBRD_NOT_SUPPORTED           0x0035    /* driver call not supported */
#define PROFIBRD_VERSION_ERROR           0x0036    /* driver interface version  */
#define PROFIBRD_DRIVER_VERSION_ERROR    0x0037               /* driver version */
#define PROFIBRD_DRIVER_NOT_FOUND        0x0038             /* driver not found */
#define PROFIBRD_NOT_ENOUGH_MEMORY       0x0039            /* not enough memory */
#define PROFIBRD_TOO_MANY_DEVICES        0x003A              /* to many devices */
#define PROFIBRD_UNKNOWN_DEVICE          0x003B               /* unknown device */
#define PROFIBRD_DEVICE_ACCESS_ERROR     0x003C          /* device access error */
#define PROFIBRD_DPRAM_ALREADY_USED      0x003D        /* device already exists */
#define PROFIBRD_MAP_MEMORY_ERROR        0x003E         /* memory mapping error */
#define PROFIBRD_MEMORY_UNKNOWN          0x003F         /* unknown phys. memory */
#define PROFIBRD_READ_REGISTRY_ERROR     0x0040          /* read registry error */
#define PROFIBRD_DEVICE_NOT_FOUND        0x0041             /* device not found */
#define PROFIBRD_DEVICE_ALREADY_OPEN     0x0042        /* device already opened */
#define PROFIBRD_PORT_ALREADY_USED       0x0043       /* IO port already in use */


#define PROFI_ERROR_FLAG       0xe0000000
#define PROFI_ERROR(code)      ((code) | PROFI_ERROR_FLAG)


/*****************************************************************************/
/*************        ERROR DATA STRUCTURES      *****************************/
/*****************************************************************************/

#define MAX_ERROR_DESCR_LENGTH    _NAME_LENGTH(ERROR_DESCR_LENGTH)

/* --- standard error data structure --------------------------------------- */
typedef struct _T_ERROR
{
  USIGN16 class_code;                              /* class and code         */
  INT16   add_detail;                              /* additional detail      */
  STRINGV add_description[MAX_ERROR_DESCR_LENGTH]; /* additional description */
} T_ERROR;


/* --- PI error data structure --------------------------------------------- */
typedef  struct _T_PI_ERROR
{
   T_ERROR   error;                               /*  standard error type    */
   USIGN8    pi_state;                            /*  pi state               */
   USIGN8    dummy;                               /*  alignment              */
} T_PI_ERROR;


/* --- PI-LOC error data structure ----------------------------------------- */
typedef  struct _T_PI_LOC_ERROR
{
  T_ERROR    error;                              /*  standard error type    */
  USIGN8     pi_state;                           /*  pi state               */
  USIGN8     dummy;                              /*  alignment              */
  USIGN32    vfd_number;                         /*  vfd number             */
} T_PI_LOC_ERROR;


/* --- OD error data structure --------------------------------------------- */
typedef struct _T_OD_ERROR
{
   T_ERROR  error;                                /* standard error type     */
   USIGN16  index;                                /* error index             */
} T_OD_ERROR;

#if (PB_VER < 500)
typedef T_OD_ERROR T_OV_ERROR;
#endif

/* --- source OD error data structure -------------------------------------- */
typedef struct _T_SRC_OD_ERROR
{
   T_ERROR  error;                                /* standard error type     */
   USIGN32  vfd_number;                           /* vfd number              */
   USIGN16  index;                                /* error index             */
} T_SRC_OD_ERROR;

#if (PB_VER < 500)
typedef T_SRC_OD_ERROR T_SRC_OV_ERROR;
#endif


/* --- VFD error data structure -------------------------------------------- */
typedef struct _T_VFD_ERROR
{
   T_ERROR  error;                                /* standard error type     */
   USIGN32  vfd_number;                           /* vfd number              */
} T_VFD_ERROR;


/* --- CRL error data structure -------------------------------------------- */
typedef struct _T_CRL_ERROR
{
   T_ERROR  error;                                /* standard error type     */
   USIGN16  error_cr;                             /* error cr                */
} T_CRL_ERROR;

#if (PB_VER < 500)
typedef T_CRL_ERROR T_KBL_ERROR;
#endif

/*****************************************************************************/
/*************   FDLIF-ERROR DATA STRUCTURES     *****************************/
/*****************************************************************************/
typedef struct _T_FDLIF_ERROR
{
  USIGN8  result;                                          /* class and code */
  USIGN8  dummy;                                           /* alignment byte */
  USIGN16 add_detail;                                   /* additional detail */
} T_FDLIF_ERROR;

/*****************************************************************************/
/*************      EXCEPTION STRUCTURES         *****************************/
/*****************************************************************************/

typedef struct _T_EXCEPTION
{
  USIGN8  task_id;              /* task identifier in which execption occurs */
  USIGN8  par1;                                               /* parameter 1 */
  USIGN16 par2;                                               /* parameter 2 */
  USIGN16 par3;                                               /* parameter 3 */
} T_EXCEPTION;


#pragma warning (disable : 4103)     /* used #pragma pack to reset alignment */
#ifdef WIN32
#pragma pack(pop)
#else
#pragma pack()
#endif
#pragma warning (default : 4103)


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -