#ifndef __H_NC_ERR_CODE_H__
#define __H_NC_ERR_CODE_H__




#define Err_OK	0   //OK

//comm
#define ERR_CM_OPEN_CFG			2   //common:打开配置
#define ERR_CM_READ_CFG			3   //common:读配置
#define ERR_CM_WRITE_CFG		4   //common:写配置
#define ERR_CM_CMD_UNSUPPORT	5   //common:命令不支持
#define ERR_CM_NOT_READY    	6   //common:未就绪

// runtime
#define ERR_RT_ALLOC_MEM		10	// runtime：内存申请错误
#define ERR_RT_ALLOC_MEM1		11	// runtime：内存申请错误1
#define ERR_RT_SCPT_INVALID		12	// runtime：无效的脚本，长度无效或格式无效
#define ERR_RT_SCPT_SYNTAX		13	// runtime：脚本存在语法错误
#define ERR_RT_SCPT_ERRMEM		14	// runtime：脚本运行内存错误
#define ERR_RT_SCPT_CALL		15	// runtime：调用内存错误
#define ERR_RT_STEPINTO_NOPAUSE	16	// runtime：单步时不是暂停状态
#define ERR_RT_STEPOVER_NOPAUSE	17	// runtime：单步跳过时不是暂停状态
#define ERR_RT_SCPT_NoTask		18	// runtime：未找到任务
#define ERR_RT_NOT_INIT			19	// runtime: 未初始化
#define ERR_RT_UNIT_PARAM		20	// runtime:单位初始化错误
#define	ERR_RT_AXIS_INDEX		21	// runtime:轴序号错误
#define ERR_RT_DO_GROUP			22	// runtime:DO组别超出范围
#define ERR_RT_DO_INDEX			23	// runtime:DO序号超出范围
#define ERR_RT_PWM_CH			24	// runtime:pwm output channel error
#define ERR_RT_PWM_SET			25	// runtime:pwm output error
#define ERR_RT_GET_STS			26	// runtime:get state
#define ERR_RT_EN_SWLMT			27	// runtime:enable soft limit
#define ERR_RT_CFG_SWLMT		28	// runtime:configure soft limit
#define ERR_HOME_AXIS_BUSY      29  // home:axis busy
#define ERR_HOME_AXIS_ALARM     30  // home:axis alarm
#define ERR_HOME_SVR_ON         31  // home:error axis on
#define ERR_HOME_MOVE           32  // home:axis start move
#define ERR_HOME_NOTFOUND       33  // home:未找到回零轴
#define ERR_HOME_INIT           34  // home:axis home init
#define ERR_HOME_READ_STS       35  // home:read home sts
#define ERR_HOME_HOMING         36  // home:start homing
#define ERR_HOME_INDEX          37  // home:config index mode
#define ERR_HOME_STEP_END       38  // home:回零结束错误
#define ERR_HOME_CONFIG4        39  // home:config err 4
#define ERR_HOME_CONFIG5        40  // home:config err 5
#define ERR_HOME_START          41  // home:启动回零错误
#define ERR_HOME_FAIL           42  // home:home fail
#define ERR_HOME_FAIL_MV        43  // home:home fail,move err
#define ERR_HOME_FAIL_SWT       44  // home:home fail,switch err
#define ERR_HOME_FAIL_NO_CFG    45  // home:not config
#define ERR_RT_SCPT_FILEFMT     46  // runtime:file format error
#define ERR_RT_SCPT_FILERW      47  // runtime:file rw error

// run error
#define ERR_RUN_RUN_ERR    		50  // run:run error
#define ERR_RT_STATE_ERR   		51  // runtime:lua state test error
#define ERR_RT_ERR_EXIST   		52  // runtime:error exist,can not do this 
#define ERR_RT_SET_VAR_NO		53	// runtime: set global variable,var not exist
#define ERR_RT_NEW_SCPT 		54	// runtime: create script runtime
#define ERR_RT_IN_RUN   		55	// runtime: is running
#define ERR_RT_SCPT_BINFILE   	56	// runtime: bin file path
#define ERR_RT_SCPT_OPEN	   	57	// runtime: bin file open
#define ERR_RT_SCPT_TASK_CFG   	58	// runtime: task config error

// project error
#define ERR_PRJ_NO_SOR    		500  // project:no source file
#define ERR_PRJ_CRT_BIN    		501  // project:create download file
#define ERR_PRJ_NO_MCCFG   		502  // project:can not found mc config file
#define ERR_PRJ_OPEN_MCCFG   	503  // project:open mc config file
#define ERR_PRJ_OPEN_SOR    	504  // project:open source file
#define ERR_PRJ_CRT_SYMBOL    	505  // project:create symbol file
#define ERR_PRJ_NO_BIN      	506  // project:download,no binnary file
#define ERR_PRJ_LOAD_FILE      	507  // project:project load error
#define ERR_PRJ_LOAD_NAME      	508  // project:project load ,file name err
#define ERR_PRJ_NEW_CANCEL     	509  // project:取消工程新建
#define ERR_PRJ_CRT_SOR     	510  // project:创建源文件错误
#define ERR_PRJ_DEL_SOR     	511  // project:删除源文件错误
#define ERR_PRJ_CONNECT     	512  // project:搜索控制器
#define ERR_PRJ_DEV_OPEN     	513  // project:连接到控制器
#define ERR_PRJ_PRE_BUILD     	514  // project:预编译错误




#endif	//__H_NC_ERR_CODE_H__
