#ifndef _ECATERRNO_H_
#define _ECATERRNO_H_


#define ECAT_ERR_REQUEST_MASTER								-1001		/**< Request Master. */
#define ECAT_ERR_ETHERNET_LINK_DOWN							-1002		/**< Ethernet link is down. */
#define ECAT_ERR_SLAVES_STATE									-1003		/**< All slaves al state != OP*/
#define ECAT_ERR_WORKING_COUNTER								-1004		/**< Working counter*/
#define ECAT_ERR_SLAVE_CNT_EXCEEDED								-1005		/**<Slave count exceed maximum support count*/
#define ECAT_ERR_CREATE_DOMAIN									-1006		/**< Create domain*/
#define ECAT_ERR_ALLOCATE_SLAVE_DATA								-1007		/**< Allocate slave data*/
#define ECAT_ERR_CONFIG_SLAVE									-1008		/**< Configure slave*/
#define ECAT_ERR_NETWORK_MISMATCH								-1009		/**< Network configuration mismatch*/
#define ECAT_ERR_MASTER_ACTIVATE								-1010		/**< Master activate*/
#define ECAT_ERR_GET_PROCESS_DATA								-1011		/**< Get ProcessData*/

#define ECAT_ERR_CONFIG_CYCLIC_TASK							-1012		/**< Configure cyclic task*/
#define ECAT_ERR_RUN_CYCLIC_TASK								-1013		/**< Run cyclic task*/

#define ECAT_ERR_INVALID_SLAVE_TYPE							-1014		/**< Invalid slave type. */
#define ECAT_ERR_SAME_SLAVE_NO									-1015		/**< Same slave number. */
#define ECAT_ERR_INVALID_SLAVE_NO								-1016		/**< Invalid slave number. */
#define ECAT_ERR_INVALID_PARAM									-1017		/**< Invalid input parameter. */
#define ECAT_ERR_INVALID_DATA_SIZE								-1018		/**< Invalid data size. */
#define ECAT_ERR_SDO_REQUEST_BUSY								-1019		/**< Sdo request busy. */
#define ECAT_ERR_SDO_REQUEST_ERROR								-1020		/**< Sdo request error. */
#define ECAT_ERR_ALLOCATE_PDO_QUEUE							-1021		/**< Allocate PDO queue. */
#define ECAT_ERR_INVALID_OFFSET								-1022		/**< Invalid offset. */
#define ECAT_ERR_INIT_MOTION									-1023		/**< Initialize motion data*/
#define ECAT_ERR_GET_SLAVE_INFO									-1024		/**< Get slave information. */
#define ECAT_ERR_OPEN_FILE												-1025		/**< open file. */
#define ECAT_ERR_WRITE_FILE												-1026		/**< write data to file. */
#define ECAT_ERR_READ_FILE												-1027		/**< read data from file. */
#define ECAT_ERR_FUNC_NOT_SUPPORT							-1028			/**< Function not support. */
#define ECAT_ERR_INVALID_CHANNEL							-1029			/**< Invalid channel. */
#define ECAT_ERR_EMG_HAPPENED												-1030			/**< EMG happened. */
#define ECAT_ERR_INVALID_PID_NO	 						-1031   	/**< Invalid PID number. */
#define ECAT_ERR_TIMER_NOT_ACTIVATED						-1032/**< Timer not activated. */
#define ECAT_ERR_ALL_EVENT_CREATE							-1033/**< All events are created. */
#define ECAT_ERR_EVENT_NOT_CREATE							-1034/**< EventID is not created. */
#define ECAT_ERR_INVALID_EVENTID	 					-1035   	/**< Invalid EventID. */
#define ECAT_ERR_INVALID_FILTER_TYPE	 					-1036   	/**< Invalid filter type. */
#define ECAT_ERR_SLAVES_ALIAS									-1037		/**< repeating alias or alias == 0*/
#define ECAT_ERR_SLAVES_ALIAS_NOT_EXIST						-1038		/**< alias is not exist*/
#define ECAT_ERR_OPTASK									-1039		/**< start op task*/
#define ECAT_ERR_SLAVES_REQUEST_BUSY						-1040		/**< slave request busy*/
#define ECAT_ERR_SLAVES_REQUEST_ERROR						-1041		/**< slave request error*/
#define ECAT_ERR_ALL_BUFFER_USED						-1042		/**< all buffer are used*/
#define ECAT_ERR_BUFFER_NOT_ENABLE						-1043		/**<  buffer not enable*/
#define ECAT_ERR_CYCLETIME_EXCEEDED							-1044		/**< cycle time lower than minimum support. */
#define ECAT_ERR_SLAVE_NOT_CONFIGURED							-1045		/**< slave not configured. */
#define ECAT_ERR_DEACTIVATE_SLAVES							-1046		/**< slaves changing state from OP to PreOP. */
#define ECAT_ERR_MASTER_BUSY_SCANNING								-1047		/**< Master Busy Scanning . */
#define ECAT_ERR_SLAVE_EEPROM_ERROR								-1048		/**< Slave EEPROM error . */

#define ECAT_ERR_MC_NOT_ENABLE_DC								-1100   	/**< Slave not enable dc. */
#define ECAT_ERR_MC_TIME_OUT 									-1101   	/**< Motion control timeout. */
#define ECAT_ERR_MC_AXIS_CNT_EXCEEDED							-1102		/**< axis count exceed maximum support count. */
#define ECAT_ERR_MC_NOT_INITIALIZED							-1103		/**< Motion not initialized. */
#define ECAT_ERR_MC_INVALID_AXIS_NO	 						-1104   	/**< Invalid axis number. */
#define ECAT_ERR_MC_NOT_AXIS_SERVO_ON 							-1105   	/**< The axis's servo is not on.*/
#define ECAT_ERR_MC_INVALID_AXIS_STATE 						-1106   	/**< Invalid axis state. */
#define ECAT_ERR_MC_DRIVE_FAULT 								-1107   	/**< Drive fault occurred. */
#define ECAT_ERR_MC_DRIVE_WARNING								-1108   	/**< Drive warning occurred. */
#define ECAT_ERR_MC_INVALID_PARAM								-1109		/**< Invalid input parameter. */
#define ECAT_ERR_MC_HOMING										-1110		/**< Homing error. */
#define ECAT_ERR_MC_LIMIT_ACTIVE								-1111		/**< Limit active. */
#define ECAT_ERR_MC_INVALID_ACC_TIME							-1112		/**< Invalid Acc Time. */
#define ECAT_ERR_MC_INVALID_GROUP_NO	 						-1113   	/**< Invalid group number. */
#define ECAT_ERR_MC_INVALID_GROUP_STATE	 					-1114   	/**< Invalid group state. */
#define ECAT_ERR_MC_AXIS_WAS_IN_GROUP	 						-1115   	/**< Invalid group state. */
#define ECAT_ERR_MC_AXIS_IN_OTHER_GROUP	 					-1116   	/**< Axis was in group. */
#define ECAT_ERR_MC_GROUP_CMD_ALLOCATE							-1117   	/**< Allocate group command. */
#define ECAT_ERR_MC_GROUP_CMD_BUFFER_OVERFLOW					-1118   	/**< group command buffer overflow. */
#define ECAT_ERR_MC_INVALID_AXIS_SYNC_MODE						-1119   	/**< Invalid axis synchronization mode. */
#define ECAT_ERR_MC_INVALID_PROFILE_NO						-1120   	/**< Invalid profile number. */
#define ECAT_ERR_MC_INVALID_GROUP_MOVE_CMD						-1121   	/**< Invalid group move command. */
#define ECAT_ERR_MC_GROUP_CMD_MODE_NOT_SUPPORT				-1122			/**< Group command mode not support. */
#define ECAT_ERR_MC_INVALID_ACC_DEC_TYPE							-1123		/**< Invalid Acc Dec Type. */
#define ECAT_ERR_MC_INVALID_VEL								-1124		/**< Invalid input velocity. */
#define ECAT_ERR_MC_INVALID_ANGLE								-1125		/**< Invalid input angle. */
#define ECAT_ERR_MC_INVALID_RADIUS								-1126		/**< Invalid input radius. */
#define ECAT_ERR_MC_INVALID_END_POS								-1127		/**< Invalid input end position. */
#define ECAT_ERR_MC_INVALID_ECAM_TABLE_NO									-1128   	/**< Invalid table number. */
#define ECAT_ERR_MC_INVALID_NORMAL_VECTOR					-1129   	/**< Invalid normal vector. */
#define ECAT_ERR_MC_NOT_SETUP								-1130   	/**< stewart platform not setup */
#define ECAT_ERR_MC_GREATER_THAN_MAX_RODLENGTH				-1131   	/**< greater than max rodlength */
#define ECAT_ERR_MC_LESS_THAN_RODLENGTH					-1132   	/**< less than rodlength */
#define ECAT_ERR_MC_GREATER_THAN_RECORD_COUNT				-1133		/**< greater than record count >*/
#define ECAT_ERR_MC_SOFTWARE_LIMIT_ACTIVE					-1134		/**< Position Software Limit active. */
#define ECAT_ERR_MC_GANTRY_POS_EXCESSIVE_DEVIATION			-1135		/**< Gantry Position deviation greater than set value. */
#define ECAT_ERR_MC_GROUP_NO_NOT_SUPPORT					-1136		/**< Group number not support. */
#define ECAT_ERR_MC_INVALID_MOVE_CMD					-1137   	/**< Invalid move command. */
#define ECAT_ERR_MC_QUEUE_IS_FULL				-1138   	/**< Queue is full. */
#define ECAT_ERR_MC_COORDINATE_TRANS_ON				-1139   	/**< Coordinate transform is on */
#define ECAT_ERR_MC_HAVE_NOT_BEEN_SET				-1140   	/**< have not been set */
#define ECAT_ERR_MC_HOMIE_NOT_DONE							-1141		/**< Homing not done. */
#define ECAT_ERR_MC_INHIBITED_FUNCTION						-1142		/**< inhibited functions. */
#define ECAT_ERR_MC_LACK_PDOS								-1143		/**< Lack of necessary pdos. */
#define ECAT_ERR_MC_SAFETY_STOP								-1144		/**< Force by other axis etc.-1004. */
#define ECAT_ERR_MC_GANTRY_SYNC_ERR						-1145		/**< Master or slave error / servo off / homing. */


#define ECAT_ERR_IPC_INVALID_DEVICE_NO						-1201		/**< Invalid device No. */
#define ECAT_ERR_IPC_DEVICE_IS_OPEN							-1202		/**< Device is open. */
#define ECAT_ERR_IPC_DEVICE_NOT_OPEN							-1203		/**< Device not open. */
#define ECAT_ERR_IPC_CREATE_HANDLE							-1204		/**< Create IPC handle object. */
#define ECAT_ERR_IPC_BUSY									-1205		/**< IPC busy. */
#define ECAT_ERR_IPC_TIME_OUT 								-1206		/**< IPC time out. */
#define ECAT_ERR_IPC_INVALID_CMD							-1207		/**< Invalid command No. */
#define ECAT_ERR_IPC_WRITE_SHM								-1208		/**< write data to shared memory. */
#define ECAT_ERR_IPC_READ_SHM								-1209		/**< read data frome shared memory. */
#define ECAT_ERR_IPC_RUN_DOWN_UP_LOAD						-1210		/**< IPC Process run Download/Upload Command . */
#define ECAT_ERR_IPC_INVALID_SHM							-1211		/**< Invalid shared memory. */
#define ECAT_ERR_IPC_DEVICE_NOT_READY 						-1212		/**< IPC not ready. */


#define ECAT_ERR_DRV_GET_INFO								-1301		/**< Get driver information. */
#define ECAT_ERR_DRV_CREATE_HANDLE							-1302		/**< Create driver handle object. */
#define ECAT_ERR_DRV_IOCTL									-1303		/**< Driver I/O control. */
#define ECAT_ERR_DRV_DEVICE_NOT_FOUND						-1304		/**< Cannot find device. */
#define ECAT_ERR_IXE_VERSION								-1305		/**< Cannot read/write ixecat version. */
#define ECAT_ERR_DRV_DEVICE_BEEN_OPENED						-1306		/**< Device has been opened by other process. */

#define ECAT_ERR_ST_NOT_POSITION_MODE							-1401   	/**< Not in the position mode. */
#define ECAT_ERR_ST_TRIP_ALARM								-1402   	/**< trips a alarm. */
#define ECAT_ERR_ST_INVALID_TABLE_NO								-1403   	/**< Invalid Table No. */
#define ECAT_ERR_ST_LIB_NOT_EXIST								-1404   	/**< wheelControl lib not exist. */
#define ECAT_ERR_ST_NOT_DISABLE_MODE							-1405   	/**< Not in the disable mode. */
	
#define ERR_RW_FLASH_ERRCRC			-1401	// CRC Check Error
#define ERR_RW_FLASH_OVERADDRESS		-1402	// Over Flash Address Definition
#define ERR_RW_FLASH_ERRCOM			-1403	// Command Error
#define ERR_RW_FLASH_ERRFLASHCTL		-1404	// Flash Control Error
#define ERR_RW_FLASH_TIMEOUT			-1405	// Timeout
#define ERR_RW_FLASH_UNKNOW			-1406	// Unknow
#define ERR_RW_FLASH_CFM_CMD_CNT			-1407	// Conform Command Count
#define ERR_RW_FLASH_CFM_CMD			-1408	// Conform Command
#define ERR_RW_FLASH_CFM_CMD_DATA			-1409	// Conform Command Data


#endif /* ECATERRNO_H_ */
