/***************************************************************************
file name:	userLIB.H

contents:
	 This file contains various defines that is used with the GOOGOL TECH.
	 GT400 motion control board software source code. GT400LIB.C will include
	 this file. If GT400LIB.C is used in user file ,please include the file:
	 GT400LIB.H
****************************************************************************/

/* return explain:
	-2		版本出错			GT_VRSN_ERR
	-1		通讯失败   		GT_COM_ERR
	0		OK                      GT_CMD_OK
	1		命令出错                	GT_CMD_ERR
	2		半径=0或太大            	GT_RADI_ERR
			直线长度=0或太大        	GT_LEN_ERR
	4		（加）速度=0或太大      	GT_ANV_ERR
	5		参数矛盾                	GT_PRM_ANTI
	6		方程无解                	GT_MAP_ERR
	7        	过程参数错误             	GT_PRM_ERR
*/
#if !defined(_USERLIB)
#define _USERLIB

#ifdef __cplusplus
extern "C" {
#endif

#define USHORT	unsigned short

short GT_AddList(void) ;
short GT_AlarmOn(USHORT axis) ;
short GT_AlarmOff(USHORT axis) ;
short GT_ArcXY(double x_center,double y_center,double angle);
short GT_ArcXYP(double x_end,double y_end,double r,short dir);
short GT_ArcYZ(double y_center,double z_center,double angle);
short GT_ArcYZP(double y_end,double z_end,double r,short dir);
short GT_ArcZX(double z_center,double x_center,double angle);
short GT_ArcZXP(double z_end,double x_end,double r,short dir);
short GT_AxisOff(USHORT axis); 
short GT_AxisOn(USHORT axis); 
short GT_CaptHome(USHORT axis);
short GT_CaptIndex(USHORT axis);
short GT_Close();
short GT_ClrSts(USHORT axis);
short GT_EndList(void);
short GT_EStpMtn(void);
short GT_DrvRst(USHORT axis) ;
short GT_ExInpt(USHORT *value);
short GT_ExOpt(USHORT value);
short GT_GetBrkPnt(long *pnt);
short GT_GetCapt(USHORT axis,long *value); 
short GT_GetCmdSts(USHORT *value) ;
short GT_GetCrdSts(USHORT *coord_status);
short GT_GetLmtSwt(USHORT *value) ;
short GT_GetMtnNm(USHORT *motion_linenum);
short GT_GetPrfVel(double *vel);
short GT_GetPrfPnt(long* pnt); 
short GT_GetSegPnt(long* pnt);
short GT_GetSts(USHORT axis, USHORT *value) ;
short GT_HardRst(void);
short GT_LmtSns(USHORT value);
short GT_LmtsOff(USHORT axis) ;
short GT_LmtsOn(USHORT axis) ;
short GT_LnXY(double x, double y);
short GT_LnXYZ(double x,double y,double z);
short GT_LnXYZA(double x,double y,double z,double a);
short GT_LnXYG0(double x, double y);
short GT_LnXYZG0(double x, double y,double z);
short GT_LnXYZAG0(double x,double y,double z,double a);
short GT_MvXY(double x,double y,double vel,double accel);
short GT_MvXYZ(double x,double y,double z,double vel,double accel);
short GT_MvXYZA(double x,double y,double z,double a,double vel,double accel);
short GT_Open();
short GT_Override(double value);
short GT_OverrideG0(double value);
short GT_RestoreMtn (void);
short GT_Reset(void);
short GT_RstSts(USHORT Axis,USHORT value);
short GT_SetAtlPos(USHORT AxisNum, long pos);
short GT_SetAddr(USHORT address);
short GT_SetDccFlag(void);
short GT_SetMaxVel(double value);
short GT_SetSynAcc(double accel); 
short GT_SetStrtVel(double value);
short GT_SetSynVel(double vel);
short GT_SetStpAcc(double value);
short GT_StpMtn(void);
short GT_StepDir(USHORT axis);
short GT_StepPulse(USHORT axis);
short GT_StrtList(void) ;
short GT_StrtMtn();
short GT_ZeroPos(USHORT AxisNum);

#ifdef __cplusplus
}
#endif

#endif //_USERLIB