
#ifndef _ECATDEVICEAPI_H_
#define _ECATDEVICEAPI_H_
#include <stdint.h>
#ifdef _WINDOWS
#include <Windows.h>
#endif
/*****************************************************************************/
/** Max Macro
 */
#define DEV_NETWORK_INFO_NO_MAX				8
#define MC_AXIS_NO_MAX                    	64
#define MC_AXIS_NO_LIMIT					64
#define MC_GROUP_NO_MAX                   	8
#define MC_AXIS_ADVANCE_NO_MAX             	4
#define MC_GROUP_CMD_BUFFER_MAX				7000
#define MC_PROFILE_NO_MAX					16
#define MC_PROFILE_DATA_MAX					3000
#define RW_PDO_DATA_SIZE_MAX 				512
#define NETWORK_SLAVE_MAX 80
#define CARD_DEVICE_NO_MAX 16
#define DEVICE_SERIAL_NO_SIZE 8
#define Motiondata_Max 100000
#define FILE_BUFFER_SIZE 512
#define PID_NO_MAX                    	10
#define EVENT_NO_MAX                    32
#define RECORDDATA_GET_COUNT_MAX 64
#define MAX_SLAVE_NAME_LENGTH 64
#define MC_PATH_DATA_NO_MAX 3
#define MC_PATH_DATA_ARGS_MAX             	5
#define PDO_BUFFER_CHANNEL_MAX             	3
#define PDO_BUFFER_DATA_MAX             	128
#define MC_AXIS_CMD_BUFFER_MAX				100
#define AI_FILTER_CHANNEL_MAX				8
#define PDO_INTOOUT_CHANNEL_MAX             	8
#define LACK_PDOS_GET_COUNT_MAX             	16
#define ENC_BUFFER_CHANNEL_MAX         6
#define ENC_BUFFER_MAX             	128
#define MULTI_SLAVE_DO_MAX             	32
#define SLAVE_DIO_MAP_MAX             	32
#define SLAVE_AIO_CHANNEL_MAX                 16
/*****************************************************************************/
/** Slave Type
 */
#define SLAVE_TYPE_GENERIC					0	 			/**< Generic */
#define SLAVE_TYPE_CiA402 					1		 		/**< Profile No.402 */
#define SLAVE_TYPE_STEPPER_MOTOR			2		 		/**< ICPDAS 1 Axis Stepper Motor*/
#define SLAVE_TYPE_4_AXIS_STEPPER_MOTOR	3		 		/**< ICPDAS 4 Axis Stepper Motor*/
#define SLAVE_TYPE_2610					4			 	/**< ICPDAS Modbus To Ethercat*/
/*****************************************************************************/
/** Slave AO range code
 */
#define SLAVE_AO_UNI_5V						0	 			/**< Unipolar 5V (0-5V)*/
#define SLAVE_AO_BI_5V						1		 		/**< Bipolar 5V (+-5V) */
#define SLAVE_AO_UNI_10V					2		 		/**< Unipolar 10V (0-10V)*/
#define SLAVE_AO_BI_10V						3		 		/**< Bipolar 10V (+-10V)*/
/*****************************************************************************/
/** Slave AI range code
 */
#define SLAVE_AI_BI_10V						0		 		/**< Bipolar 10V (+-10V)*/
#define SLAVE_AI_BI_5V							1		 		/**< Bipolar 5V (+-5V) */
#define SLAVE_AI_BI_2_5V						2		 		/**< Bipolar 2.5V (+-2.5V) */
#define SLAVE_AI_UNI_10V						3		 		/**< Unipolar 10V (0-10V)*/
#define SLAVE_AI_UNI_20mA						4	 			/**< Unipolar 20mA (0-20mA) */
#define SLAVE_AI_UNI_4_20mA					5	 			/**< Unipolar 4-20mA(4-20mA)*/
#define SLAVE_AI_BI_20mA						6	 			/**< Bipolar 20mA(+-20mA)*/
#define SLAVE_AI_BI_4_20mA						7	 			/**< Bipolar 4-20mA(+-4-20mA)*/
#define SLAVE_AI_BI_10V_UNI_20mA					8		 		/**< ch0~3 Bipolar 10V (+-10V) ch4~7 Unipolar 20mA (0-20mA)*/
#define SLAVE_AI_BI_10V_UNI_4_20mA					9		 		/**< ch0~3 Bipolar 10V (+-10V) ch4~7 Unipolar 4-20mA(4-20mA)*/
#define SLAVE_AI_BI_10V_BI_20mA				10		 		/**< ch0~3 Bipolar 10V (+-10V) ch4~7 Bipolar 20mA(+-20mA)*/
#define SLAVE_AI_BI_10V_BI_4_20mA				11		 		/**< ch0~3 Bipolar 10V (+-10V) ch4~7 Bipolar 4-20mA(+-4-20mA)*/
 /*****************************************************************************/
 /** ECAT2016N AI range code
  */
#define ECAT2016_AI_BI_1_25V						0		 		/**< Bipolar 1.25V (+-1.25V)*/
#define ECAT2016_AI_BI_600mV						1		 		/**< Bipolar 600mV (+-600mV) */
#define ECAT2016_AI_BI_300mV						2		 		/**< Bipolar 300mV (+-300mV) */
#define ECAT2016_AI_BI_125mV						3		 		/**< Bipolar 125mV (+-125mV) */
#define ECAT2016_AI_BI_80mV 					4		 		/**< Bipolar 80mV (+-80mV) */
#define ECAT2016_AI_BI_60mV					5		 		/**< Bipolar 60mV (+-60mV) */
#define ECAT2016_AI_BI_40mV						6		 		/**< Bipolar 40mV (+-40mV) */
#define ECAT2016_AI_BI_30mV						7		 		/**< Bipolar 30mV (+-30mV) */
#define ECAT2016_AI_BI_20mV						8		 		/**< Bipolar 20mV (+-20mV) */
#define ECAT2016_AI_BI_15mV						9		 		/**< Bipolar 15mV (+-15mV) */
#define ECAT2016_AI_BI_10mV						10		 		/**< Bipolar 10mV (+-10mV) */
  /*****************************************************************************/
  /** ECAT2016-3 AI range code
   */
#define ECAT2016_3_AI_BI_10V						0		 		/**< Bipolar 10V (+-10V)*/
#define ECAT2016_3_AI_BI_5V						1		 		/**< Bipolar 5V (+-5V) */
#define ECAT2016_3_AI_BI_2_5V						2		 		/**< Bipolar 2.5V (+-2.5V) */
#define ECAT2016_3_AI_BI_1_25V						3		 		/**< Bipolar 1.25V (+-1.25V) */
#define ECAT2016_3_AI_BI_625mV 					4		 		/**< Bipolar 625mV (+-625mV) */
#define ECAT2016_3_AI_BI_312mV					5		 		/**< Bipolar 312mV (+-312mV) */
#define ECAT2016_3_AI_BI_200mV						6		 		/**< Bipolar 200mV (+-200mV) */
#define ECAT2016_3_AI_BI_100mV						7		 		/**< Bipolar 100mV (+-100mV) */
#define ECAT2016_3_AI_BI_50mV						8		 		/**< Bipolar 50mV (+-50mV) */
#define ECAT2016_3_AI_BI_25mV						9		 		/**< Bipolar 25mV (+-25mV) */

/*****************************************************************************/
/** EtherCAT AL State
 */
#define ECAT_AS_INIT						0x00
#define ECAT_AS_PREOP						0x02
#define ECAT_AS_SAFEOP						0x04
#define ECAT_AS_OP							0x08
/*****************************************************************************/
/** Device OP task cycle time
 */
#define DEV_OP_CYCLE_TIME_1MS					0	 			/**< 1 ms */
#define DEV_OP_CYCLE_TIME_2MS					1	 			/**< 2 ms */
#define DEV_OP_CYCLE_TIME_3MS					2	 			/**< 3 ms */
#define DEV_OP_CYCLE_TIME_4MS					3	 			/**< 4 ms */
#define DEV_OP_CYCLE_TIME_5MS					4	 			/**< 5 ms */
#define DEV_OP_CYCLE_TIME_6MS					5	 			/**< 6 ms */
#define DEV_OP_CYCLE_TIME_7MS					6	 			/**< 7 ms */
#define DEV_OP_CYCLE_TIME_8MS					7	 			/**< 8 ms */
#define DEV_OP_CYCLE_TIME_9MS					8	 			/**< 9 ms */
#define DEV_OP_CYCLE_TIME_10MS					9	 			/**< 10 ms */
#define DEV_OP_CYCLE_TIME_11MS					10	 			/**< 11 ms */
#define DEV_OP_CYCLE_TIME_12MS					11	 			/**< 12 ms */
#define DEV_OP_CYCLE_TIME_13MS					12	 			/**< 13 ms */
#define DEV_OP_CYCLE_TIME_14MS					13	 			/**< 14 ms */
#define DEV_OP_CYCLE_TIME_15MS					14	 			/**< 15 ms */
#define DEV_OP_CYCLE_TIME_16MS					15	 			/**< 16 ms */

/*****************************************************************************/
/** Motion Control Group command mode
 */
#define MS_GRP_CM_ABORTING					0
#define MS_GRP_CM_BUFFERED                  1
#define MS_GRP_CM_BLENDING                  2
/*****************************************************************************/
/**  Motion Control Axis Synchronization source
 */
#define	MC_AXIS_SYNC_SOURCE_SET_VALUE  0
#define	MC_AXIS_SYNC_SOURCE_ACTUAL_VALUE 1
/*****************************************************************************/
/** Motion Control Axis State
 */
#define MC_AS_DISABLED				0
#define MC_AS_STANDSTILL			1
#define MC_AS_ERRORSTOP				2
#define MC_AS_STOPPING				3
#define MC_AS_HOMING				4
#define MC_AS_DISCRETEMOTION		5
#define MC_AS_CONTINUOUSMOTION		6
#define MC_AS_SYNCHRONIZEDMOTION	7
#define MC_AS_STEERWHEELMOTION		8
/*****************************************************************************/
/** Motion Control Axis State
 */
#define MC_AS_CONSTANT_VEL			0
#define MC_AS_ACC			        1
#define MC_AS_DEC   				2

/*****************************************************************************/
/** Motion Control Motion State
 */
#define MC_MS_CONSTANT_VEL			0
#define MC_MS_ACC			        1
#define MC_MS_DEC   				2

/*****************************************************************************/
/** Motion Control Group State
 */
#define MC_GS_DISABLED				0
#define MC_GS_STANDBY				1
#define MC_GS_ERRORSTOP				2
#define MC_GS_STOPPING				3
#define MC_GS_HOMING				4
#define MC_GS_MOVING				5
#define MC_GS_HOLD					6
#define MC_GS_PAUSE					7
 /*****************************************************************************/
/**Device Encoder Mode
 */
#define DEV_ENC_MODE_CW_CCW					1
#define DEV_ENC_MODE_PLS_DIR				2
#define DEV_ENC_MODE_AB_PHASE				3
/*****************************************************************************/
/**Device Encoder Low Pass Filter
 */
#define DEV_ENC_LPF_4_MHZ					0
#define DEV_ENC_LPF_3P6_MHZ					1
#define DEV_ENC_LPF_1P8_MHZ					2
#define DEV_ENC_LPF_950_KHZ					4
#define DEV_ENC_LPF_480_KHZ					8
#define DEV_ENC_LPF_240_KHZ					16
#define DEV_ENC_LPF_120_KHZ					32
#define DEV_ENC_LPF_60_KHZ					64
#define DEV_ENC_LPF_30_KHZ					128
/*****************************************************************************/
/**Device emergency source
 */
#define DEV_EMG_SOURCE_OB_DI				0  /**< On board DI */
#define DEV_EMG_SOURCE_SLAVE_DI				1  /**< Slave DI */
 /*****************************************************************************/
 /**Motion record parameters
 */
#define MC_RECORD_POSITION				0
#define MC_RECORD_VELOCITY				1
#define MC_RECORD_COMMAND_POSITION		2
#define MC_RECORD_COMMAND_VELOCITY		3

 /*****************************************************************************/
 /**Event Type
 */
#define EV_COMPARE_POSITION			    1
#define EV_DIBIT_CHANGE				2
#define EV_MOTION_CPMPLETE				3
#define EV_DI_CHANGE					4
#define EV_MOTION_STATUS				5
#define EV_COMPARE_AI			    	6
 /*****************************************************************************/
 /**Comparison Operators
 */
#define GREATER_THAN					0
#define GREATER_THAN_OR_EQUAL_TO		1
#define LESS_THAN						2
#define LESS_THAN_OR_EQUAL_TO			3
 /*****************************************************************************/
 /**Home Settings
 */
#define MC_AS_HOME_SPEED_SW					1
#define MC_AS_HOME_SPEED_ZR					2
#define MC_AS_HOME_ACC						    4
#define MC_AS_HOME_OFFSET						8

/*****************************************************************************/
/**Path command type
*/
#define MC_PATH_CMD_TYPE_MOVE_LINE				1
#define MC_PATH_CMD_TYPE_MOVE_CIRC_CP_ANGLE		2
#define MC_PATH_CMD_TYPE_MOVE_CIRC_CP_EP		3
#define MC_PATH_CMD_TYPE_MOVE_CIRC_BP_EP		4
#define MC_PATH_CMD_TYPE_MOVE_3D_CIRC_CP_ANGLE	5
#define MC_PATH_CMD_TYPE_MOVE_3D_CIRC_CP_EP		6
#define MC_PATH_CMD_TYPE_MOVE_3D_CIRC_BP_EP		7
#define MC_PATH_CMD_TYPE_MOVE_HELICAL			8
#define MC_PATH_CMD_TYPE_MOVE_3D_HELICAL		9
#define MC_PATH_CMD_TYPE_MOVE_CONICAL_HELIX		10
#define MC_PATH_CMD_TYPE_MOVE_3D_CONICAL_HELIX	11
#define MC_PATH_CMD_TYPE_SET_ACCDEC_TIME		12
#define MC_PATH_CMD_TYPE_SET_ACCDEC_TYPE		13
#define MC_PATH_CMD_TYPE_SET_CMD_MODE			14	
#define MC_PATH_CMD_TYPE_SET_BLEND_PERCENT		15
#define MC_PATH_CMD_TYPE_DWELL					16
#define MC_PATH_CMD_TYPE_SET_DO					17
#define MC_PATH_CMD_TYPE_SET_AO_VOLT			18

/*****************************************************************************/
/**Acceleration deceleration mode
*/
#define MC_ACC_DEC_MODE_RATE 0
#define MC_ACC_DEC_MODE_TIME 1
/*****************************************************************************/
/**Filter type
*/
#define FILTER_NOTCH	 1
#define FILTER_LOW_PASS 2
#define FILTER_HIGH_PASS 4
/*****************************************************************************/
/** Slave No Type
 */
#define SLAVE_NO_TYPE_POSITION				0	 			/**< Position as SlaveNo */
#define SLAVE_NO_TYPE_ALIAS					1		 		/**< Alias as SlaveNo */
/*****************************************************************************/
/** Group interpolation Type
 */
#define MC_DEFAULT_INTERPOLATION 0
#define MC_POLAR_INTERPOLATION 1
/*****************************************************************************/
/** Slave Register read type
 */
#define REGISTER_TYPE_ERR				0	 			/**< Rx Err / Crc Err*/
#define REGISTER_TYPE_FWD_CRC_ERR		1		 		/**< Forward Crc Err*/
#define REGISTER_TYPE_LOST_LINK		    2		 		/**< Lost Link */
/*****************************************************************************/
/** CiA402 Motion Mode
 */
#define MC_MODE_CSP				        8	 			/**< Cyclic synchronous position mode*/
#define MC_MODE_CSV				        9	 			/**< Cyclic synchronous velocity mode*/
#define MC_MODE_CST				        10	 			/**< Cyclic synchronous torque mode*/
 /*****************************************************************************/
 /** GearInByPos State
  */
#define MC_GEARINBYPOS_WAIT					0
#define MC_GEARINBYPOS_GEARIN				1
#define MC_GEARINBYPOS_GEAROUT				2
#define MC_GEARINBYPOS_SLAVE_AXIS_STOPING	3
#define MC_GEARINBYPOS_SLAVE_AXIS_STOP		4
#define MC_GEARINBYPOS_SLAVE_AXIS_RETURN	5
  /*****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
int32_t ECAT_GetDllVersion(char *Version, uint16_t *Size);
int32_t ECAT_GetFirmwareVersion(uint16_t DeviceNo, char *Version, uint16_t *Size);
int32_t ECAT_GetDeviceCnt(uint16_t *DeviceCnt, uint8_t CardID[]);
int32_t ECAT_OpenDevice(uint16_t DeviceNo);
int32_t ECAT_CloseDevice(uint16_t DeviceNo);
int32_t ECAT_GetDeviceSerialNo(uint16_t DeviceNo, uint8_t *SerialNo);
int32_t ECAT_GetDeviceDI(uint16_t DeviceNo, uint32_t *Value);
int32_t ECAT_GetDeviceDIBit(uint16_t DeviceNo, uint16_t BitNo, uint32_t *Value);
int32_t ECAT_GetDeviceDO(uint16_t DeviceNo, uint32_t *Value);
int32_t ECAT_GetDeviceDOBit(uint16_t DeviceNo, uint16_t BitNo, uint32_t *Value);
int32_t ECAT_SetDeviceDO(uint16_t DeviceNo, uint32_t Value);
int32_t ECAT_SetDeviceDOBit(uint16_t DeviceNo, uint16_t BitNo, uint32_t Value);
int32_t ECAT_GetDeviceState(uint16_t DeviceNo, uint32_t *LinkUp, uint32_t *SlavesResp, uint32_t *AlStates, uint32_t *Wc);
int32_t ECAT_GetSlaveInfo(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t *Alias, uint32_t *ProductCode, uint32_t *VendorID,
		uint32_t *RevisionNo, uint32_t *SerialNo, uint8_t *AlState, uint32_t *SlaveType, char *Slavename);
int32_t ECAT_UploadNetworkInfo(uint16_t DeviceNo, uint16_t NetworkInfoNo, uint32_t Offset,char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t ECAT_UploadFirmware(uint16_t DeviceNo, uint32_t Offset, char *Data, uint32_t DataSize, uint8_t LastFlag);

int32_t ECAT_DownloadNetworkInfo(uint16_t DeviceNo, uint16_t NetworkInfoNo, uint32_t *Offset, char *Data, uint32_t *DataSize, uint8_t *LastFlag);
int32_t ECAT_GetSlaveSdoObject(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Index, uint8_t SubIndex, uint16_t DataSize, uint32_t *ObjectVal, uint32_t *AbortCode);
int32_t ECAT_SetSlaveSdoObject(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Index, uint8_t SubIndex, uint16_t DataSize, uint32_t ObjectVal, uint32_t *AbortCode);
int32_t ECAT_SlaveNonBlockSdoRequestRead(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Index, uint8_t SubIndex, uint32_t Timeout_ms);
int32_t ECAT_SlaveNonBlockSdoRequestReadState(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t DataSize, uint32_t *ObjectVal);
int32_t ECAT_SlaveNonBlockSdoRequestWrite(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Index, uint8_t SubIndex, uint16_t DataSize, uint32_t ObjectVal, uint32_t Timeout_ms);
int32_t ECAT_SlaveNonBlockSdoRequestWriteState(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t DataSize);
int32_t ECAT_StartDeviceOpTask(uint16_t DeviceNo, uint16_t NetworkInfoNo, uint8_t EnumCycleTime, uint32_t WcErrCnt);
int32_t ECAT_StopDeviceOpTask(uint16_t DeviceNo);
int32_t ECAT_SetSlaveRxPdoData(uint16_t DeviceNo,uint16_t SlaveNo,uint16_t OffsetByte,uint16_t DataSize,uint8_t *Data);
int32_t ECAT_GetSlaveRxPdoData(uint16_t DeviceNo,uint16_t SlaveNo,uint16_t OffsetByte,uint16_t DataSize,uint8_t *Data);
int32_t ECAT_GetSlaveRxPdoOffset(uint16_t DeviceNo, uint16_t SlaveNo,uint8_t channel, uint16_t *OffsetByte);
int32_t ECAT_GetSlaveRxPdoChannel(uint16_t DeviceNo, uint16_t SlaveNo, uint8_t *channel,uint8_t *bitsize);
int32_t ECAT_GetSlaveTxPdoData(uint16_t DeviceNo,uint16_t SlaveNo,uint16_t OffsetByte,uint16_t DataSize,uint8_t *Data);
int32_t ECAT_GetSlaveTxPdoOffset(uint16_t DeviceNo, uint16_t SlaveNo, uint8_t channel, uint16_t *OffsetByte);
int32_t ECAT_GetSlaveTxPdoChannel(uint16_t DeviceNo, uint16_t SlaveNo, uint8_t *channel, uint8_t *bitsize);
int32_t ECAT_GetSlaveDI(uint16_t DeviceNo, uint16_t SlaveNo, uint32_t *Value);
int32_t ECAT_GetSlaveDIBit(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t BitNo, uint32_t *Value);
int32_t ECAT_GetSlaveDO(uint16_t DeviceNo, uint16_t SlaveNo, uint32_t *Value);
int32_t ECAT_GetSlaveDOBit(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t BitNo, uint32_t *Value);
int32_t ECAT_SetSlaveDO(uint16_t DeviceNo, uint16_t SlaveNo, uint32_t Value);
int32_t ECAT_SetSlaveDOBit(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t BitNo, uint32_t Value);
int32_t ECAT_SetSlaveAoProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, uint8_t Range);
int32_t ECAT_GetSlaveAoProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, uint8_t *Range);
int32_t ECAT_SetSlaveAoRawData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, int16_t Data);
int32_t ECAT_GetSlaveAoRawData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, int16_t *Data);
int32_t ECAT_SetSlaveAoVoltData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, double Data);
int32_t ECAT_GetSlaveAoVoltData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, double *Data);
int32_t ECAT_SetSlaveEncProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Mode, uint8_t InvertCnt, uint8_t LPF);
int32_t ECAT_GetSlaveEncProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t *Mode, uint8_t *InvertCnt, uint8_t *LPF);
int32_t ECAT_GetSlaveEncCount(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, int32_t *Cnt);
int32_t ECAT_ResetSlaveEncCount(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo);
int32_t ECAT_SetSlaveEncCount(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, int32_t Value);
int32_t ECAT_SetSlaveEncIdxLatchProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Enable);
int32_t ECAT_GetSlaveEncIdxLatchProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t *Enable);
int32_t ECAT_GetSlaveEncIdxLatchCnt(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, int32_t *Cnt);
int32_t ECAT_ResetSlaveEncIdxLatchCnt(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo);
int32_t ECAT_SetSlaveEncExtLatchProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Enable, uint8_t Mode, uint8_t Logic);
int32_t ECAT_GetSlaveEncExtLatchProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t *Enable, uint8_t *Mode, uint8_t *Logic);
int32_t ECAT_GetSlaveEncExtLatchCnt(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, int32_t *Cnt_Rising, int32_t *Cnt_Falling);
int32_t ECAT_ResetSlaveEncExtLatchCnt(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo);
int32_t ECAT_SetSlaveCmpTrigProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint16_t PulseWidth);
int32_t ECAT_GetSlaveCmpTrigProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint16_t *PulseWidth);
int32_t ECAT_SetSlaveCmpTrigData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, int32_t CmpData);
int32_t ECAT_SetSlaveContCmpTrigData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, int32_t Start, uint32_t Interval, uint8_t Dir);


int32_t ECAT_McInit(uint16_t DeviceNo, uint16_t SlaveNo[], uint16_t SubAxisNo[], uint16_t AxisCount);
int32_t ECAT_McSetAxisServoOn(uint16_t DeviceNo, uint16_t AxisNo, uint16_t State);
int32_t ECAT_McSetAxisPPU(uint16_t DeviceNo, uint16_t AxisNo, double PPU);
int32_t ECAT_McGetAxisPPU(uint16_t DeviceNo, uint16_t AxisNo, double *PPU);

int32_t ECAT_McSetAxisEncoderPPR(uint16_t DeviceNo, uint16_t AxisNo, uint32_t PPR);
int32_t ECAT_McGetAxisEncoderPPR(uint16_t DeviceNo, uint16_t AxisNo, uint32_t *PPR);
int32_t ECAT_McSetAxisMotorPPR(uint16_t DeviceNo, uint16_t AxisNo, uint32_t PPR);
int32_t ECAT_McGetAxisMotorPPR(uint16_t DeviceNo, uint16_t AxisNo, uint32_t *PPR);

int32_t ECAT_McSetAxisHomeMethod(uint16_t DeviceNo, uint16_t AxisNo, int32_t Method);
int32_t ECAT_McGetAxisHomeMethod(uint16_t DeviceNo, uint16_t AxisNo, int32_t *Method);
int32_t ECAT_McSetAxisHomeSpeed(uint16_t DeviceNo, uint16_t AxisNo, double SeachSw, double SeachZr);
int32_t ECAT_McGetAxisHomeSpeed(uint16_t DeviceNo, uint16_t AxisNo, double *SeachSw, double *SeachZr);
int32_t ECAT_McSetAxisHomeAcc(uint16_t DeviceNo, uint16_t AxisNo, double Acc);
int32_t ECAT_McGetAxisHomeAcc(uint16_t DeviceNo, uint16_t AxisNo, double *Acc);
int32_t ECAT_McSetAxisHomeOffset(uint16_t DeviceNo, uint16_t AxisNo, double Offset);
int32_t ECAT_McGetAxisHomeOffset(uint16_t DeviceNo, uint16_t AxisNo, double *Offset);
int32_t ECAT_McSetAxisAccTime(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Time_ms);
int32_t ECAT_McGetAxisAccTime(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *Time_ms);
int32_t ECAT_McSetAxisAccDecType(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Type);
int32_t ECAT_McGetAxisAccDecType(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *Type);
int32_t ECAT_McSetVirtualAxisEncoder(uint16_t DeviceNo, uint16_t AxisNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Enable);
int32_t ECAT_McGetVirtualAxisEncoder(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *SlaveNo, uint16_t *EncNo, uint8_t *Enable);
int32_t ECAT_McSetAxisTouchProbeProperty(uint16_t DeviceNo, uint16_t AxisNo, uint16_t ProbeNo, uint8_t Enable, uint8_t Logic);
int32_t ECAT_McGetAxisTouchProbeProperty(uint16_t DeviceNo, uint16_t AxisNo, uint16_t ProbeNo, uint8_t *Enable, uint8_t *Logic);
int32_t ECAT_McGetAxisTouchProbeValue(uint16_t DeviceNo, uint16_t AxisNo, uint16_t ProbeNo, double *Value);


int32_t ECAT_McGetAxisState(uint16_t DeviceNo,uint16_t AxisNo,uint32_t *State);
int32_t ECAT_McGetAxisMotionState(uint16_t DeviceNo,uint16_t AxisNo,uint32_t *State);
int32_t ECAT_McGetAxisLastError(uint16_t DeviceNo,uint16_t AxisNo,int32_t *Error);
int32_t ECAT_McGetAxisDriveError(uint16_t DeviceNo,uint16_t AxisNo,uint16_t *Error);
int32_t ECAT_McGetAxisCommandPos(uint16_t DeviceNo, uint16_t AxisNo, double *Pos);
int32_t ECAT_McGetAxisActualPos(uint16_t DeviceNo,uint16_t AxisNo,double *Pos);
int32_t ECAT_McGetAxisActualVel(uint16_t DeviceNo,uint16_t AxisNo,double *Vel);
int32_t ECAT_McGetAxisDI(uint16_t DeviceNo,uint16_t AxisNo,uint32_t *DI);
int32_t ECAT_McSetProfileData(uint16_t DeviceNo,uint16_t ProfileNo,double *Data,uint16_t DataSize);
int32_t ECAT_McGetProfileData(uint16_t DeviceNo,uint16_t ProfileNo,double *Data,uint16_t DataSize);
int32_t ECAT_McSetProfileCSV(uint16_t DeviceNo, uint16_t ProfileNo, uint32_t Offset,char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t ECAT_McGetProfileCSV(uint16_t DeviceNo, uint16_t ProfileNo, uint32_t *Offset, char *Data, uint32_t *DataSize, uint8_t *LastFlag);
int32_t ECAT_McSetEcamTable(uint16_t DeviceNo, uint16_t TableNo, double *Data, uint16_t DataSize);
int32_t ECAT_McGetEcamTable(uint16_t DeviceNo, uint16_t TableNo, double *Data, uint16_t DataSize);
int32_t ECAT_McConfigEcamTable(uint16_t DeviceNo, uint16_t TableNo, uint8_t SlaveAbs);

int32_t ECAT_McAxisHome(uint16_t DeviceNo, uint16_t AxisNo);
int32_t ECAT_McAxisErrorReset(uint16_t DeviceNo, uint16_t AxisNo);
int32_t ECAT_McAxisStop(uint16_t DeviceNo, uint16_t AxisNo);
int32_t ECAT_McAxisQuickStop(uint16_t DeviceNo, uint16_t AxisNo);
int32_t ECAT_McAxisMoveAbs(uint16_t DeviceNo, uint16_t AxisNo, double Pos, double Vel);
int32_t ECAT_McAxisMoveRel(uint16_t DeviceNo, uint16_t AxisNo, double Pos, double Vel);
int32_t ECAT_McAxisChangePos(uint16_t DeviceNo, uint16_t AxisNo, double Pos);
int32_t ECAT_McAxisChangeVel(uint16_t DeviceNo, uint16_t AxisNo, double Vel);
int32_t ECAT_McAxisMoveVel(uint16_t DeviceNo, uint16_t AxisNo, double Vel);
int32_t ECAT_McAxisMoveVelByPos(uint16_t DeviceNo, uint16_t AxisNo, double Vel);
int32_t ECAT_McAxisGearIn(uint16_t DeviceNo, uint16_t MasterNo, uint16_t SlaveNo, int32_t RatioNum, uint32_t RationDen, uint16_t SyncSource);
int32_t ECAT_McAxisGearOut(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Stop);
int32_t ECAT_McAxisMoveProfile(uint16_t DeviceNo, uint16_t AxisNo, uint16_t ProfileNo, uint16_t TotalStep);
int32_t ECAT_McAxisMoveProfileCSV(uint16_t DeviceNo, uint16_t AxisNo, uint16_t ProfileNo);
int32_t ECAT_McAxisCamIn(uint16_t DeviceNo, uint16_t MasterNo, uint16_t SlaveNo, uint16_t TableNo, uint16_t SyncSource, 
							double MasterInterval, double SlaveScaling);
int32_t ECAT_McAxisCamOut(uint16_t DeviceNo, uint16_t SlaveNo);
int32_t ECAT_McAxisCamPhaseShift(uint16_t DeviceNo, uint16_t SlaveNo, double PhaseShift);
int32_t ECAT_McAxisTangentInGroup(uint16_t DeviceNo, uint16_t AxisNo, uint16_t GroupNo, double Angle, double Vel);

int32_t ECAT_McAddAxisToGroup(uint16_t DeviceNo, uint16_t GroupNo, uint16_t AxisNo);
int32_t ECAT_McRemoveAxisFromGroup(uint16_t DeviceNo, uint16_t GroupNo, uint16_t AxisNo);
int32_t ECAT_McUngroupAllAxes(uint16_t DeviceNo, uint16_t GroupNo);

int32_t ECAT_McSetGroupCmdMode(uint16_t DeviceNo, uint16_t GroupNo, uint16_t CmdMode);
int32_t ECAT_McGetGroupCmdMode(uint16_t DeviceNo, uint16_t GroupNo, uint16_t *CmdMode);
int32_t ECAT_McGetGroupState(uint16_t DeviceNo, uint16_t GroupNo, uint32_t *State);
int32_t ECAT_McGetGroupCmdBuffer(uint16_t DeviceNo, uint16_t GroupNo, uint16_t *Buffer);
int32_t ECAT_McSetGroupAccTime(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Time_ms);
int32_t ECAT_McGetGroupAccTime(uint16_t DeviceNo, uint16_t GroupNo, uint16_t *Time_ms);
int32_t ECAT_McSetGroupAccDecType(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Type);
int32_t ECAT_McGetGroupAccDecType(uint16_t DeviceNo, uint16_t GroupNo, uint16_t *Type);

int32_t ECAT_McGroupStop(uint16_t DeviceNo, uint16_t GroupNo);
int32_t ECAT_McGroupQuickStop(uint16_t DeviceNo, uint16_t GroupNo);
int32_t ECAT_McGroupMoveLineAbs(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Vel);
int32_t ECAT_McGroupMoveLineAbs_PT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time);
int32_t ECAT_McGroupMoveLineAbs_PTexT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time, double exTime);
int32_t ECAT_McGroupMoveLineAbs_PVT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Vel[], double Time);
int32_t ECAT_McGroupMoveLineAbs_PPT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time);
int32_t ECAT_McGroupMoveLineAbs_PT_A(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time);
int32_t ECAT_McGroupMoveLineRel(uint16_t DeviceNo,uint16_t GroupNo,double Pos[],double Vel);
int32_t ECAT_McGroupMoveLineRel_PT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time);
int32_t ECAT_McGroupMoveLineRel_PTexT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time, double exTime);
int32_t ECAT_McGroupMoveLineRel_PVT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Vel[], double Time);
int32_t ECAT_McGroupMoveLineRel_PPT(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time);
int32_t ECAT_McGroupMoveLineRel_PT_A(uint16_t DeviceNo, uint16_t GroupNo, double Pos[], double Time);
int32_t ECAT_McGroupMoveShaker(uint16_t DeviceNo, uint16_t GroupNo, double Amp, double phase[], double Freq, double Time);


int32_t ECAT_McGroupMoveCircularAbs(uint16_t DeviceNo, uint16_t GroupNo, double Angle, double AuxPos[], double Vel);
int32_t ECAT_McGroupMoveCircularAbs_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double AuxPos[]);
int32_t ECAT_McGroupMoveCircularAbs_CP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);
int32_t ECAT_McGroupMoveCircularAbs_BP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);
int32_t ECAT_McGroupMove3DCircularAbs_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double AuxPos[], double NV[]);
int32_t ECAT_McGroupMove3DCircularAbs_CP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);
int32_t ECAT_McGroupMove3DCircularAbs_BP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);

int32_t ECAT_McGroupMoveCircularRel(uint16_t DeviceNo, uint16_t GroupNo, double Angle, double AuxPos[], double Vel);
int32_t ECAT_McGroupMoveCircularRel_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double AuxPos[]);
int32_t ECAT_McGroupMoveCircularRel_CP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);
int32_t ECAT_McGroupMoveCircularRel_BP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);
int32_t ECAT_McGroupMove3DCircularRel_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double AuxPos[], double NV[]);
int32_t ECAT_McGroupMove3DCircularRel_CP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);
int32_t ECAT_McGroupMove3DCircularRel_BP_EP(uint16_t DeviceNo, uint16_t GroupNo, double Vel, uint8_t Dir, double AuxPos[], double EndPos[]);

int32_t ECAT_McGroupMoveHelicalAbs(uint16_t DeviceNo, uint16_t GroupNo, double Angle, double AuxPos[], double Pitch, double Vel);
int32_t ECAT_McGroupMove3DHelicalAbs_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double Pitch, double AuxPos[], double NV[]);
int32_t ECAT_McGroupMoveHelicalRel(uint16_t DeviceNo, uint16_t GroupNo, double Angle, double AuxPos[], double Pitch, double Vel);
int32_t ECAT_McGroupMove3DHelicalRel_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double Pitch, double AuxPos[], double NV[]);

int32_t ECAT_McGroupMoveConicalHelixAbs(uint16_t DeviceNo, uint16_t GroupNo, double Angle, double AuxPos[], double Pitch, double Vel, double EndRadius);
int32_t ECAT_McGroupMove3DConicalHelixAbs_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double Pitch, double AuxPos[], double NV[], double EndRadius);
int32_t ECAT_McGroupMoveConicalHelixRel(uint16_t DeviceNo, uint16_t GroupNo, double Angle, double AuxPos[], double Pitch, double Vel, double EndRadius);
int32_t ECAT_McGroupMove3DConicalHelixRel_CP_Angle(uint16_t DeviceNo, uint16_t GroupNo, double Vel, double Angle, double Pitch, double AuxPos[], double NV[], double EndRadius);

int32_t ECAT_McGroupMoveProfile(uint16_t DeviceNo, uint16_t GroupNo, uint16_t ProfileNo[], uint16_t TotalStep);
int32_t ECAT_McGroupMoveProfileCSV(uint16_t DeviceNo, uint16_t GroupNo, uint16_t ProfileNo);
int32_t ECAT_McGroupMoveDwell(uint16_t DeviceNo, uint16_t GroupNo, uint32_t Cnt);
int32_t ECAT_McGroupMoveDO(uint16_t DeviceNo,uint16_t GroupNo, uint16_t SlaveNo, uint16_t BitNo, uint32_t Value);
int32_t ECAT_McGroupMoveBlendingSync(uint16_t DeviceNo, uint16_t GroupNo);

int32_t ECAT_SetDeviceEncProperty(uint16_t DeviceNo, uint16_t EncNo, uint8_t Mode, uint8_t InvertCnt, uint8_t LPF);
int32_t ECAT_GetDeviceEncProperty(uint16_t DeviceNo, uint16_t EncNo, uint8_t *Mode, uint8_t *InvertCnt, uint8_t *LPF);
int32_t ECAT_GetDeviceEnCount(uint16_t DeviceNo, uint16_t EncNo, int32_t *Cnt);
int32_t ECAT_GetDeviceEncCount(uint16_t DeviceNo, uint16_t EncNo, int32_t *Cnt);
int32_t ECAT_ResetDeviceEncCount(uint16_t DeviceNo, uint16_t EncNo);

int32_t ECAT_SetDeviceCmpTrigProperty(uint16_t DeviceNo, uint16_t CmpNo, uint32_t PulseWidth, uint8_t Source);
int32_t ECAT_GetDeviceCmpTrigProperty(uint16_t DeviceNo, uint16_t CmpNo, uint32_t *PulseWidth, uint8_t *Source);
int32_t ECAT_SetDeviceCmpTrigData(uint16_t DeviceNo, uint16_t CmpNo, int32_t CmpData);
int32_t ECAT_SetDeviceContCmpTrigData(uint16_t DeviceNo, uint16_t CmpNo, int32_t Start, uint32_t Interval, uint32_t Times, uint8_t Dir);

int32_t ECAT_SetDeviceEmg(uint16_t DeviceNo, uint8_t Source, uint8_t Enable, uint8_t Logic, uint16_t SlaveNo, uint16_t BitNo, uint8_t ServoOff);
int32_t ECAT_GetDeviceEmg(uint16_t DeviceNo, uint8_t *Source, uint8_t *Enable, uint8_t *Logic, uint16_t *SlaveNo, uint16_t *BitNo, uint8_t *ServoOff);
int32_t ECAT_GetDeviceEmgStatus(uint16_t DeviceNo, uint8_t *Status);
int32_t ECAT_SetDeviceEmgSoftSig(uint16_t DeviceNo);
int32_t ECAT_SetDeviceMPG(uint16_t DeviceNo, uint8_t Enable, uint16_t *AxisNo, uint16_t AxisCount);
int32_t ECAT_GetDeviceMPG(uint16_t DeviceNo, uint8_t *Enable, uint16_t *AxisNo, uint16_t *AxisCount);


int32_t ECAT_OpenMotionConfig(char* bstrFileName, uint16_t *AxisCnt, uint16_t SlaveNo[], uint16_t SubAxisNo[], double PPU[], int32_t HomeMethod[], double HomeSpeedSeachSw[], double HomeSpeedSeachZr[], double HomeAcc[], uint32_t EncoderPPR[], uint32_t MotorPPR[]);

int32_t ECAT_GetSlaveRegister(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Addr, uint16_t DataSize, uint32_t *Val, uint8_t *state);
int32_t ECAT_SetSlaveRegister(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Addr, uint16_t DataSize, uint32_t Val, uint8_t *state);
int32_t ECAT_McGetMotionRecordState(uint16_t DeviceNo, uint16_t *state, uint32_t *count);
int32_t ECAT_McSetMotionRecord(uint16_t DeviceNo, uint16_t state);
int32_t ECAT_DownloadMotionLog(uint16_t DeviceNo, uint32_t *Offset, char *Data, uint32_t *DataSize, uint8_t *LastFlag);

int32_t ECAT_SetTimer(uint16_t DeviceNo, uint32_t Interval);
int32_t ECAT_SetTimerStop(uint16_t DeviceNo);
int32_t ECAT_McGetPdo_Directly(uint16_t DeviceNo, uint16_t Size, char *Data);
int32_t ECAT_McSetStewartPlatform_M1(uint16_t DeviceNo, double radiusB, double angleB, double radiusP, double angleP, double RodLength, double Max_RodLength);
int32_t ECAT_McGetAxisActualPosVel(uint16_t DeviceNo, uint16_t AxisNo, float *Pos, float *Vel);

int32_t ECAT_PidSetSetPointValue(uint16_t DeviceNo, uint32_t PidNo, double SetPointValue);
int32_t ECAT_PidGetControlOutputValue(uint16_t DeviceNo, uint32_t PidNo, double *Output);

int32_t ECAT_PidSetParameter(uint16_t DeviceN, uint32_t PidNo, double kp, double ki, double kd);
int32_t ECAT_PidSetStatus(uint16_t DeviceNo, uint32_t PidNo, uint8_t status);
int32_t ECAT_PidSetSimulateMode(uint16_t DeviceNo, uint32_t PidNo, uint8_t status);
int32_t ECAT_PidSetSampleTime(uint16_t DeviceNo, uint32_t PidNo, uint32_t Interval);
int32_t ECAT_PidSetProcessVariableModule(uint16_t DeviceNo, uint32_t PidNo, uint16_t SlaveNo, uint16_t OffsetByte, uint16_t Bitlength, double ScaleGain, double ScaleOffset);
int32_t ECAT_PidSetControlOutputModule(uint16_t DeviceNo, uint32_t PidNo, uint16_t SlaveNo, uint16_t OffsetByte, uint16_t Bitlength, double ScaleGain, double ScaleOffset, double Output_Max_Value, double Output_Min_Value);

int32_t ECAT_PidGetParameter(uint16_t DeviceNo, uint32_t PidNo, double *kp, double *ki, double *kd);
int32_t ECAT_PidGetStatus(uint16_t DeviceNo, uint32_t PidNo, uint8_t *status);
int32_t ECAT_PidGetSimulateMode(uint16_t DeviceNo, uint32_t PidNo, uint8_t *status);
int32_t ECAT_PidGetSampleTime(uint16_t DeviceNo, uint32_t PidNo, uint32_t *Interval);
int32_t ECAT_PidGetProcessVariableModule(uint16_t DeviceNo, uint32_t PidNo, uint16_t *SlaveNo, uint16_t *OffsetByte, uint16_t *Bitlength, double *ScaleGain, double *ScaleOffset);
int32_t ECAT_PidGetControlOutputModule(uint16_t DeviceNo, uint32_t PidNo, uint16_t *SlaveNo, uint16_t *OffsetByte, uint16_t *Bitlength, double *ScaleGain, double *ScaleOffset, double *Output_Max_Value, double *Output_Min_Value);
int32_t ECAT_PidGetProcessVariable(uint16_t DeviceNo, uint32_t PidNo, double *ProcessVariable);
int32_t ECAT_PidGetSimulateFeedback(uint16_t DeviceNo, uint32_t PidNo, double *Feedback);
int32_t ECAT_WaitforTimer(uint16_t DeviceNo);
int32_t ECAT_PidGetSetPointValue(uint16_t DeviceNo, uint32_t PidNo, double *SetPointValue);
int32_t ECAT_PidGet_Sp_Err_Op_Pv(uint16_t DeviceNo, uint32_t PidNo, double *SetPointValue, double *Error, double *OutputValue, double *ProcessVariable);
int32_t ECAT_McSetAxisVelocityFeedForwardGain(uint16_t DeviceNo, uint16_t AxisNo, double Gain);
int32_t ECAT_McGetAxisVelocityFeedForwardGain(uint16_t DeviceNo, uint16_t AxisNo, double *Gain);
int32_t ECAT_McStewartPlatformMoveAbs_PT(uint16_t DeviceNo, uint16_t GroupNo, double Pose[], double *Pos, double Time);
int32_t ECAT_McGetStewartPlatform_M1(uint16_t DeviceNo, double *radiusB, double *angleB, double *radiusP, double *angleP, double *RodLength, double *Max_RodLength);
int32_t ECAT_McSetStewartPlatform_M2(uint16_t DeviceNo, double Bx[], double By[], double Px[], double Py[], double Z0, double RodLength[], double Max_RodLength[]);
int32_t ECAT_McSetGroupVelLimitStatus(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Status);
int32_t ECAT_McGetGroupVelLimitStatus(uint16_t DeviceNo, uint16_t GroupNo, uint16_t *Status);
int32_t ECAT_McSetGroupVelLimitValue(uint16_t DeviceNo, uint16_t GroupNo, double Value);
int32_t ECAT_McGetGroupVelLimitValue(uint16_t DeviceNo, uint16_t GroupNo, double *Value);
int32_t ECAT_McSetMotionRecordParam(uint16_t DeviceNo, uint16_t Value1, uint16_t Value2);
int32_t ECAT_McGetMotionRecordParam(uint16_t DeviceNo, uint16_t *Value1, uint16_t *Value2);
int32_t ECAT_McGetMotionRecordValue(uint16_t DeviceNo, uint32_t CountNo, uint16_t AxisNo, float *Value1, float *Value2);
int32_t ECAT_McClearMotionRecord(uint16_t DeviceNo);
int32_t ECAT_McSetAxisPosSoftwareLimit(uint16_t DeviceNo, uint16_t AxisNo, double Maximum, double Minimum);
int32_t ECAT_McGetAxisPosSoftwareLimit(uint16_t DeviceNo, uint16_t AxisNo, double *Maximum, double *Minimum);
int32_t ECAT_GetProcessTime(uint16_t DeviceNo, double *Time);
int32_t ECAT_McSetGroupHold(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Status);
int32_t ECAT_McSetAxisPosSoftwareLimitStatus(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Status, uint16_t ErrorStop);
int32_t ECAT_McGetAxisPosSoftwareLimitStatus(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *Status, uint16_t *ErrorStop);
int32_t ECAT_McGetAxisHomeState(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *State);
int32_t ECAT_McAxisGantryIn(uint16_t DeviceNo, uint16_t MasterNo, uint16_t SlaveNo, int32_t Direction);
int32_t ECAT_McSetGroupCmdModeEx(uint16_t DeviceNo, uint16_t GroupNo, uint16_t CmdMode);
int32_t ECAT_McAxisGantryMaxPosDiff(uint16_t DeviceNo, uint16_t SlaveNo, double Value);
int32_t ECAT_McAxisGantryMaxPosDiffStatus(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Status);
int32_t ECAT_EvCreatEvent(uint16_t DeviceNo, uint16_t *EventID);
int32_t ECAT_EvCloseEvent(uint16_t DeviceNo, uint16_t EventID);
int32_t ECAT_EvEnableEvent(uint16_t DeviceNo, uint16_t EventID);
int32_t ECAT_EvDisableEvent(uint16_t DeviceNo, uint16_t EventID);
int32_t ECAT_EvSetComparePositionParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t AxisNo, uint16_t Operator, double ComparePosition);
int32_t ECAT_WaitforEvent(uint16_t DeviceNo, uint32_t TimeOut, uint32_t *TriggeredEvent);
int32_t ECAT_EvSetCompareDIBitParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t SlaveNo, uint16_t BitNo, uint32_t CompareValue);
int32_t ECAT_EvSetMotionCompleteParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t AxisNo);
int32_t ECAT_McGroupMoveAO(uint16_t DeviceNo, uint16_t GroupNo, uint16_t SlaveNo, uint32_t RunMode, uint16_t ChannelNo, uint16_t RawData, double VoltData);
int32_t ECAT_McSetGroupAccTimeEx(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Time_ms);
int32_t ECAT_McSetGroupBlendingPercent(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Value);
int32_t ECAT_McSetProfileInterval(uint16_t DeviceNo, uint16_t ProfileNo, uint16_t Value);
int32_t ECAT_McAxisMoveSuperimposed(uint16_t DeviceNo, uint16_t AxisNo, double Pos, double Vel);
int32_t ECAT_McAxisHaltSuperimposed(uint16_t DeviceNo, uint16_t AxisNo);
int32_t ECAT_McGetMotionRecordValueEx(uint16_t DeviceNo, uint32_t CountNo, uint16_t Count, uint16_t AxisNo, float *Value1, float *Value2, uint16_t *ActualCount);
int32_t ECAT_SetHeartBeat(uint16_t DeviceNo, uint32_t Value);
int32_t ECAT_SetHeartBeatStatus(uint16_t DeviceNo, uint32_t Value);
int32_t ECAT_McSetGroupBlendingPercentEx(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Value);
int32_t ECAT_EvSetCompareDIParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t SlaveNo, uint16_t OffsetByte, uint32_t CompareValue, uint32_t Mask);
int32_t ECAT_McSetGroupPause(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Status);
int32_t ECAT_EvSetCompareAxisStateParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t AxisNo, uint32_t CompareState);
int32_t ECAT_SetSlaveAiProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, uint8_t Range);
int32_t ECAT_GetSlaveAiProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, uint8_t *Range);
int32_t ECAT_GetSlaveAiRawData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, int16_t *Data);
int32_t ECAT_GetSlaveAiVoltData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, double *Data);
int32_t ECAT_GetSlaveAimAData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, double *Data);
int32_t ECAT_McAxisHomeEx(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Settings);
int32_t ECAT_EvSetCompareCmdPositionParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t AxisNo, uint16_t Operator, double ComparePosition);
int32_t ECAT_EvSetCompareAxisVelStateParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t AxisNo, uint32_t CompareState);
int32_t ECAT_McSetAxisMaxVelocity(uint16_t DeviceNo, uint16_t AxisNo, double MaxVelocity);
int32_t ECAT_McGetAxisMaxVelocity(uint16_t DeviceNo, uint16_t AxisNo, double *MaxVelocity);
int32_t ECAT_McGroupMoveLineAbs_P2P(uint16_t DeviceNo, uint16_t GroupNo, double Pos[]);
int32_t ECAT_McGroupMoveLineRel_P2P(uint16_t DeviceNo, uint16_t GroupNo, double Pos[]);
int32_t ECAT_McAxisMoveAbs_P2P(uint16_t DeviceNo, uint16_t AxisNo, double Pos);
int32_t ECAT_McAxisMoveRel_P2P(uint16_t DeviceNo, uint16_t AxisNo, double Pos);
int32_t ECAT_Set_ECAT2016_AiProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, uint8_t Range, uint32_t *AbortCode);
int32_t ECAT_Get_ECAT2016_AiProperty(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, uint8_t *Range, uint32_t *AbortCode);
int32_t ECAT_Get_ECAT2016_AiRawData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, int16_t *Data);
int32_t ECAT_Get_ECAT2016_AiVoltData(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelNo, double *Data);
int32_t ECAT_EvSetCompareAiParameters(uint16_t DeviceNo, uint16_t EventID, uint16_t Operator, uint16_t SlaveNo, uint16_t OffsetByte, uint16_t DataSize, double ScaleGain, double ScaleOffset, double CompareValue);
int32_t ECAT_McSetAxisTorqueGain(uint16_t DeviceNo, uint16_t AxisNo, double Gain, uint32_t *AbortCode);
int32_t ECAT_McGetAxisTorqueGain(uint16_t DeviceNo, uint16_t AxisNo, double *Gain);
int32_t ECAT_McGetAxisRatedTorque(uint16_t DeviceNo, uint16_t AxisNo, double *Torque, uint32_t *AbortCode);
int32_t ECAT_McAxisMoveTor(uint16_t DeviceNo, uint16_t AxisNo, double Torque);
int32_t ECAT_McGetAxisActualTorque(uint16_t DeviceNo, uint16_t AxisNo, double *Torque);
int32_t ECAT_McSetAxisMaxTorque(uint16_t DeviceNo, uint16_t AxisNo, double Torque, uint32_t *AbortCode);
int32_t ECAT_McGetAxisMaxTorque(uint16_t DeviceNo, uint16_t AxisNo, double *Torque, uint32_t *AbortCode);
int32_t ECAT_McGetAxisCommandVel(uint16_t DeviceNo, uint16_t AxisNo, double *Pos);
int32_t ECAT_McGroupMovePath(uint16_t DeviceNo, uint16_t GroupNo, uint16_t PathDataNo, uint8_t Restart, uint16_t DataIndex, uint8_t Repeat);
int32_t ECAT_McAddPathData(uint16_t DeviceNo, uint16_t PathDataNo, uint32_t CmdType,
		uint8_t AbsMove, double EndPos[], double AuxPos[], double Args[]);
int32_t ECAT_McSetPathData(uint16_t DeviceNo, uint16_t PathDataNo, uint16_t DataIndex, uint32_t CmdType,
		uint8_t AbsMove, double EndPos[], double AuxPos[], double Args[]);
int32_t ECAT_McGetPathData(uint16_t DeviceNo, uint16_t PathDataNo, uint16_t DataIndex, uint32_t *CmdType,
		uint8_t *AbsMove, double EndPos[], double AuxPos[], double Args[]);
int32_t ECAT_McClearPathData(uint16_t DeviceNo, uint16_t PathDataNo);
int32_t ECAT_McGetPathDataSize(uint16_t DeviceNo, uint16_t PathDataNo, uint16_t *Size);

int32_t ECAT_McAxisMoveAbsAdv(uint16_t DeviceNo, uint16_t AxisNo, double EndPos,
		double StartVel, double ReqVel, double FinalVel, double Accel, double Decel, uint8_t AccDecMode);
int32_t ECAT_McAxisMoveRelAdv(uint16_t DeviceNo, uint16_t AxisNo, double EndPos,
		double StartVel, double ReqVel, double FinalVel, double Accel, double Decel, uint8_t AccDecMode);
int32_t ECAT_McGroupMoveLineAbsAdv(uint16_t DeviceNo, uint16_t GroupNo, double EndPos[],
		double StartVel, double ReqVel, double FinalVel, double Accel, double Decel, uint8_t AccDecMode);
int32_t ECAT_McGroupMoveLineRelAdv(uint16_t DeviceNo, uint16_t GroupNo, double EndPos[],
		double StartVel, double ReqVel, double FinalVel, double Accel, double Decel, uint8_t AccDecMode);

int32_t ECAT_McAxisMove_CiA402_PP(uint16_t DeviceNo, uint16_t AxisNo, uint8_t Abort, uint8_t AbsMove, 
		double EndPos, double Vel, double Accel, double Decel);
int32_t ECAT_McAxisMove_CiA402_PV(uint16_t DeviceNo, uint16_t AxisNo, double Vel, double Accel, double Decel);
int32_t ECAT_McAxisMove_CiA402_PT(uint16_t DeviceNo, uint16_t AxisNo, double Torque, double Slope);

int32_t ECAT_UpdateFirmware_(uint16_t DeviceNo, uint32_t Offset, char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t	ECAT_SetTxPdoBufParam(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t SlaveNo, uint16_t OffsetByte, uint16_t DataSize, uint16_t Enable);
int32_t	ECAT_GetTxPdoBufParam(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t *SlaveNo, uint16_t *OffsetByte, uint16_t *DataSize, uint16_t *Enable);
int32_t	ECAT_SetTxPdoBufEnable(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t Enable);
int32_t	ECAT_GetTxPdoBufEnable(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t *Enable);
int32_t	ECAT_GetTxPdoBufValue(uint16_t DeviceNo, uint16_t ChannelNo, float *Data, uint16_t Size, uint16_t *ActualGetSize);
int32_t ECAT_McSetAxisHomeTorque(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Torque);
int32_t ECAT_McGetAxisHomeTorque(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *Torque);
int32_t	ECAT_SetAiFilterParam(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t SlaveNo, uint16_t OffsetByte, uint16_t DataSize, uint16_t Enable);
int32_t	ECAT_GetAiFilterParam(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t *SlaveNo, uint16_t *OffsetByte, uint16_t *DataSize, uint16_t *Enable);
int32_t	ECAT_SetAiFilterEnable(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t Enable);
int32_t	ECAT_GetAiFilterEnable(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t *Enable);
int32_t	ECAT_SetAiFilterFreq(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t FilterType, double Frequency);
int32_t	ECAT_GetAiFilterFreq(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t FilterType, double *Frequency);
int32_t	ECAT_GetAiFilterOutput(uint16_t DeviceNo, uint16_t ChannelNo, int32_t *Output);
int32_t	ECAT_SetPdoInToOutParam(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t SlaveNoIn, uint16_t OffsetByteIn, uint16_t DataSizeIn, uint16_t SlaveNoOut, uint16_t OffsetByteOut, uint16_t DataSizeOut);
int32_t	ECAT_GetPdoInToOutParam(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t *SlaveNoIn, uint16_t *OffsetByteIn, uint16_t *DataSizeIn, uint16_t *SlaveNoOut, uint16_t *OffsetByteOut, uint16_t *DataSizeOut);
int32_t	ECAT_SetPdoInToOutCoeff(uint16_t DeviceNo, uint16_t ChannelNo, float gain, float offset);
int32_t	ECAT_GetPdoInToOutCoeff(uint16_t DeviceNo, uint16_t ChannelNo, float *gain, float *offset);
int32_t	ECAT_SetPdoInToOutEnable(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t Enable);
int32_t	ECAT_GetPdoInToOutEnable(uint16_t DeviceNo, uint16_t ChannelNo, uint16_t *Enable);
int32_t ECAT_McStewartPlatformShaker(uint16_t DeviceNo, uint16_t GroupNo, double Amp[], double Freq);
int32_t ECAT_McStewartPlatformShaker_Stop(uint16_t DeviceNo, uint16_t GroupNo, int QuickStop);
int32_t ECAT_McAxisMoveVelShaker(uint16_t DeviceNo, uint16_t AxisNo, double Amp, double Freq, uint32_t N);
int32_t ECAT_McAxisGantryGain(uint16_t DeviceNo, uint16_t SlaveNo, double Kp, double Ki);
int32_t ECAT_SetSlaveAlias(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Alias);
int32_t ECAT_GetSlaveSwAlias(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t *Alias);
int32_t ECAT_SetSlaveNoType(uint16_t DeviceNo, uint16_t Type);
int32_t ECAT_GetSlaveNoType(uint16_t DeviceNo, uint16_t *Type);
int32_t ECAT_GetSlavePos(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t *Pos);
int32_t ECAT_GetSlaveNo(uint16_t DeviceNo, uint16_t Pos, uint16_t *SlaveNo);
int32_t ECAT_EvSetMotionCompleteParameters_Grp(uint16_t DeviceNo, uint16_t EventID, uint16_t GrpNo);
int32_t ECAT_McSetGroupPvtDecEnable(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Enable);
int32_t ECAT_McGetGroupPvtDecEnable(uint16_t DeviceNo, uint16_t GroupNo, uint16_t *Enable);
int32_t ECAT_AbortWaitforEvent(uint16_t DeviceNo);
int32_t ECAT_McSetGroupCoordinate(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Type);
int32_t	ECAT_GetDebugMsg(uint16_t DeviceNo, float* data);
int32_t ECAT_McSetGroupCoordinateLimit(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Type, uint16_t Enable, double MIN_Value, double MAX_Value);
int32_t ECAT_McGetGroupCoordinateLimit(uint16_t DeviceNo, uint16_t GroupNo, uint16_t Type, uint16_t *Enable, double *MIN_Value, double *MAX_Value);
int32_t ECAT_SetSlaveArrCmpPos(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Index, int32_t Position);
int32_t ECAT_GetSlaveArrCmpPos(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Index, int32_t *Position);
int32_t ECAT_SetSlaveArrCmpEnable(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Index, uint8_t Enable);
int32_t ECAT_GetSlaveArrCmpEnable(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Index, uint8_t *Enable);
int32_t ECAT_SetSlaveArrCmpEndIdx(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint16_t EndIndex);
int32_t ECAT_GetSlaveArrCmpEndIdx(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint16_t *EndIndex);
int32_t ECAT_SetSlaveArrCmpTrig(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo);
int32_t ECAT_SetSlaveSaveArrCmpData(uint16_t DeviceNo, uint16_t SlaveNo);
int32_t ECAT_McSetAxisDIActiveLevel(uint16_t DeviceNo, uint16_t AxisNo, uint8_t POT, uint8_t NOT, uint8_t ORG);
int32_t ECAT_McGetAxisDIActiveLevel(uint16_t DeviceNo, uint16_t AxisNo, uint8_t *POT, uint8_t *NOT, uint8_t *ORG);
int32_t ECAT_McGetAxisDI_60FD(uint16_t DeviceNo, uint16_t AxisNo, uint32_t *DI);
int32_t ECAT_McSetAxisHomeDir_hontech(uint16_t DeviceNo, uint16_t AxisNo, int32_t HomeDir);
int32_t ECAT_McGetAxisHomeDir_hontech(uint16_t DeviceNo, uint16_t AxisNo, int32_t *HomeDir);
int32_t ECAT_McSetAxisLimitAsHome_Stepper(uint16_t DeviceNo, uint16_t AxisNo, int32_t Value);
int32_t ECAT_McGetAxisLimitAsHome_Stepper(uint16_t DeviceNo, uint16_t AxisNo, int32_t *Value);
int32_t ECAT_McSetAxisHomeLogic_hontech(uint16_t DeviceNo, uint16_t AxisNo, uint8_t NOT, uint8_t POT, uint8_t ORG);
int32_t ECAT_McGetAxisHomeLogic_hontech(uint16_t DeviceNo, uint16_t AxisNo, uint8_t *NOT, uint8_t *POT, uint8_t *ORG);
int32_t ECAT_SaveSlaveEEPROM(uint16_t DeviceNo, uint16_t SlaveNo);
int32_t ECAT_McSetAxisActualPosition(uint16_t DeviceNo, uint16_t AxisNo, double Position);
int32_t ECAT_McSetAxisCommandPosition(uint16_t DeviceNo, uint16_t AxisNo, double Position);
int32_t ECAT_McGetAxisDI_hontech(uint16_t DeviceNo, uint16_t AxisNo, uint32_t *DI);
int32_t ECAT_McSetAxisHomeExtDist(uint16_t DeviceNo, uint16_t AxisNo, double Value);
int32_t ECAT_McGetAxisHomeExtDist(uint16_t DeviceNo, uint16_t AxisNo, double *Value);
int32_t ECAT_OpenMotionConfigEx(uint16_t DeviceNo, char* bstrFileName, uint16_t *AxisCnt, uint16_t SlaveNo[],uint16_t SubAxisNo[], double PPU[], int32_t HomeMethod[], double HomeSpeedSeachSw[],double HomeSpeedSeachZr[], double HomeAcc[], uint32_t EncoderPPR[], uint32_t MotorPPR[]);
int32_t ECAT_McSetAxisAccDecTime_Stepper(uint16_t DeviceNo, uint16_t AxisNo, uint16_t AccTime_ms, uint16_t DecTime_ms);
int32_t ECAT_McGetAxisAccDecTime_Stepper(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *AccTime_ms, uint16_t *DecTime_ms);
int32_t ECAT_GetDeviceStateEx(uint16_t DeviceNo, uint32_t *LinkUp, uint32_t *SlavesResp, uint32_t *AlStates, uint32_t *Wc);
int32_t ECAT_UploadEc_Generic(uint16_t DeviceNo, uint32_t Offset, char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t ECAT_UploadEc_Master(uint16_t DeviceNo, uint32_t Offset, char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t ECAT_SlaveNonBlockRegErrReadRequest(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Type);
int32_t ECAT_SlaveNonBlockRegErrReadState(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Type, uint8_t *Value1, uint8_t *Value2);
int32_t ECAT_SlaveNonBlockRegErClrRequest(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Type);
int32_t ECAT_SlaveNonBlockRegErrClrState(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Type);
int32_t ECAT_DownloadSyslog(uint16_t DeviceNo, uint16_t LogNo, uint32_t *Offset, char *Data, uint32_t *DataSize, uint8_t *LastFlag);
int32_t ECAT_GetSlaveRegErr(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t Type, uint8_t *Value1, uint8_t *Value2);
int32_t ECAT_McGetAxisHomePos_hontech(uint16_t DeviceNo, uint16_t AxisNo, double *Pos);
int32_t ECAT_SetSlaveEncIdxLatchBufferEnable(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t Enable);
int32_t ECAT_GetSlaveEncIdxLatchBufferEnable(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, uint8_t *Enable);
int32_t ECAT_ResetSlaveEncIdxLatchBuffer(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo);
int32_t	ECAT_GetSlaveEncIdxLatchBuffer(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t EncNo, int32_t GetCount, int32_t *ActualGetCount, int32_t *Data);
int32_t ECAT_McSetAxisAccUnit_Stepper(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Unit, uint32_t *AbortCode);
int32_t ECAT_McGetAxisAccUnit_Stepper(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *Unit, uint32_t *AbortCode);
int32_t ECAT_McSetAxisVelAccScale(uint16_t DeviceNo, uint16_t AxisNo, double VelScal, double AccScal);
int32_t ECAT_McGetAxisVelAccScale(uint16_t DeviceNo, uint16_t AxisNo, double *VelScal, double *AccScal);
int32_t ECAT_McSetAxisInpSignal(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Offset, uint16_t Bit, int32_t Enable);
int32_t ECAT_McGetAxisInpSignal(uint16_t DeviceNo, uint16_t AxisNo, uint16_t *Offset, uint16_t *Bit, int32_t *Enable);
int32_t ECAT_Upload_Ixecat(uint16_t DeviceNo, uint32_t Offset, char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t ECAT_Upload_Ixpciecat(uint16_t DeviceNo, uint32_t Offset, char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t ECAT_McSetAxisInpCompare(uint16_t DeviceNo, uint16_t AxisNo, uint32_t Time_ms, double PosWindow, int32_t Enable);
int32_t ECAT_McGetAxisInpCompare(uint16_t DeviceNo, uint16_t AxisNo, uint32_t *Time_ms, double *PosWindow, int32_t *Enable);
int32_t ECAT_McSetAxisInpTimeOut(uint16_t DeviceNo, uint16_t AxisNo, uint32_t Time_ms);
int32_t ECAT_McGetAxisInpTimeOut(uint16_t DeviceNo, uint16_t AxisNo, uint32_t *Time_ms);
int32_t ECAT_McSetAxisWanErrEnable(uint16_t DeviceNo, uint16_t AxisNo, uint32_t Enable);
int32_t ECAT_McGetAxisWanErrEnable(uint16_t DeviceNo, uint16_t AxisNo, uint32_t *Enable);
int32_t ECAT_McSetIxecatVir(uint16_t DeviceNo, uint16_t No);
int32_t ECAT_McGetIxecatVir(uint16_t DeviceNo, uint16_t *No);
int32_t ECAT_SetMultiSlaveDO(uint16_t DeviceNo, uint16_t SlaveNo[], uint32_t Value[], uint16_t SlaveCnt);
int32_t ECAT_GetMultiSlaveDO(uint16_t DeviceNo, uint16_t SlaveNo[], uint32_t *Value, uint16_t SlaveCnt);
int32_t ECAT_McSetAxisDefaultMode(uint16_t DeviceNo, uint16_t AxisNo, int8_t Mode);
int32_t ECAT_McGetAxisDefaultMode(uint16_t DeviceNo, uint16_t AxisNo, int8_t *Mode);
int32_t ECAT_SetDeviceIgnoreWC(uint16_t DeviceNo, int8_t Enable);
int32_t ECAT_GetDeviceIgnoreWC(uint16_t DeviceNo, int8_t *Enable);
int32_t ECAT_SetIghVir(uint16_t DeviceNo, uint16_t No);
int32_t ECAT_GetIghVir(uint16_t DeviceNo, uint16_t *No);
int32_t ECAT_McInit_Ex(uint16_t DeviceNo, char* FileName, uint16_t SlaveNo[], uint16_t SubAxisNo[], uint16_t* AxisCnt);
int32_t ECAT_UploadFOE(uint16_t DeviceNo, uint16_t SlaveNo, uint32_t Offset, char *Data, uint32_t DataSize, uint8_t LastFlag);
int32_t ECAT_SetMultiSlaveDO_AutoOff(uint16_t DeviceNo, uint16_t SlaveNo[], uint32_t Value[], uint32_t Width[], uint32_t Mask[], uint16_t SlaveCnt);
int32_t ECAT_McGetAxisHomeOffset_hontech(uint16_t DeviceNo, uint16_t AxisNo, double *Pos);
int32_t ECAT_McSetAxisAccDecUnit(uint16_t DeviceNo, uint16_t AxisNo, uint16_t Unit);
int32_t ECAT_McGetAxisAccDecUnit(uint16_t DeviceNo, uint16_t AxisNo, uint16_t* Unit);
int32_t ECAT_McSetAxisAccDecRate(uint16_t DeviceNo, uint16_t AxisNo, double Rate);
int32_t ECAT_McGetAxisAccDecRate(uint16_t DeviceNo, uint16_t AxisNo, double* Rate);
int32_t ECAT_SetStepperCompact(uint16_t DeviceNo, uint16_t Enable);
int32_t ECAT_GetStepperCompact(uint16_t DeviceNo, uint16_t* Enable);
int32_t ECAT_McSetAxisStartVelocity(uint16_t DeviceNo, uint16_t AxisNo, double Vel);
int32_t ECAT_McGetAxisStartVelocity(uint16_t DeviceNo, uint16_t AxisNo, double* Vel);
int32_t ECAT_McGetAxisState_Ex(uint16_t DeviceNo, uint16_t AxisNo, uint32_t* State);
int32_t ECAT_McGetAxisLastError_Ex(uint16_t DeviceNo, uint16_t AxisNo, int32_t* Error);
int32_t ECAT_McGetAxisDriveError_Ex(uint16_t DeviceNo, uint16_t AxisNo, uint16_t* Error);
int32_t ECAT_McGetAxisActualPos_Ex(uint16_t DeviceNo, uint16_t AxisNo, double* Pos);
int32_t ECAT_McGetAxisCommandPos_Ex(uint16_t DeviceNo, uint16_t AxisNo, double* Pos);
int32_t ECAT_McGetAxisActualVel_Ex(uint16_t DeviceNo, uint16_t AxisNo, double* Vel);
int32_t ECAT_McGetAxisDI_Ex(uint16_t DeviceNo, uint16_t AxisNo, uint32_t* DI);
int32_t ECAT_McGetAxisActualTorque_Ex(uint16_t DeviceNo, uint16_t AxisNo, double* Torque);
int32_t ECAT_McGetAxisDI_hontech_Ex(uint16_t DeviceNo, uint16_t AxisNo, uint32_t* DI);
int32_t ECAT_McGetAxisPos_Ex(uint16_t DeviceNo, double* ActPos, double* CmdPos);
int32_t ECAT_McSetAxisPos_Ex_TimeOut(uint16_t DeviceNo, uint64_t TimeOut);//ms
int32_t ECAT_McGetAxisActualPos_Directly(uint16_t DeviceNo, uint16_t AxisNo, double* Pos);
int32_t ECAT_McGetAxisCommandPos_Directly(uint16_t DeviceNo, uint16_t AxisNo, double* Pos);
int32_t ECAT_McGetAxisState_Directly(uint16_t DeviceNo, uint16_t AxisNo, uint32_t* State);
int32_t ECAT_McGetAxisDI_hontech_Directly(uint16_t DeviceNo, uint16_t AxisNo, uint32_t* DI);
int32_t ECAT_McGetAxisDI_Directly(uint16_t DeviceNo, uint16_t AxisNo, uint32_t* DI);
int32_t ECAT_McEnable_Directly(uint16_t DeviceNo);
int32_t ECAT_SetSlaveDIMap(uint16_t DeviceNo, uint16_t ChannelCnt, uint16_t* SlaveNo, uint16_t* Dir);
int32_t ECAT_GetSlaveAiVoltData_Ex(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t ChannelCnt, double *Data);
int32_t ECAT_GetSlaveDI_Directly(uint16_t DeviceNo, uint16_t SlaveNo, uint32_t* Value);
int32_t ECAT_GetSlaveDIBit_Directly(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t BitNo, uint32_t* Value);
int32_t ECAT_GetSlaveDO_Directly(uint16_t DeviceNo, uint16_t SlaveNo, uint32_t* Value);
int32_t ECAT_GetSlaveDOBit_Directly(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t BitNo, uint32_t* Value);
int32_t ECAT_McSetBuffetAmp(uint16_t DeviceNo, uint16_t BeffetNo, double Amp);
int32_t ECAT_McSetBuffetFreq(uint16_t DeviceNo, uint16_t BeffetNo, double Freq);
int32_t ECAT_McSetBuffetGain(uint16_t DeviceNo, uint16_t BeffetNo, uint16_t AxisNo, double Gain);
int32_t ECAT_McSetImpactGain(uint16_t DeviceNo, uint16_t ImpactNo, uint16_t AxisNo, double Gain);
int32_t ECAT_McSetImpactFadeTime(uint16_t DeviceNo, uint16_t ImpactNo, uint16_t AxisNo, double FadeTime_s);
int32_t ECAT_McSetImpactFreq(uint16_t DeviceNo, uint16_t ImpactNo, uint16_t AxisNo, double Freq);
int32_t ECAT_McSetImpactDamp(uint16_t DeviceNo, uint16_t ImpactNo, uint16_t AxisNo, double Damp);
int32_t ECAT_McSetImpact(uint16_t DeviceNo, uint16_t ImpactNo);
int32_t ECAT_GetDeviceXilinx_Process(uint16_t DeviceNo, uint8_t* Process);
int32_t ECAT_WriteDeviceXilinx(uint16_t DeviceNo, char* sFileName);
int32_t ECAT_OpenDeviceForFlash(uint16_t DeviceNo, uint8_t index_open);
int32_t ECAT_CloseDeviceForFlash(uint16_t DeviceNo);
int32_t ECAT_GetDeviceXilinxVer(uint16_t DeviceNo, uint16_t* Version);
int32_t ECAT_McAxisHome_Servotronix(uint16_t DeviceNo, uint16_t MasterNo, uint16_t DiffenceNo, uint16_t Settings);
int32_t ECAT_McSetAxisActualPos_Servotronix(uint16_t DeviceNo, uint16_t MasterNo, uint16_t DiffenceNo, double Position);
int32_t ECAT_McAxisGantryOut(uint16_t DeviceNo, uint16_t AxisNo);
int32_t ECAT_SetSlaveState(uint16_t DeviceNo, uint16_t SlaveNo, uint16_t State);
int32_t ECAT_GetFoEState(uint16_t DeviceNo, uint16_t* State);
int32_t ECAT_SetDeviceCmpDisable(uint16_t DeviceNo, uint16_t CmpNo);
int32_t ECAT_McAxisGantryGainEx(uint16_t DeviceNo, uint16_t SlaveNo, double Kp, double Ki, double Kd);
int32_t ECAT_McAxisTangentOut(uint16_t DeviceNo, uint16_t AxisNo, uint16_t GroupNo);
int32_t ECAT_McAxisMoveVelEx(uint16_t DeviceNo, uint16_t AxisNo, double Vel);
int32_t ECAT_McAxisMoveTorEx(uint16_t DeviceNo, uint16_t AxisNo, double Torque);
int32_t ECAT_McAxisGearInByPos(uint16_t DeviceNo, uint16_t MasterNo, uint16_t SlaveNo, int32_t RatioNum, uint32_t RationDen, uint16_t SyncSource, double MasterSynPos, double SlaveSynPos, double GearOutPos, double MaterialLength, double ReturnVel, uint16_t ReturnAcctime);
#ifdef __cplusplus
}
#endif

#endif /* _ECATDEVICEAPI_H_ */
