package lib;

import lib.MtnLib.*;
import lib.MtnLib_com.*;
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import java.util.*;

/**
 * 自动生成的JNA封装类，用于调用 mtn_lib20.so 动态库
 * 根据 mtn_lib20_ext.h 自动生成
 */
public class mtn_lib20_ext {
    //     public static class HAND extends Pointer {

    //     public HAND() {
    //         super(Pointer.nativeValue(Pointer.NULL));
    //     }

    //     public HAND(Pointer p) {
    //         super(Pointer.nativeValue(p));
    //     }
    // }

    // public static class PHAND extends PointerByReference {

    //     public PHAND() {
    //         super();}

    //     public PHAND(Pointer p) {
    //         super(p);
    //     }

    //     public PHAND(HAND value) {
    //         super(value);
    //     }
    //         // 获取HAND的方法
    //     public HAND getHandle() {
    //         return new HAND(getValue());
    //         }
    // }

    // public static final int UNSIGNED_CHAR = 0xFF;
    // public static final int UNSIGNED_SHORT = 0xFFFF;
    // public static final long UNSIGNED_INT = 0xFFFFFFFFL;

    //     public static byte toUnsignedByte(int value) {
    //     return (byte)(value & UNSIGNED_CHAR);
    // }
    
    // public static short toUnsignedShort(int value) {
    //     return (short)(value & UNSIGNED_SHORT);
    // }
    
    // public static int toUnsignedInt(long value) {
    //     return (int)(value & UNSIGNED_INT);
    // }
    // // 添加在类开头
    // public static class NMCException extends RuntimeException {
    //     public NMCException(String message) {
    //         super(message);
    //     }
    // }
// 高级急停
public static final short ESTOP_DI_EX_CH_NUM				= 2;// 高级急停最大通道数量

// 高级捕获通道数目
public static final short CAPT_EX_CH_NUM				= 6;// 

// 坐标系运动：圆弧插补配置
public static final int MAX_ERR_TABLE_SECTION	= 2;

// 坐标系状态字位定义:内部扩展 
public static final NativeLong BIT_CORD_POSREC = new NativeLong(0x00000040L);    // bit 6 , 伺服位置到达,步进模式时位置到达,伺服模式时实际位置到达误差限    
public static final NativeLong BIT_CORD_AUXAXIS_BUSY   = new NativeLong(0x00000080L);    // bit 7 , 坐标系运动中的关联轴启动前处于运动状态错误
public static final NativeLong BIT_CORD_AUXAXIS_ERR   = new NativeLong(0x00000100L);    // bit 8 , 插补辅助轴错误             
public static final NativeLong BIT_CORD_AXIS_ERR  = new NativeLong(0x00000200L);    // bit 9 , 插补轴存在报警错误（如限位、驱动报警）   
public static final NativeLong BIT_CORD_SDRAM_CALC_ERR  = new NativeLong(0x00000400L);    // bit 10 , SDRAM缓冲区计算错误  
public static final NativeLong BIT_CORD_SCARA_CALC_ERR  = new NativeLong(0x00000800L);    // bit 11 , SCARA计算数据错误

// 缓冲区数据打包
public static final short BUF_LINE	= 0;//缓冲区直线插补
public static final short BUF_DO		= 1;//缓冲区DO输出
public static final short BUF_OUT		= 2;//缓冲区OUT输出
public static final short BUF_DELAY   = 3;//缓冲区延时
public static final short BUF_AXMOVE	= 4;//缓冲区单轴运动
public static final short BUF_DOEX    = 5;//缓冲区DO输出（根据掩码输出）
public static final short BUF_ARC_R   = 6;//平面圆弧插补：终点位置、半径、方向
public static final short BUF_ARC_C   = 7;//平面圆弧插补：终点位置、圆心、方向
public static final short BUF_LASER_SETPOWER		= 8;// 激光：设置能量
public static final short BUF_LASER_ONOFF			= 9;// 激光：缓冲区开关光
public static final short BUF_LASER_SETFOLLOW		= 10;// 激光：设置跟随
public static final short BUF_LASER_SETPARAM		= 11;// 激光：设置参数
public static final short BUF_LINEXYZA			= 12;// 缓冲区四轴直线插补
public static final short BUF_SHIO_GATEPULSE		= 13;// 缓冲区输出Gate脉冲
public static final short BUF_DOBITPULSE			= 14;// DoBitPulse功能
public static final short BUF_XYZD8          		= 15;// LineXYZD8,数据结构体为：TCrdLineXYZD8Unit
public static final short BUF_SHIOMINFRQ     		= 16;// 设置或清除SHIO最小频率
public static final short BUF_SHIOSETPARAM        = 17;// 设置SHIO参数
public static final short BUF_SHIOGATEONOFF       = 18;// 设置Gate开关
public static final short BUF_WAITENCINPOS        = 19;// 等待电机到位
public static final short BUF_WAITDI              = 20;// 等待DI
public static final short BUF_LASER_SETBIAS       = 21;// 缓存区设置激光bias
public static final short BUF_LINEDBXYZA			= 22;// 双精度直线插补

// 编码器硬件捕获模式选择 
public static final short CAPT_MODE_Z          = 0;// 编码器Z相捕获 
public static final short CAPT_MODE_IO         = 1;// IO 捕获 
public static final short CAPT_MODE_Z_AND_IO   = 2;// IO+Z相 捕获 
public static final short CAPT_MODE_Z_AFT_IO   = 3;// 先IO触发再Z相触发 捕获 

// 编码器硬件捕获IO源选择 
public static final short CAPT_IO_SRC_HOME    = 0;// 原点输入作为捕获IO 
public static final short CAPT_IO_SRC_LMTN    = 1;// 负向限位输入作为捕获IO 
public static final short CAPT_IO_SRC_LMTP    = 2;// 正向限位输入作为捕获IO 
public static final short CAPT_IO_SRC_DI0     = 3;// 通用数字输入0作为捕获IO 
public static final short CAPT_IO_SRC_DI1     = 4;// 通用数字输入1作为捕获IO 
public static final short CAPT_IO_SRC_DI2     = 5;// 通用数字输入2作为捕获IO 
public static final short CAPT_IO_SRC_DI3     = 6;// 通用数字输入3作为捕获IO 
public static final short CAPT_IO_SRC_DI4     = 7;// 通用数字输入4作为捕获IO 
public static final short CAPT_IO_SRC_DI5     = 8;// 通用数字输入5作为捕获IO 
public static final short CAPT_IO_SRC_DI6     = 9;// 通用数字输入6作为捕获IO 
public static final short CAPT_IO_SRC_DI7     = 10;// 通用数字输入7作为捕获IO 
public static final short CAPT_IO_SRC_DI8     = 11;// 通用数字输入8作为捕获IO 
public static final short CAPT_IO_SRC_DI9     = 12;// 通用数字输入9作为捕获IO 
public static final short CAPT_IO_SRC_DI10    = 13;// 通用数字输入10作为捕获IO 
public static final short CAPT_IO_SRC_DI11    = 14;// 通用数字输入11作为捕获IO 
public static final short CAPT_IO_SRC_DI12    = 15;// 通用数字输入12作为捕获IO 

// DIO映射
public static final byte DIO_MAP_MAX_NUM		= 8;// 最多允许的映射关系

// 信号类型定义
public static final byte DIO_TYPE_GPI		= 1;// 通用输入
public static final byte DIO_TYPE_HOME		= 2;// 轴Home信号
public static final byte DIO_TYPE_ALM		= 3;// 驱动器报警信号
public static final byte DIO_TYPE_LMTN		= 4;// 轴负向限位信号
public static final byte DIO_TYPE_LMTP		= 5;// 轴正向限位信号
public static final byte DIO_TYPE_GPO		= 6;// 通用输出信号
public static final byte DIO_TYPE_SVON		= 7;// 伺服使能信号
public static final byte DIO_TYPE_SVCLR		= 8;// 报警清除信号

//平台相关指令
public static final NativeLong     VAR_PWM0_CTL    = new NativeLong(256);// pwm通道0打开关闭,1表示打开,0表示关闭
public static final NativeLong     VAR_PWM0_VALUE  = new NativeLong(257);// pwm通道0输出值
public static final NativeLong     VAR_PWM1_CTL    = new NativeLong(258);// pwm通道1打开关闭,1表示打开,0表示关闭
public static final NativeLong     VAR_PWM1_VALUE  = new NativeLong(259);// pwm通道1输出值
public static final NativeLong     VAR_EXT_DAC0    = new NativeLong(260);// 扩展的DAC通道0
public static final NativeLong     VAR_EXT_DAC1    = new NativeLong(261);// 扩展的DAC通道1
public static final NativeLong     VAR_OUT_OPTION	= new NativeLong(262);// PWM输出通道选项
public static final NativeLong     VAR_DAC0		= new NativeLong(263);// DAC通道0~7
public static final NativeLong     VAR_DAC1		= new NativeLong(264);
public static final NativeLong     VAR_DAC2		= new NativeLong(265);
public static final NativeLong     VAR_DAC3		= new NativeLong(266);
public static final NativeLong     VAR_DAC4		= new NativeLong(267);
public static final NativeLong     VAR_DAC5		= new NativeLong(268);
public static final NativeLong     VAR_DAC6		= new NativeLong(269);
public static final NativeLong     VAR_DAC7		= new NativeLong(270);
public static final NativeLong     VAR_ADC0		= new NativeLong(271);// ADC通道0~7
public static final NativeLong     VAR_ADC1		= new NativeLong(272);
public static final NativeLong     VAR_ADC2		= new NativeLong(273);
public static final NativeLong     VAR_ADC3		= new NativeLong(274);
public static final NativeLong     VAR_ADC4		= new NativeLong(275);
public static final NativeLong     VAR_ADC5		= new NativeLong(276);
public static final NativeLong     VAR_ADC6		= new NativeLong(277);
public static final NativeLong     VAR_ADC7		= new NativeLong(278);
public static final NativeLong     VAR_INNNER_VAR1	= new NativeLong(1000);
public static final NativeLong     VAR_INNNER_VAR2	= new NativeLong(1001);
public static final NativeLong     VAR_INNNER_VAR3	= new NativeLong(1002);
public static final NativeLong     VAR_INNNER_VAR4	= new NativeLong(1003);
public static final NativeLong     VAR_INNNER_VAR5	= new NativeLong(1004);
public static final NativeLong     VAR_INNNER_VAR6	= new NativeLong(1005);
public static final NativeLong     VAR_INNNER_VAR7	= new NativeLong(1006);
public static final NativeLong     VAR_INNNER_VAR8	= new NativeLong(1007);
public static final NativeLong		VAR_ECAT_LOCAL_AX_NUM		= new NativeLong(10000);
public static final NativeLong		VAR_ECAT_BUS_AX_NUM			= new NativeLong(10001);

// 系统变量宏定义
public static final NativeLong SYS_VAR_SET_STAT_ENABLE		= new NativeLong(100);
public static final NativeLong SYS_VAR_GET_CLOCK			= new NativeLong(101);
public static final NativeLong SYS_VAR_GET_USERAPP_COUNT	= new NativeLong(107);
public static final NativeLong SYS_VAR_GET_USERAPP_MIN		= new NativeLong(108);
public static final NativeLong SYS_VAR_GET_USERAPP_MAX		= new NativeLong(109);
public static final NativeLong SYS_VAR_GET_USERAPP_AVG		= new NativeLong(110);
public static final NativeLong SYS_VAR_GET_USERAPP_CURT	= new NativeLong(111);
public static final NativeLong SYS_VAR_GET_PRFINT_COUNT	= new NativeLong(112);
public static final NativeLong SYS_VAR_GET_PRFINT_MIN		= new NativeLong(113);
public static final NativeLong SYS_VAR_GET_PRFINT_MAX		= new NativeLong(114);
public static final NativeLong SYS_VAR_GET_PRFINT_AVG		= new NativeLong(115);
public static final NativeLong SYS_VAR_GET_PRFINT_CURT		= new NativeLong(116);
public static final NativeLong SYS_VAR_GET_MAINLP_COUNT	= new NativeLong(117);
public static final NativeLong SYS_VAR_GET_MAINLP_MIN		= new NativeLong(118);
public static final NativeLong SYS_VAR_GET_MAINLP_MAX		= new NativeLong(119);
public static final NativeLong SYS_VAR_GET_MAINLP_AVG		= new NativeLong(120);
public static final NativeLong SYS_VAR_GET_MAINLP_CURT		= new NativeLong(121);

// paraID
public static final NativeLong     PARA_IP_ADDR   	= new NativeLong(100);// IP地址,四个字节分别表示四段
public static final NativeLong     PARA_IP_MSK    	= new NativeLong(101);// IP mask
public static final NativeLong     PARA_IP_GW   	= new NativeLong(102);// Gateway
public static final NativeLong     PARA_IP_DHCP   	= new NativeLong(103);// DHCP
public static final NativeLong     PARA_WRITE_EN	= new NativeLong(999);// 参数保存

// Collect模块：变量类型
public static final short COLLECT_ADDRESS_PRF_POS				= 0;// 规划位置
public static final short COLLECT_ADDRESS_AXIS_POS			= 1;// 机械位置
public static final short COLLECT_ADDRESS_ENC_POS				= 2;// 编码器位置
public static final short COLLECT_ADDRESS_CMD_POS				= 3;// 命令位置
public static final short COLLECT_ADDRESS_AXIS_VEL			= 4;// 电机速度
public static final short COLLECT_ADDRESS_CRD_POS				= 5;// 坐标系0位置
public static final short COLLECT_ADDRESS_CRD_VEL				= 6;// 坐标系0速度
public static final short COLLECT_ADDRESS_CRD_POS0			= 5;// 坐标系0位置
public static final short COLLECT_ADDRESS_CRD_VEL0			= 6;// 坐标系0速度
public static final short COLLECT_ADDRESS_CRD_POS1			= 9;// 坐标系1位置		
public static final short COLLECT_ADDRESS_CRD_VEL1			= 10;// 坐标系1速度
public static final short COLLECT_ADDRESS_ENC_VEL				= 7;// 编码器速度
public static final short COLLECT_ADDRESS_CMD_VEL				= 8;// 命令速度
public static final short	COLLECT_ADDRESS_LASER_OUTPUT		= 11;// 激光输出（补偿前）
public static final short COLLECT_ADDRESS_LASER_GATE			= 12;// 激光gate信号状态
public static final short COLLECT_ADDRESS_LASER_POWER			= 13;// 激光能量当前输出值
public static final short COLLECT_ADDRESS_DI      			= 14;// 数字量输入状态
public static final short COLLECT_ADDRESS_DO      			= 15;// 数字量输出状态
public static final short COLLECT_ADDRESS_CRD_USERSEG			= 16;// 坐标系用户段号
public static final short COLLECT_ADDRESS_DAC					= 17;// 模拟量输出
public static final short COLLECT_ADDRESS_ADC					= 18;// 模拟量输入
public static final short COLLECT_ADDRESS_AXISSTS				= 19;// 轴状态
public static final short COLLECT_ADDRESS_PRF_ACC				= 20;// 规划加速度
public static final short COLLECT_ADDRESS_POS_ERR				= 21;// 位置误差
public static final short COLLECT_ADDRESS_CRD_STS				= 22;// 坐标系状态
public static final short COLLECT_ADDRESS_INNER_VAR			= 23;// 内部变量
public static final short COLLECT_ADDRESS_DBG_VAR				= 24;// 调试变量
public static final short COLLECT_ADDRESS_MIO					= 25;// 轴专用信号

// 采集模块：采集配置
public static final short COLLECT_LIST_MAX		= 8;//每组最多采集8个数据

// 采集模块：触发模式
public static final short COLLECT_MODE_NONE	= 0;// 无条件
public static final short COLLECT_MODE_G_SRC1	= 1;// 采集源1数值大于比较值
public static final short COLLECT_MODE_L_SRC1	= 2;// 采集源1数值小于比较值
public static final short COLLECT_MODE_DIFF	= 3;// 采集源1与采集源2两项差值大于比较值
public static final short COLLECT_MODE_AND	= 4;// 采集源1按位与比较值不为0（仅限整数变量，32bit整形处理）
public static final short COLLECT_MODE_AND0	= 5;// 采集源1按位与比较值为0（仅限整数变量）
public static final short COLLECT_MODE_OR		= 6;// 采集源1按位或比较值不为0（仅限整数变量）
public static final short COLLECT_MODE_OR0	= 7;// 采集源1按位或比较值为0（仅限整数变量）

// Collect模块：采集状态
public static final short COLLECT_BUSY						= 0x0001;
public static final short COLLECT_OVERRIDE_DATA				= 0x0002;	
public static final short COLLECT_PUSH_DATA_ERR				= 0x0004;

public static final short MAX_LASER_NUMS			    = 4;// 最大激光通道

// 激光控制模式
public static final short LASER_DISABLE_MODE			    = 0;// 禁用激光功能
public static final short BASIC_OUTPUT_MODE			    = 1;// 基本控制模式
public static final short TIME_ARRAY_OUTPUT_MODE			= 2;// 波形控制模式
public static final short SHIO_OUTPUT_MODE				= 3;// 位置比较控制模式

// 激光物理信号类型
public static final short LASER_NONE 			= 0;// 关闭激光输出模式
public static final short LASER_DA  			= 1;// DA输出
public static final short LASER_PWM_DUTY		= 2;// 占空比输出
public static final short LASER_PWM_FRQ		= 3;// 频率输出
public static final short LASER_PWM_FRQ_EXT	= 4;// 频率输出,脉宽固定

// 激光能量补偿数据表单方向长度最大值
public static final short LASER_CMP_DATA_LEN_MAX				= 10;

//激光
public static final short LASER_GROUP		= 12;// 最大激光能量组数
public static final short LASET_POINT		= 40;// 每组最大点数

// PT数据段类型
public static final short MT_PT_NORMAL	= 0;
public static final short MT_PT_STOP		= 1;
public static final short MT_PT_EVEN		= 2;

// PTEx的命令类型
public static final NativeLong PTEX_CMDTYPE_MV_NORMAL				= new NativeLong(0);
public static final NativeLong PTEX_CMDTYPE_MV_STOP				= new NativeLong(1);
public static final NativeLong PTEX_CMDTYPE_MV_EVEN				= new NativeLong(2);
public static final NativeLong PTEX_CMDTYPE_IMD_DO					= new NativeLong(1000);
public static final NativeLong PTEX_CMDTYPE_IMD_DOBITPULSE			= new NativeLong(1001);

//二维位置点比较
public static final short CMP_OUTPUT_CHN_MAX		= 3;
public static final short CMP_OUTPUT_GROUP_MAX	= 2;

// DO脉冲输出最大通道数
public static final short MAX_NUM_DOBIT_PULSE		= 4;

// BufIo输出最大组数
public static final short MAX_ADV_BUFIO_GROUP	= 2;

//坐标系干涉保护指令
public static final short CRD_INTERF_GROUP_MAX		= 2;

//自动状态返回
public static final short AUTO_RTN_MAX_AXIS  = 12;

//高速一维位置比较
public static final short CMP_HS1DIMENS_CHN_MAX	= 4;// 最大支持四个通道
public static final short CMP_HS1DIMENS_POS_MAX	= 128;// 每个通道最多支持8个位置点

// DI type
public static final short DI_TYPE_LIMIT_POSITIVE               = 0;// 正向限位
public static final short DI_TYPE_LIMIT_NEGATIVE               = 1;// 负向限位
public static final short DI_TYPE_ALARM                        = 2;// 驱动报警
public static final short DI_TYPE_HOME                         = 3;// 原点
public static final short DI_TYPE_GPI                          = 4;// 通用输入
public static final short DI_TYPE_ARRIVE						 = 5;// 到位
public static final short DI_TYPE_LIMIT_POSITIVE_LOG           = 10;// 正向限位:逻辑电平
public static final short DI_TYPE_LIMIT_NEGATIVE_LOG           = 11;// 负向限位:逻辑电平
public static final short DI_TYPE_ALARM_LOG                    = 12;// 驱动报警:逻辑电平
public static final short DI_TYPE_HOME_LOG                     = 13;// 原点:逻辑电平

// DO type
public static final short DO_TYPE_MOTOR_ENABLE            = 1;// 电机使能
public static final short DO_TYPE_MOTOR_CLEAR             = 2;// 电机报警清除
public static final short DO_TYPE_GPDO                    = 3;// 通用输出1

public static final short REPEAT_CAPT_MAX_NUM		= 64;// 最大重复捕获次数

//xy平面补偿
public static final short XY2DCOMP_MAX_TABLE_NUM	= 4;// 平面补偿的最大表格数量

// 错误代码：指令执行的错误码-ERR_CODE_OFFSET就得到实际的错误码
public static final short ERR_OK									= 0;// OK
public static final short Err_Link_PrbStep_Ch                     = 10000;// PrbStepSetConfig的ch参数不正确
public static final short Err_Link_PrbStepSetConfig_AxMask        = 10001;// PrbStepSetConfig的AxMask参数不正确
public static final short Err_Link_PrbStepSetConfig_Acc           = 10002;// PrbStepSetConfig的Acc参数不正确
public static final short Err_Link_PrbStepSetConfig_Vel           = 10003;// PrbStepSetConfig的Vel参数不正确
public static final short Err_Link_PrbStepSetConfig_Src           = 10004;// PrbStepSetConfig的Src参数不正确
public static final short Err_Link_ADVCapt_Cfg_Chn				= 10010;// AdvCapt的ch参数不正确
public static final short ERR_CM_CMD_UNSUPPORT					= 10011;// 不支持的命令字
public static final short ERR_CM_CMD_REC_DATA						= 10012;// 收到异常数据
public static final short Err_Link_ADVCapt_GetData_Len			= 10013;// OEMLY_GetData的byteLenToGet参数范围不正确
public static final short Err_Link_ADVCapt_Cfg_TrigSrc			= 10014;// OEMLY_SetConfig的TrigSrc参数不正确
public static final short Err_Link_ADVCapt_Cfg_AxMask				= 10015;// OEMLY_SetConfig的AxMask参数不正确
public static final short Err_Link_ADVCapt_OnOff_StartAx			= 10016;// AdvCapt的startAxMsk参数不正确
public static final short Err_Link_ADVCapt_OnOff_ErrZone			= 10017;// AdvCapt的startPosErrZone参数不正确

public static final short ADV_CAPTEX_MAX_CH			= 2;// 最大通道数

// 捕获源
public static final short CAPT_EX_SRC_GPI				= 0;// 通用输入
public static final short CAPT_EX_SRC_NEGLMT			= 1;// 负向限位
public static final short CAPT_EX_SRC_POSLMT			= 2;// 正向限位
public static final short CAPT_EX_SRC_HOME			= 3;// 原点
public static final short CAPT_EX_SRC_Z				= 4;// Z向信号
public static final short CAPT_EX_SRC_PRFPOS			= 5;// 规划到特定位置
public static final short CAPT_EX_SRC_ENCPOS			= 6;// 编码器特定位置
public static final short CAPT_EX_SRC_COMP2D			= 7;// 高速位置点比较触发
public static final short CAPT_EX_SRC_LN_COMP			= 8;// 线性位置比较触发

// 工作状态位
public static final short CAPT_STS_BIT_RUN				= 0x1;         // 是否正在工作中
public static final short CAPT_STS_BIT_ERR_SDRAM			= 0x2;         // SDRAM读写错误
public static final short CAPT_STS_BIT_ERR_FULL			= 0x4;         // 硬件缓存满
public static final short CAPT_STS_BIT_HWRUN				= 0x100;       // 硬件捕获运动状态

public static final short CRD_MAX_DIMENSION = 4;
    /**
     *  TMtLibVersion 结构体
     */
    public static class TMtLibVersion extends Structure {
        public byte strVer[] = new byte[16];
        public byte strOemVer[] = new byte[16];
        public byte strBuild[] = new byte[32];

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("strVer", "strOemVer", "strBuild");
        }
    }

    /**
     * TCardInfo 结构体
     */
    public static class TCardInfo extends Structure {
        public byte strVer[] = new byte[16];// 控制器版本号
        public byte strOemVer[] = new byte[16];// OEM版本号(定制控制器才有),默认为0
        public short time[] = new short[6];// 时间,年月日,时分秒
        public short axisNum;// 时间,年月日,时分秒
        public short encNum;// 支持的编码器数
        public short diNum;// 数字输入数量
        public short doNum;// 数字输出数量
        public short daNum;// 模拟量通道
        public short adNum;// 模拟量输入通道
        public short shioNum;// 同步高速IO通道
        public short reserved;// 保留
        public byte ipv4[] = new byte[4];// IP地址
        public byte idStr[] = new byte[16];// 板卡名称,多卡时可用名称打开参考NMC_DevOpenByID
        public int uid[] = new int[4];// 唯一序列号// 唯一序列号

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("strVer", "strOemVer", "time", "axisNum", "encNum", "diNum", "doNum", "daNum", "adNum", "shioNum", "reserved", "ipv4", "idStr", "uid");
        }
    }

    /**
     * TCardInfoEx 结构体
     */
    public static class TCardInfoEx extends Structure {
        public byte strVer[] = new byte[16];// 控制器版本号
        public byte strOemVer[] = new byte[16];// OEM版本号(定制控制器才有),默认为0
        public short time[] = new short[6];// 时间,年月日,时分秒
        public short axisNum;// 支持的轴数
        public short encNum;// 支持的编码器数
        public short diNum;// 数字输入数量
        public short doNum;// 数字输出数量
        public short daNum;// 模拟量通道
        public short adNum;// 模拟量输入通道
        public short shioNum;// 同步高速IO通道
        public short reserved;// 保留
        public byte ipv4[] = new byte[4];// IP地址
        public byte idStr[] = new byte[16];// 板卡名称,多卡时可用名称打开参考NMC_DevOpenByID
        public int uid[] = new int[4];// 唯一序列号
        public byte macAddr[] = new byte[6];// 网口mac地址
        public byte resv[] = new byte[256];

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("strVer", "strOemVer", "time", "axisNum", "encNum", "diNum", "doNum", "daNum", "adNum", "shioNum", "reserved", "ipv4", "idStr", "uid", "macAddr", "resv");
        }
    }

    /**
     * TEstopExParam 结构体
     */
    public static class TEstopExParam extends Structure {
        public short axMask;// 轴掩码
        public short diType;// DI类型，0-通用输入，1-负限位，2-正限位，3-原点，4-Z相
        public short diIndex;// 通道序号,[0,]
        public short filter;// 滤波系数,取值范围[0,255]
        public int diSense;// 触发电平,0：低电平,1：高电平
        public int reserved[] = new int[3];// 保留


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("axMask", "diType", "diIndex", "filter", "diSense", "reserved");
        }
    }

    /**
     * TAdvCaptureParam 结构体
     */
    public static class TAdvCaptureParam extends Structure {
        public short capPosIndex;// 捕获的位置源序号,0~N：轴1~N+1。（默认0）注：捕获的编码器位置根据用户设置的编码器模式决定 
        public short trigSrc;// 触发源,见上面的定义。（默认：CAPT_EX_SRC_GPI）
        public short trigIndex;// 触发源序号。（默认0）
        public short filter;// 滤波时间常数,单位0.1毫秒,取值范围[0,255]
        public int trigValue;// 触发值,对于触发源为IO,表示信号触发的有效电平；对于触发源为位置,则表示触发捕获的位置。（默认0）


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("capPosIndex", "trigSrc", "trigIndex", "filter", "trigValue");
        }
    }

    /**
     * TExtCrdPara 结构体
     */
    public static class TExtCrdPara extends Structure {
        public double startVel;//起跳速度（默认0）
        public double T;//前瞻时间常数,越大则速度变化越小 (默认1)
        public double smoothDec;//停止减速度（默认accMax）
        public double abruptDec;//急停减速度（默认无穷大）
        public short lookAheadSwitch;//前瞻启动开关( 默认为1，表示前瞻开)
        public short eventTime;// 最小的匀速段时间,单位ms,(默认为10)
        public short reserved[] = new short[2];

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("startVel", "T", "smoothDec", "abruptDec", "lookAheadSwitch", "eventTime", "reserved");
        }
    }

    /**
     * TLookaheadPara 结构体
     */
    public static class TLookaheadPara extends Structure {
        public short lookAheadSwitch;// 前瞻功能控制，0:不需要前瞻，1:使用下位机前瞻，[2,n]：使用上位机前瞻，数值为前瞻段数缓存段数
        public short centAccEn;// 是否使用指定的向心加速度，默认为0，即不使用
        public short crossEn;// 短线段合并开关,0:关闭合并；1：启用合并
        public short eventTime;// 最小的匀速段时间,单位ms,(默认为10)
        public double accMax;// 机台允许的最大加速度,默认1000
        public double T;// 前瞻时间常数,越大则速度变化越小 (默认1)
        public double slowAng;// 减速角度,小于设定角度，则不减速
        public double stopAng;// 停止角度，大于设定角度，则减速为0
        public double crossProp;// 短线段合并粒度，取值范围(0,n],数值越大，则合并越夸张	
        public double centAcc;// 向心加速度
        public double dvMax[] = new double[CRD_MAX_DIMENSION];// 单轴允许的速度变化量
        public double daMax[] = new double[CRD_MAX_DIMENSION];// 单轴允许的最大加速度
        public double radiusCoef;// 曲率系数，系数越大，则同曲率曲线内的速度越大，默认值1.5，为0表示取消曲率计算
        public double radiusErr;// 曲率误差，默认值200,请根据实际误差要求配置
        public double radiusAngMax;// 曲率角度最大值，默认值7
        public double radiusAngMin;// 曲率角度最小值，默认值0.5
        public short preHandleEn;// 轨迹预处理功能开关
        public short reserved;// 保留参数
        public float preHandleDisAngMin;// 轨迹预处理最小角度，保留尖角
        public float preHandleDisAngMax;// 轨迹预处理最大角度
        public float preHandleTol;// 预处理误差，单位:脉冲
        public int reserved1[] = new int[8];// 保留
        public double reserved2[] = new double[8];// 保留


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("lookAheadSwitch", "centAccEn", "crossEn", "eventTime", "accMax", "T", "slowAng", "stopAng", "crossProp", "centAcc", "dvMax", "daMax", "radiusCoef", "radiusErr", "radiusAngMax", "radiusAngMin", "preHandleEn", "reserved", "preHandleDisAngMin", "preHandleDisAngMax", "preHandleTol", "reserved1", "reserved2");
        }
    }

    /**
     * TArcSecSetting 结构体
     */
    public static class TArcSecSetting extends Structure {
        public double minSectionLen;// 分解的最小段长,默认1脉冲,范围[1,10000]
        public double maxArcDiff;// 最大的圆弧有效性误差,单位：脉冲

        // 圆弧插补误差配置表
	// 注意：MTN通过限制圆弧插补速度,从而保证插补误差。r全部为0,则表示关闭这个功能
        public double r[] = new double[MAX_ERR_TABLE_SECTION];// 半径
        public double err[] = new double[MAX_ERR_TABLE_SECTION+1];// 半径对应的插补误差,半径 [0,r0],对应err0;半径[r0,r1],对应err1;半径[r1,+max],对应err2

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("minSectionLen", "maxArcDiff", "r", "err");
        }
    }

    /**
     * TCrdPara 结构体
     */
    public static class TCrdPara extends Structure {
        public short orgFlag;// 是否自定义坐标系原点
        public short reserved[] = new short[3];// 保留
        public int offset[] = new int[4];// 自定义坐标系原点偏置（基于机械原点）
        public double synAccMax;// 最大合成加速度
        public double synVelMax;// 最大合成速度

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("orgFlag", "reserved", "offset", "synAccMax", "synVelMax");
        }
    }

    /**
     * TCrdBufLine 结构体
     */
    public static class TCrdBufLine extends Structure {
        public int segNo;// 用户自定义段号
        public int tgPos[] = new int[3];// 目标位置
        public double endVel;// 终点速度
        public double vel;// 最大速度
        public double synAcc;// 插补加速度
        public short mask;// crdAxMask,参与的插补轴,按位表示
        public short lookaheadDis;//是否使用前瞻
        public int reserved;// 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "tgPos", "endVel", "vel", "synAcc", "mask", "lookaheadDis", "reserved");
        }
    }

    /**
     * TCrdBufLineXYZA 结构体
     */
    public static class TCrdBufLineXYZA extends Structure {
        public int tgPos[] = new int[4];// 目标位置
        public double endVel;// 终点速度
        public double vel;// 最大速度
        public double synAcc;// 插补加速度
        public int segNo;// 用户自定义段号
        public short mask;// crdAxMask,参与的插补轴,按位表示
        public short lookaheadDis;//是否使用前瞻
        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("tgPos", "endVel", "vel", "synAcc", "segNo", "mask", "lookaheadDis");
        }
    }

    /**
     * TCrdBufOut 结构体
     */
    public static class TCrdBufOut extends Structure {
        public int segNo;// 用户自定义段号
        public short group;// Out输出类型
        public short ch;// 通道号,取值范围[0,n]
        public int outValue;// 输出

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "group", "ch", "outValue");
        }
    }

    /**
     * TCrdBufDO 结构体
     */
    public static class TCrdBufDO extends Structure {
        public int segNo;// 用户自定义段号
        public short group;// 缓冲区输出DO组
        public short ch;// 位序号,取值范围[0,31]
        public int value;// 输出值,取值范围[0,1]

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "group", "ch", "value");
        }
    }

    /**
     * TCrdBufDelay 结构体
     */
    public static class TCrdBufDelay extends Structure {
        public int segNo;// 用户自定义段号
        public int scale;// 延时单位,0表示单位为毫秒,1表示单位为秒
        public int count;// 延时时长

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "scale", "count");
        }
    }

    /**
     * TCrdBufDOEx 结构体
     */
    public static class TCrdBufDOEx extends Structure {
        public int segNo;// 用户自定义段号
        public int group;// 缓冲区输出DO组
        public int doMask;// 输出操作位,bit位为1表示要输出
        public int value;// 输出值,bit位指示输出值

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "group", "doMask", "value");
        }
    }

    /**
     * TCrdBufAxMove 结构体
     */
    public static class TCrdBufAxMove extends Structure {
        public int segNo;// 用户自定义段号
        public short axis;// 单轴移动的轴号 [0,n],非坐标系内轴
        public short soomthCoef;// smoothCoef:平滑系数
        public short blockEn;// 是否为阻塞模式 0 不阻塞 ,1 阻塞
        public short synEn;// 是否为同步模式 0 异步 ,1 同步
        public int tgPos;// 目标位置
        public double vel;// 运动速度
        public double acc;// 运动加速度

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "axis", "soomthCoef", "blockEn", "synEn", "tgPos", "vel", "acc");
        }
    }

    /**
     * TCrdBufArcR 结构体
     */
    public static class TCrdBufArcR extends Structure {
        public int segNo;// 用户自定义段号
        public int tgPos[] = new int[2];// 目标位置
        public short circleDir;// 是否为同步模式 0 异步 ,1 同步
        public byte lookaheadDis;// 是否使用前瞻
        public byte panelIndex;// 圆弧插补平面：0：XY平面，1：YZ平面，其他：ZX平面
        public double radius;// 半径
        public double endVel;// 终点速度
        public double vel;// 运动速度
        public double acc;// 运动加速度

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "tgPos", "circleDir", "lookaheadDis", "panelIndex", "radius", "endVel", "vel", "acc");
        }
    }

    /**
     * TCrdBufArcC 结构体
     */
    public static class TCrdBufArcC extends Structure {
        public int segNo;// 用户自定义段号
        public int tgPos[] = new int[2];// 目标位置
        public int centerPos[] = new int[2];// 目标位置
        public short circleDir;// 是否为同步模式 0 异步 ,1 同步
        public byte lookaheadDis;// 是否使用前瞻
        public byte panelIndex;// 圆弧插补平面：0：XY平面，1：YZ平面，其他：ZX平面
        public double endVel;// 终点速度
        public double vel;// 运动速度
        public double acc;// 运动加速度

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "tgPos", "centerPos", "circleDir", "lookaheadDis", "panelIndex", "endVel", "vel", "acc");
        }
    }

    /**
     * TCrdBufLaserSetParam 结构体
     */
    public static class TCrdBufLaserSetParam extends Structure {
        public int segNo;// 用户自定义段号
        public int onDelay;// 开光延时
        public int offDelay;// 关光延时
        public int minValue;// 最小输出值
        public int maxValue;// 最大输出值
        public int standbyPower;// 待机能量
        public short ch;// 激光控制通道
        public short reserved;// 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "onDelay", "offDelay", "minValue", "maxValue", "standbyPower", "ch", "reserved");
        }
    }

    /**
     * TCrdBufLaserSetFollow 结构体
     */
    public static class TCrdBufLaserSetFollow extends Structure {
        public int segNo;// 用户自定义段号
        public short followType;// 跟随类型
        public short ch;// 激光通道号
        public double overRide;// 跟随倍率

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "followType", "ch", "overRide");
        }
    }

    /**
     * TCrdBufLaserOnOff 结构体
     */
    public static class TCrdBufLaserOnOff extends Structure {
        public int segNo;// 用户自定义段号
        public short onOff;// 开关,0：关光,1：开光
        public short ch;// 激光通道号

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "onOff", "ch");
        }
    }

    /**
     * TCrdBufLaserSetPower 结构体
     */
    public static class TCrdBufLaserSetPower extends Structure {
        public int segNo;// 用户自定义段号
        public short ch;// 激光通道号
        public short reserved;// 保留
        public double power;// 能量

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "ch", "reserved", "power");
        }
    }

    /**
     * TCrdBufSHIOGatePulse 结构体
     */
    public static class TCrdBufSHIOGatePulse extends Structure {
        public int segNo;// 用户自定义段号
        public int outCount;// 输出个数
        public double gateTime;// gate输出的脉宽，单位：微秒
        public double gateFrq;// gate输出的频率，单位：HZ
        public short ch;// ch:通道
        public short reserved[] = new short[3];// 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "outCount", "gateTime", "gateFrq", "ch", "reserved");
        }
    }

    /**
     * TCrdBufDoBitPulse 结构体
     */
    public static class TCrdBufDoBitPulse extends Structure {
        public int segNo;// 用户自定义段号
        public int highLevelTime;// 高电平宽度，单位:us
        public int lowLevelTime;// 低电平宽度，单位:us
        public int outCount;// 输出脉冲个数
        public int initialLevel;// 0：先输出低电平，1：先输出高电平
        public short ch;// ch:通道
        public short enable;// 1:使能,0:关闭
        public short doType;// DO类型,默认CRD_BUFF_DO_GPDO1
        public short doIndex;// DO序号，取值范围[0,n]

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "highLevelTime", "lowLevelTime", "outCount", "initialLevel", "ch", "enable", "doType", "doIndex");
        }
    }

    /**
     * TCrdBufSHIOMinFrq 结构体
     */
    public static class TCrdBufSHIOMinFrq extends Structure {
        public int segNo;   // 用户自定义段号
        public int minFrq;  // 最小频率，仅当enable=1时有效
        public short ch;    // 通道
        public short setOrClr;// 1:设置,0:清除

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "minFrq", "ch", "setOrClr");
        }
    }

    /**
     * TCrdBufSHIOSetParam 结构体
     */
    public static class TCrdBufSHIOSetParam extends Structure {
        public int segNo;   // 用户自定义段号
        public short ch;    // 通道
        public short reserved;// 保留
        public double delay;// 延时开关光时间
        public double gateTime;// gate打开时间，单位:秒
        public double gateDistance;// 固定模式下的位置间隔，单位pulse
        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "ch", "reserved", "delay", "gateTime", "gateDistance");
        }
    }

    /**
     * TCrdBufSHIOGateOnOff 结构体
     */
    public static class TCrdBufSHIOGateOnOff extends Structure {
        public int segNo;// 用户自定义段号
        public short ch;// 通道
        public short onOff;// 1:打开，0：关闭

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "ch", "onOff");
        }
    }

    /**
     * TCrdBufWaitEncInPosition 结构体
     */
    public static class TCrdBufWaitEncInPosition extends Structure {
        public int segNo;// 用户自定义段号
        public int axisMask;// 轴掩码
        public int overTime;// 等待超时时间，单位：毫秒

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "axisMask", "overTime");
        }
    }

    /**
     * TCrdBufWaitDI 结构体
     */
    public static class TCrdBufWaitDI extends Structure {
        public int segNo;// 用户自定义段号
        public short index;// 通道号,取值范围[0,127],前64通道代表通用DI，后64通道代表扩展IO
        public short level;// 等待值
        public int waitLastTime;// 超时,单位：毫秒

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "index", "level", "waitLastTime");
        }
    }

    /**
     * TCrdBufLaserSetBias 结构体
     */
    public static class TCrdBufLaserSetBias extends Structure {
        public int segNo;// 用户自定义段号
        public short biasType;// bias类型
        public short ch;// 激光通道号
        public double bias;// bias

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("segNo", "biasType", "ch", "bias");
        }
    }

    /**
     * TCrdBufLineDbXYZA 结构体
     */
    public static class TCrdBufLineDbXYZA extends Structure {
        public double tgPos[] = new double[4];// 目标位置
        public double endVel;// 终点速度
        public double vel;// 最大速度
        public double synAcc;// 插补加速度
        public int segNo;// 用户自定义段号
        public short mask;// crdAxMask,参与的插补轴,按位表示
        public short lookaheadDis;//是否使用前瞻

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("tgPos", "endVel", "vel", "synAcc", "segNo", "mask", "lookaheadDis");
        }
    }

    /**
     * TDioMappingCfg 结构体
     */
    public static class TDioMappingCfg extends Structure {
        public byte enable;// 1：启用，0：禁用
        public byte pinGrp;// 映射的信号类型
        public byte pinIndex;// 映射的信号序号
        public byte outEnable;// 输出允许
        public byte newGrp;// 映射到的信号类型
        public byte newIndex;// 映射到的信号序号

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("enable", "pinGrp", "pinIndex", "outEnable", "newGrp", "newIndex");
        }
    }

    /**
     * TNMCTime 结构体
     */
    public static class TNMCTime extends Structure {
        public short year;// 年,真实年份。取值范围[2000,2099]
        public short mon;// 月,取值范围[1,12]
        public short day;// 日,取值范围[1,31]
        public short hour;// 时,取值范围[0,23]
        public short min;// 分,取值范围[0,59]
        public short second;// 秒,取值范围[0,59]

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("year", "mon", "day", "hour", "min", "second");
        }
    }

    /**
     * TBackGroup1 结构体
     */
    public static class TBackGroup1 extends Structure {
        public int crdSegNo;                    // 坐标系运动的段号
        public int crdPrfPos[] = new int[3];// 坐标系运动的规划位置
        public int axPrfPos[] = new int[8];// 规划位置
        public int axisPos[] = new int[8];// 机械位置
        public int encPos[] = new int[8];// 编码器位置

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("crdSegNo", "crdPrfPos", "axPrfPos", "axisPos", "encPos");
        }
    }

    /**
     * TBackGroup2 结构体
     */
    public static class TBackGroup2 extends Structure {
        public int crdSegNo[] = new int[2]; // 坐标系运动的段号
        public int[][] crdPrfPos = new int[2][3];// 坐标系运动的规划位置
        public int axPrfPos[] = new int[12];// 规划位置
        public int axisPos[] = new int[12];// 机械位置
        public int encPos[] = new int[12];// 编码器位置

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("crdSegNo", "crdPrfPos", "axPrfPos", "axisPos", "encPos");
        }
    }

    /**
     * TCollectCfg 结构体
     */
    public static class TCollectCfg extends Structure {
        public short count; // 需要采集的变量个数
        public short interval;// 采集的间隔时间,0表示每隔1毫米采集一次数据,1表示每隔2ms...
        public NativeLong address[] = new NativeLong[COLLECT_LIST_MAX];// 变量的地址
        public short length[] = new short[COLLECT_LIST_MAX];// 每个变量的长度（单位：char）
        
        public TCollectCfg() {
        //为address中每个 NativeLong 元素分配实例
        for (int i = 0; i < address.length; i++) {
            address[i] = new NativeLong(0);  // 初始化为 0
        }
        // length 是基本类型 short[]，无需 new，JNA 会自动处理
    }
        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("count", "interval", "address", "length");
        }
    }

    /**
     * TCollectTrig 结构体
     */
    public static class TCollectTrig extends Structure {
        public short mode;// 触发模式,
        public short source1;// 触发源1
        public short source2;// 触发源2
        public short startDelay;// 触发启动的延时
        public double value;// 触发比较值

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("mode", "source1", "source2", "startDelay", "value");
        }
    }

    /**
     * TTimeArrayPara 结构体
     */
    public static class TTimeArrayPara extends Structure {
        public short pwmEnable; // 是否需要输出PWM,0:立即输出一个波形，1：根据位移周期输出
        public short outputType;// 开关信号输出类型：0：gate,1：GPO
        public short outputCh;// 开关信号输出通道
        public short stLevelRevs;// SHIO输出电平取反,默认为0，不取反
        public int pwmPeriod;// 保留,PWM周期,单位us,不能小于时间数组的总周期
        public int pwmWidth;// 保留,PWM脉宽,单位us,此参数保留,脉宽等于时间数组的总周期
        public int gateDistance;// 固定模式下的位置间隔 单位：pulse。
                                // 默认0,模式2~4 下会进行有效性检查
        public int minFrqFrq;// 保留,SHIO输出最低频率，单位HZ
        public short posSrc;// 比较模式,外部编码器还是内部规划值。
                            // 0：外部编码器（推荐）,1：内部规划值。
                            // 默认0。
        public short axisMask;// 轴号,按bit 位对应。（一般两个轴）。
                              // 默认 0。
        public short minFrqEn;// 保留,是否启用SHIO输出最低频率，默认0，不启用
        public short reserved2;// 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("pwmEnable", "outputType", "outputCh", "stLevelRevs", "pwmPeriod", "pwmWidth", "gateDistance", "minFrqFrq", "posSrc", "axisMask", "minFrqEn", "reserved2");
        }
    }

    /**
     * TLaserPower 结构体
     */
    public static class TLaserPower extends Structure {
        public short time[] = new short[LASET_POINT];   // 每个点之间的间隔时间,单位:100微秒
        public short power[] = new short[LASET_POINT];// 各点的能量大小
        public short count;// 实际压入点数

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("time", "power", "count");
        }
    }

    /**
     * TSHIOPara 结构体
     */
    public static class TSHIOPara extends Structure {
        public short isArray;// 是否固定间距还是数组。0：固定间距（仅支持）,默认0
        public short outMode;// 输出模式。默认1
                            // 1：只输出gate 立即开或关,
                            // 2: 根据位移输出gate
                            // 3: 根据位移输出gate,gate 和同部trigger 信号同步
                            // 4: 根据位移输出gate,gate 和信号输入同步
        public short posSrc;// 比较模式,外部编码器还是内部规划值。
                            // 0：外部编码器（推荐）,1：内部规划值。
                            // 默认0。
        public short axisMask;// 轴号,按bit 位对应。（一般两个轴）。
                             // 默认 0。
        public double delay;// 延时开关光时间( 暂不用 ),单位：s。默认 0。
        public double gateTime;// 设置gate 打开时间,单位：s（内部最小值：1/36us ）,取值范围(0,0.0009)
                               // 默认0。
        public int gateDistance;// 固定模式下的位置间隔 单位：pulse。
                                // 默认0,模式2~4 下会进行有效性检查。
        public int k;// 低频过渡系数
        public int startDot;// 启动时出光打点
        public int lowFrqRange;// 低频范围：0:100K,1:1M
        public short outType;// 输出类型：0-Gate，1-GPO
        public short outIndex;// 输出通道，取值[0,19]
        public short reserved5;// 保留参数,应设为0。
        public short reserved6;// 保留参数,应设为0。


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("isArray", "outMode", "posSrc", "axisMask", "delay", "gateTime", "gateDistance", "k", "startDot", "lowFrqRange", "outType", "outIndex", "reserved5", "reserved6");
        }
    }

    /**
     * TPtPara 结构体
     */
    public static class TPtPara extends Structure {
        public double smoothDec;    // 停止减速度
        public double abruptDec;    // 急停减速度，暂时保留
        public double reserved1[] = new double[2];// 保留
        public int reserved2[] = new int[4];// 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("smoothDec", "abruptDec", "reserved1", "reserved2");
        }
    }

    /**
     * TPtExPara 结构体
     */
    public static class TPtExPara extends Structure {
        public short axMask;// 参与轴掩码
        public short bufLen;// 用户自定义缓冲区长度,取值范围[32,8096]
        public short reserved3[] = new short[2];// 保留
        public double smoothDec;// 停止减速度
        public double abruptDec;// 急停减速度，暂时保留
        public double reserved1[] = new double[8];// 保留
        public int reserved2[] = new int[8];// 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("axMask", "bufLen", "reserved3", "smoothDec", "abruptDec", "reserved1", "reserved2");
        }
    }

    /**
     * TPtExMvData 结构体
     */
    public static class TPtExMvData extends Structure {
        public int mvType;// 数据运动类型，比如 PTEX_CMDTYPE_MV_NORMAL
        public int segNo;// 段号
        public int mvTime;// 运动时长
        public int reseved;// 保留
        public double mvPos[] = new double[8];// 运动位置

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("mvType", "segNo", "mvTime", "reseved", "mvPos");
        }
    }
    /**
     * TPtExDo 结构体
     */

    public class TPtExDo extends Structure {
        public NativeLong mvType;      // 数据类型，必须为PTEX_CMDTYPE_DO
        public NativeLong segNo;       // 段号
        public NativeLong doType;      // do类型
        public NativeLong doMask;      // 输出位掩码
        public NativeLong doValueMask; // 输出值掩码

    @Override
    protected List<String> getFieldOrder() {
        return Arrays.asList( "mvType","segNo", "doType","doMask","doValueMask");
    }
}
    /**
     * TPtExDoBitPulse 结构体
     */
    public static class TPtExDoBitPulse extends Structure {
        public int mvType;      // 数据类型，必须为PTEX_CMDTYPE_IMD_DOBITPULSE
        public int segNo;       // 段号
        public int highLevelTime;// 高电平宽度，单位:us
        public int lowLevelTime;// 低电平宽度，单位:us
        public int outCount;// 输出脉冲个数
        public int initialLevel;// 0：先输出低电平，1：先输出高电平
        public short ch;// ch:通道
        public short enable;// 1:使能,0:关闭
        public short doType;// DO类型,如DO_TYPE_GPDO
        public short doIndex;// DO序号，取值范围[0,n]

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("mvType", "segNo", "highLevelTime", "lowLevelTime", "outCount", "initialLevel", "ch", "enable", "doType", "doIndex");
        }
    }

    /**
     * TPtExSts 结构体
     */
    public static class TPtExSts extends Structure {
        public int sts;     // 状态，按位表示
        public int timeSum;// 剩余运动时间
        public int segNo;// 当前工作段号
        public int leftSpace;// 剩余空间
        public int usedSpace;// 使用的空间
        public int reserved[] = new int[5];
        public int mvPos[] = new int[8];// 各轴运动位置
        public int encPos[] = new int[8];// 各轴运动位置

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("sts", "timeSum", "segNo", "leftSpace", "usedSpace", "reserved", "mvPos", "encPos");
        }
    }

    /**
     * TLinearCmpPara 结构体
     */
    public static class TLinearCmpPara extends Structure {
        public short dimens;
        public short compMode;
        public short axMask;
        public short src;
        public double gateTime;

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("dimens", "compMode", "axMask", "src", "gateTime");
        }
    }

    /**
     * TComp2DimensParam 结构体
     */
    public static class TComp2DimensParam extends Structure {
        public short outputchn[] = new short[CMP_OUTPUT_CHN_MAX];   // 比较输出的通道:-1表示不输出处理
        public short outputType[] = new short[CMP_OUTPUT_CHN_MAX];  // 输出方式0：脉冲1：电平
        public short chnType[] = new short[CMP_OUTPUT_CHN_MAX];// 通道类型：0 GPO, 1  GATE通道
        public short dir1No;// 方向1 的位置源轴号（0~11）
        public short dir2No;// 方向2 的位置源轴号（0~11）
        public short posSrc;// 轴位置类型 ：0规划1：编码器
        public short stLevel[] = new short[CMP_OUTPUT_CHN_MAX];// 电平模式下的起始电平（0或1）
        public short gateTime[] = new short[CMP_OUTPUT_CHN_MAX];// 脉冲方式脉冲时间:单位ms
        public short errZone;// 进入比较点容差半径范围（pulse）

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("outputchn", "outputType", "chnType", "dir1No", "dir2No", "posSrc", "stLevel", "gateTime", "errZone");
        }
    }

    /**
     * TComp2DimensParamEx 结构体
     */
    public static class TComp2DimensParamEx extends Structure {
        public short outputChn;// 比较输出的通道号，取值[0,n]
        public short outputType;// 输出方式0：脉冲1：电平
        public short chnType;// 输出方式0：脉冲1：电平
        public short dir1No;// 方向1 的位置源轴号（0~11）
        public short dir2No;// 方向2 的位置源轴号（0~11）
        public short posSrc;// 轴位置类型 ：0规划1：编码器
        public short stLevel;// 电平模式下的起始电平（0或1）
        public short errZone;// 进入比较点容差半径范围（pulse）
        public short directOutZone;// 近距离直接触发范围
        public short vibrateRange;// 抖动滤波范围
        public int gateTime;// 脉冲方式脉冲时间,单位us
        public int minIntervalTime;// 最小触发时间间隔,单位us
        public int out2Delay;// 输出2的滞后时间，单位us
        public int reserved[] = new int[7];// 保留，默认值 0（不使用）

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("outputChn", "outputType", "chnType", "dir1No", "dir2No", "posSrc", "stLevel", "errZone", "directOutZone", "vibrateRange", "gateTime", "minIntervalTime", "out2Delay", "reserved");
        }
    }

    /**
     * TComp2DimensSts 结构体
     */
    public static class TComp2DimensSts extends Structure {
        public short sts;// 运行状态，0 空闲 1 忙
        public short reserved1;// 保留
        public int freeSpace;// 控制器剩余空间
        public int usedSpace;// 剩余位置比较点
        public int outCount;// 已经输出的个数
        public int reserved2[] = new int[4];// 保留


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("sts", "reserved1", "freeSpace", "usedSpace", "outCount", "reserved2");
        }
    }

    /**
     * TCompXDimensParam 结构体
     */
    public static class TCompXDimensParam extends Structure {
        public short dimens;// 维度
        public short axMask;// 使用的轴,按位
        public short src;// 轴位置类型 ：0规划1：编码器
        public short outCnts;// 输出数量
        public short outType[] = new short[CMP_OUTPUT_CHN_MAX];// 输出方式0：脉冲1：电平
        public short outChnType[] = new short[CMP_OUTPUT_CHN_MAX];// 通道类型：0 GPO, 1  GATE通道
        public short outIndex[] = new short[CMP_OUTPUT_CHN_MAX];// GPO：0~63  GATE：0
        public short outStLevel[] = new short[CMP_OUTPUT_CHN_MAX];// 电平模式下的起始电平（0或1）
        public short outGateTime[] = new short[CMP_OUTPUT_CHN_MAX];// 脉冲模式下的脉冲时间:单位ms
        public short errZone;// 进入比较点容差半径范围（pulse）

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("dimens", "axMask", "src", "outCnts", "outType", "outChnType", "outIndex", "outStLevel", "outGateTime", "errZone");
        }
    }

    /**
     * TPidPara 结构体
     */
    public static class TPidPara extends Structure {
        public float kp;// 增益系数
        public float ki;// 积分系数
        public float kd;// 微分系数
        public float kvff;// 速度前馈系数
        public int integralLimit;// 积分饱和极限
        public int derivativeLimit;// 微分饱和极限
        public short outLimit;// 输出饱和极限

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("kp", "ki", "kd", "kvff", "integralLimit", "derivativeLimit", "outLimit");
        }
    }

    /**
     * TDacMotor 结构体
     */
    public static class TDacMotor extends Structure {
        public short inverse;// 电压是否取反
        public short bias;// Dac零漂
        public short dacLmt;// Dac输出极限值

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("inverse", "bias", "dacLmt");
        }
    }

    /**
     * TAdvBufIoParam 结构体
     */
    public static class TAdvBufIoParam extends Structure {
        public short outType;// 输出类型，0：通用输出；1：Gate信号；其他保留
        public short outGroup;// 输出组，取值范围[0,n]
        public short outIndex;// 输出序号，取值范围[0,n]
        public short outSns;// 有效电平,0:低电平有效，1：高电平
        public short pulseMode;// 0：电平输出，1：脉冲输出
        public short reserved1;// 保留
        public int pulseOnTime;// 有效电平时间（脉冲输出方式下有效），单位：微秒
        public int pulseOffTime;// 无效电平时间（脉冲输出方式下有效），单位：微秒
        public byte reserved[] = new byte[32];// 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("outType", "outGroup", "outIndex", "outSns", "pulseMode", "reserved1", "pulseOnTime", "pulseOffTime", "reserved");
        }
    }

    /**
     * TScaraMechPara 结构体
     */
    public static class TScaraMechPara extends Structure {
        public double arm1Len;// 杆1长，单位是用户单位
        public double arm2Len;// 杆2长，单位是用户单位
        public double pitch;// Z轴的丝杆节距，单位是用户单位
        public double reserved[] = new double[16];// 保留，设置为0


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("arm1Len", "arm2Len", "pitch", "reserved");
        }
    }

    /**
     * TScaraJiontPara 结构体
     */
    public static class TScaraJiontPara extends Structure {
        public int encBits;// 关节的电机一圈的脉冲数
        public int zeroPulsePos;// 关节零点位置的脉冲位置
        public float posLmt;// 关节的正限位位置：单位 度
        public float negLmt;// 关节的负限位位置：单位 度
        public float ratio;// 减速比
        public float maxVel;// 最大关节速度  ：单位  °/s
        public float maxAcc;// 最大关节加速度: 单位 °/s^2
        public float reserved1;// 保留，设置为0
        public double reserved[] = new double[8];// 保留，设置为0
        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("encBits", "zeroPulsePos", "posLmt", "negLmt", "ratio", "maxVel", "maxAcc", "reserved1", "reserved");
        }
    }

    /**
     * TFlyFollowPara 结构体
     */
    public static class TFlyFollowPara extends Structure {
        public short masterAxNo;// 传输带轴号，0~N
        public short useEnc;// 使用编码器，0：规划，1：编码器
        public short dirReverse;// 传输轴方向取反。0：不取反，1：取反
        public short followedAxNo;// 跟随哪个轴，0:X，1:Y
        public double posCoe;// 传输轴当量和跟随轴的当量比例，跟随当量 / 传输轴当量
        public float followAng;// 跟随轴与传送带之间的夹角，单位：度
        public int reserved2[] = new int[15];// 保留，设置为0

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("masterAxNo", "useEnc", "dirReverse", "followedAxNo", "posCoe", "followAng", "reserved2");
        }
    }

    /**
     * TMvProtectPara 结构体
     */
    public static class TMvProtectPara extends Structure {
        public short crdNo[] = new short[2];// 需要干涉保护的两坐标系号
        public short crdAxNo[] = new short[2];// 坐标系的干涉轴号,指XYZ中哪一个（X:0  Y:1    Z:2）
        public short moveDir[] = new short[2];// 两干涉轴分别往距离减小时的运动方向，1：正向 -1：负向
        public int orgDis;// 两坐标系的crdAxNo轴在原点时的距离
        public int mvProtectDis; // 干涉的保护距离
        public int safeWaitPos;// mode为激光模式时，干涉轴需要停止到的等待位置（mode为0时无效）
        public double mvToSafeAcc;// 运动到等待位置的移动加速度
        public double mvToSafeVel;// 运动到等待位置的移动速度
        public short stopCrdNo;// mode为激光模式时，需要停止的坐标系号（mode为0时无效）
        public short reserved[] = new short[3];// mode为激光模式时，需要停止的坐标系号（mode为0时无效）

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("crdNo", "crdAxNo", "moveDir", "orgDis", "mvProtectDis", "safeWaitPos", "mvToSafeAcc", "mvToSafeVel", "stopCrdNo", "reserved");
        }
    }

    /**
     * TPackedCrdSts3 结构体
     */
    public static class TPackedCrdSts3 extends Structure {
        public short crdSts;// 坐标系状态
        public short axSts[] = new short[3];// 坐标系里各轴状态
        public int prfPos[] = new int[3];// 用户坐标系下的规划位置
        public int axisPos[] = new int[3];// 机械坐标系下的规划位置
        public int encPos[] = new int[3];// 编码器位置
        public int userSeg; // 运行的缓冲区段号
        public double prfVel;// 运动速度
        public int gpDi;// 通用输入0~31
        public int gpDo;// 通用输出0~31
        public short motDi[] = new short[3];// 限位、原点、报警。请参考专用IO位定义( 搜索 BIT_AXMTIO_LMTN )
        public short reserved;// 保留
        public int crdFreeSpace;// 缓冲区剩余空间
        public int reserved2;

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("crdSts", "axSts", "prfPos", "axisPos", "encPos", "userSeg", "prfVel", "gpDi", "gpDo", "motDi", "reserved", "crdFreeSpace", "reserved2");
        }
    }

    /**
     * TAxisStsPack8 结构体
     */
    public static class TAxisStsPack8 extends Structure {
        public int prfPos[] = new int[8];// 规划位置
        public int encPos[] = new int[8];// 实际位置
        public float prfVel[] = new float[8];// 规划速度
        public int motionIO[] = new int[8];// 轴专用IO
        public short sts[] = new short[8];// 轴状态
        public int gpo;// 通用输出
        public int gpi;// 通用输入
 

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("prfPos", "encPos", "prfVel", "motionIO", "sts", "gpo", "gpi");
        }
    }

    /**
     * TAxisStsPack12 结构体
     */
    public static class TAxisStsPack12 extends Structure {
        public int prfPos[] = new int[12];// 规划位置
        public int encPos[] = new int[12];// 实际位置
        public float prfVel[] = new float[12];// 规划速度
        public int motionIO[] = new int[12];// 轴专用IO
        public short sts[] = new short[12];// 轴状态
        public int gpo;// 通用输出
        public int gpi;// 通用输入


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("prfPos", "encPos", "prfVel", "motionIO", "sts", "gpo", "gpi");
        }
    }

    /**
     * TAutoRtnPackedSts 结构体
     */
    public static class TAutoRtnPackedSts extends Structure {
        public short mtSts[] = new short[12];// 单轴状态
        public short mtMio[] = new short[12];// 单轴专用IO
        public int mtPrfPos[] = new int[12];// 单轴规划位置
        public int mtEncPos[] = new int[12];// 单轴实际位置
        public float mtPrfVel[] = new float[12];// 单轴规划速度
        public short crdSts[] = new short[2];// 坐标系状态
        public float crdPrfVel[] = new float[2];// 坐标系运动速度
        public int crdUserSeg[] = new int[2];// 坐标系运行的缓冲区段号
        public int crdFreeSpace[] = new int[2];// 坐标系缓冲区剩余空间
        public int crdUsedSpace[] = new int[2];// 坐标系缓冲区使用空间
        public int gpi;// 通用输入
        public int gpo;// 通用输出
        public short reserved[] = new short[32];// 预留


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("mtSts", "mtMio", "mtPrfPos", "mtEncPos", "mtPrfVel", "crdSts", "crdPrfVel", "crdUserSeg", "crdFreeSpace", "crdUsedSpace", "gpi", "gpo", "reserved");
        }
    }

    /**
     * TCompHs1DimensParam 结构体
     */
    public static class TCompHs1DimensParam extends Structure {
        public short dirNo;// 编码器源（0~7），对应轴0~7的编码器。
        public short out1StLevel;// out1起始电平（0或1）
        public short out2StLevel;// out2起始电平（0或1）
        public short reserved;// 保留
        public int out1Width;// out1脉冲宽度，0~65535,单位us
        public int out2Width;// out2脉冲宽度，0~65535,单位us
        public int out2Delay;// out2延时，0~65535,单位us


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("dirNo", "out1StLevel", "out2StLevel", "reserved", "out1Width", "out2Width", "out2Delay");
        }
    }

    /**
     * T2DCompensationTable 结构体
     */
    public static class T2DCompensationTable extends Structure {
        public short count[] = new short[2];// Count[0]和Count[1]分别为X，Y方向的数据点数，每个方向最小2个
        public short reserved[] = new short[2];// 保留
        public int posBegin[] = new int[2];// posBegin[0]和posBegin[1]分别为X,Y方向的起始补偿位置
        public int step[] = new int[2];// step[0]和step[1]分别为XY方向的补偿步长
        public double angle;// 标定坐标系与机械坐标系的夹角，单位：度


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("count", "reserved", "posBegin", "step", "angle");
        }
    }

    /**
     * TCompData 结构体
     */
    public static class TCompData extends Structure {
        public int xDirComp;
        public int yDirComp;
        public int zDirComp;

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("xDirComp", "yDirComp", "zDirComp");
        }
    }

    /**
     * T2DCompensation 结构体
     */
    public static class T2DCompensation extends Structure {
        public short enable;// 启动或停止补偿
        public short tableIndex;// 使用的目录表：取值0
        public short axisType[] = new short[2];// 二维补偿表所使用的轴类型:0表示规划，1表示使用编码器
                                               //  axisType[0]对应X方向类型，axisType[1]对应Y方向类型
        public short axisIndex[] = new short[3];// axisIndex[0]表示X方向使用的轴号， axisIndex[1]表示Y方向使用的轴号 注：axisIndex[2]表示Z方向需要补偿的轴号


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("enable", "tableIndex", "axisType", "axisIndex");
        }
    }

    /**
     * TPvtPara 结构体
     */
    public static class TPvtPara extends Structure {
        public double smoothDec;// 停止减速度
        public double abruptDec;// 急停减速度，暂时保留
        public double reserved1[] = new double[2];// 保留
        public int dataMode;// 工作模式，1：数据驻存模式   0：数据刷新模式(默认模式)
        public int loopCount;// 循环次数 ：仅数据驻存模式下有效
        public int reserved2[] = new int[4];// 保留


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("smoothDec", "abruptDec", "reserved1", "dataMode", "loopCount", "reserved2");
        }
    }

    /**
     * TAdvCaptureParamEx 结构体
     */
    public static class TAdvCaptureParamEx extends Structure {
        public short capAxMask;// 指捕获的编码器位置源掩码
        public short trigSrc;// 触发信号类型,见上面的定义。（默认：CAPT_EX_SRC_GPI）
        public short trigIndex;// 触发源序号。（默认0）
        public short trigLev;// 触发电平，0：上升，1：下降沿
        public short filter;// 滤波时间常数,单位:微秒,取值范围[0,255]
        public short reserved[] = new short[3];// 保留
        public int reserved2[] = new int[8];// 保留


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("capAxMask", "trigSrc", "trigIndex", "trigLev", "filter", "reserved", "reserved2");
        }
    }

    /**
     * 原生库接口
     */
    private interface NativeLib extends Library {
        NativeLib INSTANCE = Native.load("nmc_lib20", NativeLib.class);
//------------------------------------------------------------------------------------------------------------
//
//	1.设备高级配置等
//
//------------------------------------------------------------------------------------------------------------

// 设置通讯参数,默认值为10000us*1000
// devHandle : 设备句柄
// waitTimeInUs：等待时间,微秒
// retryTimes： 通讯重试次数
        short NMC_SetCommPara(HAND devHandle, NativeLong waitTimeInUs, NativeLong retryTimes);
        
// 板卡打开（根据名称）
// idStr: 板卡ID字符串, 可通过指令写入。pDevHandle: 返回设备操作句柄
// 注：ID号用户可写入,掉电不丢失,可用于区分板卡。出厂板卡号ID号为0
        short NMC_DevOpenByID(byte[] idStr, PHAND pDevHandle);

// 板卡打开（根据IP地址）
// pIPv4Array: 板卡IP地址,四个字节,例如：unsinged char ipv4[4] = {192,168,1,110};
// pDevHandle: 返回设备操作句柄
        short NMC_DevOpenByIP(byte[] pIPv4Array, PHAND pDevHandle);
       
// 修改板卡ID号
// pIdStr: 要写入的板卡ID字符串,最长16字节,以\0结尾
// 注：修改ID号完成后,板卡要掉电重启,新的ID才有效。
        short NMC_DevWriteID(HAND devHandle, byte[] pIdStr);

// 读取板卡ID号
// pIdStr: 存储字符串的数组,数组长度大于16字节
		short NMC_DevReadID(HAND devHandle, byte[] pIdStr);
       
// 读取库的版本
// pVersion：接收版本信息
// example(c):
//          char dllVersion[128];
//          NMC_GetDllVersion(dllVersion);
		short NMC_GetDllVersion(byte[] pVersion);

// 读取当前运动控制器固件的版本等信息
// devHandle : 设备句柄
// pVersion：版本信息
        short NMC_GetMtLibVersion(HAND devHandle, TMtLibVersion pVersion);
        
// 读取当前运动控制器信息
        short NMC_GetCardInfo(HAND devHandle, TCardInfo pInfo);
        
// 读取当前运动控制器信息
        short NMC_GetCardInfoEx(HAND devHandle, TCardInfoEx pInfo);
        
// 检查PCIe卡的驱动顺序是否正常
// instCardNum:返回系统安装的卡数量
// 返回0表示安装顺序正常，返回1表示不正常，通常为刚安装完驱动或者硬件有更改，重启windows即可
        short NMC_DevIndexCheck(IntByReference instCardNum);
        
// 启动指令调试
// enable:0关闭调试信息,默认关闭,1:打开通讯的debug输出；2:打印到文件；3：打印输出到GCS;4:打印到DebugView
// debugOutputFile:调试输出文件，仅在enable=2时需要
        short NMC_SetCmdDebug(short enable, byte[] debugOutputFile);
        
// 获取错误代码信息
// errCode:错误代码
// errDesc:返回的错误代码描述
        short NMC_GetErrDesc(short errCode, byte[] errDesc);
        
// 加载配置文件
        short NMC_LoadConfigFromFile(HAND devHandle, byte[] pFilePath);
        
// 保存为配置文件
        short NMC_SaveConfigToFile(HAND devHandle, byte[] pFilePath);
        
// 保存基本的配置信息,将这些信息保存到系统参数区,控制器重启或者NMC_DevReset后,系统将使用这些参数
// 保存的参数包括报警、限位、脉冲方式、编码器方式、安全参数、滤波参数
// enable:1表示保存当前配置,并使能自动加载参数功能,0：表示关闭自动加载参数功能
        short NMC_SaveMotionConfig(HAND devHandle, short enable);
        
// 获取平台版本号
        short NMC_GetVersion(HAND devHandle, byte[] verArray);
        
// 获取控制器功能信息 example : char flags[1024];NMC_DevGetMcInfoFlag(g_hDev,flags);
        short NMC_DevGetMcInfoFlag(HAND devHandle, byte[] flags);
        
// 获取控制器状态，按位表示
        short NMC_DevGetSts(HAND devHandle, NativeLong sts);

//------------------------------------------------------------------------------------------------------------
//
//	2.单轴配置读写
//
//------------------------------------------------------------------------------------------------------------   

// 获取轴规划模式
// pMode：返回轴运动模式
        short NMC_MtGetPrfMode(HAND axisHandle, ShortByReference pMode);
        
// 获取Ptp参数
// pAxPara：参数
        short NMC_MtGetPtpPara(HAND axisHandle, TPtpPara pAxPara);
        
// 获取Jog参数
// pAxPara：参数
        short NMC_MtGetJogPara(HAND axisHandle, TJogPara pAxPara);
        
// 获取目标运动速度
// pVel: 目标速度（最大速度）,单位是 脉冲/ms
        short NMC_MtGetVel(HAND axisHandle, DoubleByReference pVel);
        
// 获取目标运动位置,只针对PTP
// pPos: 目标位置,单位是 脉冲
        short NMC_MtGetPtpTgtPos(HAND axisHandle, NativeLongByReference pPos);
        
// 读编码器通道位置
// devHandle : 控制器句柄
// encId: 编码器ID,取值范围[0,n]
// pPos:返回编码器数值
        short NMC_GetEncPos(HAND devHandle, short encId, NativeLongByReference pPos);
        
// 写编码器通道位置
// devHandle : 控制器句柄
// encId: 编码器ID,对于轴编码器通道,取值范围[0,n]
//				  对于扩展编码器通道,256表示第一个扩展编码器通道,257表示第二个,以此类推
// encPos:编码器数值
        short NMC_SetEncPos(HAND devHandle, short encId, NativeLong encPos);
        
// 设置允许的位置误差,当位置误差超过设定值时,电机停止运动,提示位置误差超限
// posErr为0表示不检查
        short NMC_MtSetPosErrLmt(HAND axisHandle, NativeLong posErr);
        
// 读取允许的位置误差设定值
        short NMC_MtGetPosErrLmt(HAND axisHandle, NativeLongByReference pPosErr);
        
// 读取编码器模式
// encId: 编码器ID,对于轴编码器通道,取值范围[0,n]
//				  对于扩展编码器通道,256表示第一个扩展编码器通道,257表示第二个,以此类推
// encMode:返回编码器模式,参考宏定义
        short NMC_GetEncMode(HAND devHandle, short encId, ShortByReference encMode);
        
// 读取限位开关输入是否停止运动
// posEn：正向限位触发允许设置,1为允许,0为禁止
// negEn: 负向限位触发允许设置
        short NMC_MtGetLmtOnOff(HAND axisHandle, ShortByReference pPosSwt, ShortByReference pNegSwt);
        
// 读取限位开关触发电平
// posSwt：正向限位触发电平设置,1为高电平触发,0为低电平触发
// negSwt: 负向限位触发电平设置
        short NMC_MtGetLmtSns(HAND axisHandle, ShortByReference pPosSwt, ShortByReference pNegSwt);
        
// 读取伺服报警开关是否停止运动
// swt：伺服报警开关输入允许设置,1为允许,0为禁止。（默认为高电平触发）
        short NMC_MtGetAlarmOnOff(HAND axisHandle, ShortByReference pSwt);
        
// 读取伺服报警开关电平
// swt：伺服报警触发电平设置,1为高电平触发,0为低电平触发
        short NMC_MtGetAlarmSns(HAND axisHandle, ShortByReference pSwt);
        
// 读取软件限位是否停止运动
// enable：软件限位触发允许设置,1为允许,0为禁止
        short NMC_MtGetSwLmtOnOff(HAND axisHandle, ShortByReference pSwt);
        
// 读取软件限位数值
// posLmt：正向软件限位设置值
// negLmt：负向软件限位设置值。单位为脉冲数
        short NMC_MtGetSwLmtValue(HAND axisHandle, NativeLongByReference pPosLmt, NativeLongByReference pNegLmt);
        
//  读取轴安全参数
        short NMC_MtGetSafePara(HAND axisHandle, TSafePara pPara);
        
// 读取脉冲输出模式
// pInv, 1：取反,0：不取反
// pMode 0：脉冲方向 1：正负脉冲
        short NMC_MtGetStepMode(HAND axisHandle, ShortByReference pInv, ShortByReference pMode);
        
// 读取轴速度滤波参数
        short NMC_MtGetAxisVelFilter(HAND axisHandle, ShortByReference pFilterCoef);
        
// 读取回零参数
// pHomePara: 回零参数结构,参考结构定义
        short NMC_MtGetHomePara(HAND axisHandle, THomeSetting pHomePara);

//------------------------------------------------------------------------------------------------------------
//
//	3.单轴高级指令
//
//------------------------------------------------------------------------------------------------------------

// 读取机械坐标的位置
// pPos : 返回位置,单位是 脉冲
        short NMC_MtGetAxisPos(HAND axisHandle, NativeLongByReference pPos);
        
// 读取机械坐标的位置
// pPos : 返回位置,单位是 脉冲
        short NMC_MtGetCmdPos(HAND axisHandle, NativeLongByReference pPos);
        
// 设定机械位置, 轴静止时执行,如果后面是update指令,需要延时一个周期
// axisPos: 设定机械位置值
// 注：只能在轴静止时使用
        short NMC_MtSetAxisPos(HAND axisHandle, NativeLong axisPos);
        
// 设定编码器位置, 轴静止时执行,如果后面是update指令,需要延时一个周期
// encPos: 设定编码器位置值
// 注：只能在轴静止时使用
        short NMC_MtSetEncPos(HAND axisHandle, NativeLong encPos);
        
// 设置单轴规划高级参数
// axisHandle : 轴句柄
// mapAxisNo：轴号,取值范围[0,n]
// port：端口号,取值范围[0,1],默认为0
// startPos：偏置,默认为0
// pCrdHandle：坐标系组句柄
        short NMC_MtPrfConfig(HAND axisHandle, short mapAxisNo, short port, NativeLong startPos);
        
// 读取单轴规划高级参数
        short NMC_MtGetPrfConfig(HAND axisHandle, ShortByReference mapAxisNo, ShortByReference port, NativeLong startPos);
        
// 设置单轴比例系数
// axisHandle : 轴句柄
// inCoe：单轴比例系数,取值范围(0,1]
        short NMC_MtSetPrfCoe(HAND axisHandle, double inCoe);
        
// 读取单轴比例系数
// axisHandle : 轴句柄
// pInCoe：单轴比例系数,取值范围(0,1]
        short NMC_MtGetPrfCoe(HAND axisHandle, DoubleByReference pInCoe);
        
// 设置轴通道编码器的系数,默认为1
// axisHandle : 轴句柄
// encCoe：单轴通道编码器比例系数,取值范围(0,1]
        short NMC_MtSetEncCoe(HAND axisHandle, double encCoe);
        
// 读取轴通道编码器的系数
// axisHandle : 轴句柄
// pEncCoe：比例系数,取值范围(0,1]
        short NMC_MtGetEncCoe(HAND axisHandle, DoubleByReference pEncCoe);
        
// 设置轴的到位误差参数
// axisHandle : 轴句柄
// arrivalBand: 到位误差,单位Pulse 取值大于0
// stableTime: 到位保持时间,单位 ms 取值大于0
        short NMC_MtSetAxisArrivalPara(HAND axisHandle, NativeLong arrivalBand, NativeLong stableTime);
        
// 获取轴的到位误差参数
// axisHandle : 轴句柄
// pArrivalBand:到位误差,单位Pulse 
// pStableTime：到位保持时间,单位 ms
        short NMC_MtGetAxisArrivalPara(HAND axisHandle, NativeLongByReference pArrivalBand, NativeLongByReference pStableTime);
        
// 设置螺距误差补偿参数
// num：补偿的段数,取值范围[2,128]
// startPos：补偿起始位置，终止位置为 startPos + cmpLen
// cmpLen:补偿长度
// pCompPos:正向补偿值
// pCompNeg:负向补偿值
        short NMC_MtSetLeadScrewCompPara(HAND axisHandle, short num, NativeLong startPos, NativeLong cmpLen, short[] pCompPos, short[] pCompNeg);
        
// 使能或禁止螺距位置补偿
        short NMC_MtEnableLeadScrew(HAND axisHandle, short enable);
        
// 设置反向间隙补偿
// compValue： 补偿量
// compDelta： 周期补偿量，比如补偿量为100，周期补偿量为10，则反向补偿会在10个规划周期完成100个脉冲的补偿
// compDir：	 补偿方向,0:负向补偿，往负向运动时叠加补偿量，1：正向补偿，往正向运动时叠加补偿量
        short NMC_MtSetBacklash(HAND axisHandle, NativeLong compValue, double compDelta, NativeLong compDir);
        
// 获取反向间隙补偿
        short NMC_MtGetBacklash(HAND axisHandle, NativeLongByReference pCompValue, DoubleByReference pCompDelta, NativeLongByReference pCompDir);
        
// 设置单轴急停DI
// gpiIndex：通用输入序号,[0,]，设置为-1，则表示取消急停DI
// sense :触发电平,0：低电平,1：高电平
        short NMC_MtSetEstopDI(HAND axisHandle, short gpiIndex, short sense);
        
// 读取单轴急停DI
// gpiIndex：通用输入序号,[0,]
// sense :触发电平,0：低电平,1：高电平
        short NMC_MtGetEstopDI(HAND axisHandle, ShortByReference gpiIndex, ShortByReference sense);
        
// 设置单轴急停DI Mask,可以配置多个急停DI
// gpiMask：通用输出的位掩码
// senseMask :触发电平的位掩码，对应位,0：低电平,1：高电平
        short NMC_MtSetEstopDIMask(HAND axisHandle, NativeLong gpiMask, NativeLong senseMask);
        
// 读取单轴急停DI Mask,可以配置多个急停DI
// gpiMask：通用输出的位掩码
// senseMask :触发电平的位掩码，对应位,0：低电平,1：高电平
        short NMC_MtGetEstopDIMask(HAND axisHandle, NativeLongByReference pGpiMask, NativeLongByReference pSenseMask);
        
// 设置单轴急停DI,触发后会置起BIT_AXIS_ESTP标志位
// 注意:单轴高级急停触发后，规划位置与实际位置可能存在差值
// pParam:高级急停参数
// group:通道号，取值[0,ESTOP_DI_EX_CH_NUM-1]
        short NMC_SetEstopDIEx(HAND devHandle, TEstopExParam pParam, short group);
        
// 读取单轴急停DI
        short NMC_GetEstopDIEx(HAND devHandle, TEstopExParam pParam, short group);
        
// 缓冲区高级急停IO启动关闭
// onOff:1-启用高级急停IO，0-关闭高级急停IO
// group:通道号，取值[0,ESTOP_DI_EX_CH_NUM-1]
        short NMC_CrdBufEstopDIExOnOff(HAND crdHandle, NativeLong segNo, short onOff, short group);
        
// 清除高级单轴急停DI
        short NMC_ClrEstopDIEx(HAND devHandle, short group);
        
// 设置高级捕获参数,并启动捕获
// pParam:参数
// ch：高级捕获通道号,[0~3]
        short NMC_MtSetAdvCaptParam(HAND devHandle, TAdvCaptureParam pParam, short ch);
        
// 清除高级捕获状态,并取消该通道的捕获
// ch：高级捕获通道号,[0~3]
        short NMC_MtClrAdvCaptSts(HAND devHandle, short ch);
        
// 读取高级捕获状态
// captSts:捕获状态,bit0表示设置的信号前沿触发到,bit1表示信号的后沿触发到。
// pPosArray : 返回位置,在触发到时,位置为捕获到的位置值。
//				pPosArray[0]:信号前沿触发位置,pPosArray[1]:信号后沿触发位置,单位:脉冲
        short NMC_MtGetAdvCaptPos(HAND devHandle, ShortByReference captSts, NativeLong[] pPosArray, short ch);
        
// 设置轴补偿参数
// enable: 0:取消 1：使能
// para1: 参数1，数值范围在（10~500）,建议先从大到小进行设置测试
// para2: 参数2，数值为控制频率HZ
        short NMC_MtSetAxisDampCompParam(HAND axisHandle, short enable, short param1, short param2);
        
// 设置越限报警的动作
// actionsBits:轴越限报警后的处理方法，按位表示，默认为0，即只置起轴超限标志位
//		bit0:关闭使能
//		bit1:停止轴运动
//		其他保留
        short NMC_MtSetPosErrAction(HAND axisHandle, short actionsBits);
        
// 读取越限报警的动作
        short NMC_MtGetPosErrAction(HAND axisHandle, ShortByReference pActionsBits);

//------------------------------------------------------------------------------------------------------------
//
//	4.缓冲区高级指令
//
//------------------------------------------------------------------------------------------------------------
   
// 设置坐标系扩展参数 
// extCrdPara:坐标系扩展参数,参考坐标系运动：扩展参数’TExtCrdPara结构体定义
        short NMC_CrdSetExtPara(HAND crdHandle, TExtCrdPara extCrdPara);
        
// 设置前瞻参数
// lkhPara:前瞻相关的参数
        short NMC_CrdSetLookaheadPara(HAND crdHandle, TLookaheadPara lkhPara);
        
// 设置坐标系的起跳速度
// startVel:起跳速度
        short NMC_CrdSetStartVel(HAND crdHandle, double startVel);
        
// 四轴直线插补,使用双精度脉冲单位
// segNo:段号；
// endVel:终点速度;vel:最大速度,单位:pulse/ms
// synAcc:合成加速度,单位:pulse/ms*ms
// crdAxMask:参与的轴,按位表示
// pTgPosArray：目标位置数组,单位:pulse
// lookaheadDis:是否使用前瞻,0：使用前瞻,则控制器自动计算终点速度,1：禁用前瞻,使用设定的终点速度（endVel）
        short NMC_CrdLineDbXYZA(HAND crdHandle, NativeLong segNo, short mask, double[] pTgPosArray, double endVel, double vel, double synAcc, short lookaheadDis);
        
// 获取前瞻参数
// lkhPara:前瞻相关的参数
// defaultFlag:1表示获取默认值，0表示获取当前值
        short NMC_CrdGetLookaheadPara(HAND crdHandle, TLookaheadPara lkhPara, short defaultFlag);
        
// 设置坐标系运动缓冲区是否启用,NMC_CrdConfig后默认为启用状态
// enFlag:启用,1：启动,0：不启用
// 注意：如果不想使用坐标系运动缓冲区,请在NMC_CrdConfig之后调用该指令
        short NMC_EnableCrdSdram(HAND crdHandle, short enFlag);
        
// 读取坐标系扩展参数
// extCrdPara:坐标系扩展参数
        short NMC_CrdGetExtPara(HAND crdHandle, TExtCrdPara extCrdPara);
        
// 设置圆弧插补参数（高级指令）
// pSetting : 设置
        short NMC_CrdSetArcSecPara(HAND crdHandle, TArcSecSetting pSetting);
        
// 读圆弧插补参数（高级指令）
        short NMC_CrdGetArcSecPara(HAND crdHandle, TArcSecSetting pSetting);
        
// 设置坐标系参数(必须)
// pCrdPara:坐标系参数
        short NMC_CrdSetPara(HAND crdHandle, TCrdPara pCrdPara);
        
// 读取插补坐标系系统配置信息
// pConfig:返回坐标系配置,参考结构体定义
        short NMC_CrdGetConfig(HAND crdHandle, TCrdConfig pConfig);
        
// 获取坐标系参数
// pCrdPara:坐标系参数
        short NMC_CrdGetPara(HAND crdHandle, TCrdPara pCrdPara);
        
// 获取坐标系速度倍率
// overRide：坐标系速度倍率
        short NMC_CrdGetOverRide(HAND crdHandle, DoubleByReference pOverRide);
        
// 读取内部坐标系状态
// pStsWord：返回状态字,定义64bits(二维的long数组),便于后续扩展状态位
        short NMC_CrdGetInnerSts(HAND crdHandle, NativeLongByReference pStsWord);
        
// 直接修改坐标系偏移
// pOffsetArray:坐标系偏移
// cnt:数组长度
        short NMC_CrdModifyOffset(HAND crdHandle, NativeLong[] pOffsetArray, short cnt);
        
// 缓冲区设置急停DI
// axis:轴号,取值范围[0,n)
// gpiIndex:通用输入序号
// sense:触发电平
        short NMC_CrdBufSetEstopDI(HAND crdHandle, NativeLong segNo, short axis, short gpiIndex, short sense);
        
// 打包插补数据
// pBufData 插补数据结构存储数组
// dataLen 数据长度
// 压入数据时，先压入指令字，然后再压入指令字对应的工作数据，总的数据长度不超过1000个字节
        short NMC_CrdBufDataPack(HAND crdHandle, byte[] pBufData, short dataLen);
        
//功能：缓冲区探位置停止并后续加位置偏置
// useCaptPos：是否使用捕获位置  1使用,0不使用
// axis:轴序号
// sense:触发电平,0：低电平,1：高电平
// gpiIndex:通用输入序号
        short NMC_CrdBufSetStopOffset(HAND crdHandle, NativeLong segNo, short axis, short gpiIndex, short sense, short useCaptPos);
        
//功能：解除缓冲区探位置停止并后续加位置偏置
        short NMC_CrdBufClrStopOffset(HAND crdHandle, NativeLong segNo, short axis);
        
// 设置是否计算所有线段长度
        short NMC_CrdSetBufLengthFlag(HAND crdHandle, short flag);
        
// 读取插补线段长度
        short NMC_CrdGetBufLength(HAND crdHandle, DoubleByReference pLen);
        
        short NMC_CrdSetIsShortLine(HAND crdHandle, short isShortLine);
        
        short NMC_CrdSetLookAheadCentriAcc(HAND crdHandle, short isUsingSetAcc, double centriAcc);

//------------------------------------------------------------------------------------------------------------
//
//	5.硬件捕获及不常用指令
//
//------------------------------------------------------------------------------------------------------------

// 设置捕获有效电平
// mode : 模式选择,参考宏定义
// ioSrc：IO输入源选择,参考宏定义
// level: 触发沿。bit0:index电平（0为下降沿,1为上升沿）,bit1:IO电平
        short NMC_MtSetCaptSns(HAND axisHandle, short mode, short ioSrc, short level);
        
// 读取捕获有效电平
// mode : 模式选择,参考宏定义
// ioSrc：IO输入源选择,参考宏定义
// level: 触发沿。0为下降沿,1为上升沿
        short NMC_MtGetCaptSns(HAND axisHandle, ShortByReference pMode, ShortByReference pIoSrc, ShortByReference pLevel);
        
// 设置启动捕获
// 注：捕获触发标志在轴状态字里。
        short NMC_MtSetCapt(HAND axisHandle);
        
// 清除轴的捕获状态
        short NMC_MtClrCaptSts(HAND axisHandle);
        
// 读捕获位置
// pPos : 返回位置,单位:脉冲
        short NMC_MtGetCaptPos(HAND axisHandle, NativeLongByReference pPos);
        
// 读取脉冲输出滤波
// pCoe系数： 范围0~65535,0不滤波,数值越大滤波效果越明显。默认值为0
        short NMC_MtGetStepFilter(HAND axisHandle, ShortByReference pCoe);
        
// 多轴同时启动
// axisHandle:任意轴
// axisMask：按bit对应相应轴号,bit为1表示启动,bit为0表示不启动
        short NMC_MtUpdateMulti(HAND axisHandle, NativeLong axisMask);
        
// 多轴同时停止
// axisHandle:任意轴
// axisMask：按bit对应相应轴号,bit为1表示启动,bit为0表示不启动
        short NMC_MtStopMulti(HAND axisHandle, NativeLong axisMask);
        
// 按位设置通用输入信号取反
// bitIndex:取值范围[0,n],位序号,前64位为本地的通用输入,大于64为扩展Di
// revs:是否取反,1：取反,0：不取反
        short NMC_SetDIBitRevs(HAND devHandle, short bitIndex, short revs);
        
// 按位读取通用输入信号取反
// bitIndex:取值范围[0,n],位序号,前64位为本地的通用输入,大于64为扩展Di
// pRevs:是否取反,1：取反,0：不取反
        short NMC_GetDIBitRevs(HAND devHandle, short bitIndex, ShortByReference pRevs);
        
// 按位设置通用输出信号取反
// bitIndex:取值范围[0,n],位序号,前64位为本地的通用输出,大于64为扩展Do
// revs:是否取反,1：取反,0：不取反
        short NMC_SetDOBitRevs(HAND devHandle, short bitIndex, short revs);
        
// 按位读取通用输出信号取反
// bitIndex:取值范围[0,n],位序号,前64位为本地的通用输出,大于64为扩展Do
// pRevs:是否取反,1：取反,0：不取反
        short NMC_GetDOBitRevs(HAND devHandle, short bitIndex, ShortByReference pRevs);
        
// DO输出持续设定时间后翻转
// bitIndex:取值范围[0,n],位序号,前64位为本地的通用输出,大于64为扩展Do
// value:设置通用数字量输出。1, 输出高电平,0,输出低电平
// reverseTime:持续的电平,单位:毫秒
        short NMC_SetDOBitAutoReverse(HAND devHandle, short bitIndex, short value, short reverseTime);
        
// 增加一组映射，映射关系目前最多存在DIO_MAP_MAX_NUM组
        short NMC_SetDioMapping(HAND devHandle, TDioMappingCfg[] pDioCfg);
        
// 获取所有的DIO映射数据
// pDioCfg：映射数据数组,目前为DIO_MAP_MAX_NUM组
        short NMC_GetAllDioMapping(HAND devHandle, TDioMappingCfg[] pDioCfg);
        
// 清除所有的DIO映射关系
        short NMC_ClrAllDioMapping(HAND devHandle);

//------------------------------------------------------------------------------------------------------------
//
//	6.平台相关指令
//
//------------------------------------------------------------------------------------------------------------
// 
// 设置通用可寻址变量 8字节数据类型（可涵盖常用的类似,如：char/short/long/double 等）
        short NMC_SetVar8B(HAND devHandle, NativeLong varID, Long value);
        
// 读取通用可寻址变量 8字节数据类型（可涵盖常用的类似,如：char/short/long/double 等）
        short NMC_GetVar8B(HAND devHandle, NativeLong varID, NativeLongByReference pValue);
        
// 设置通用可寻址系统变量 8字节数据类型（可涵盖常用的类似,如：char/short/long/double 等）
        short NMC_SysSetVar8B(HAND devHandle, NativeLong varID, Long value);
        
// 读取通用可寻址系统变量 8字节数据类型（可涵盖常用的类似,如：char/short/long/double 等）
        short NMC_SysGetVar8B(HAND devHandle, NativeLong varID, Long pValue);
        
//向备份内存写数据(总长度约1500byte)
//src: 要写入的数据
//len: 要写入的长度,单位：byte
//off: 要写入的地址(偏移量)
// 注：1)写入的数据掉电不丢失。
//     2)一次最多写1440字节。总长度约1500byte
        short NMC_BackSramWrite(HAND devHandle, byte[] src, NativeLong len, NativeLong off);
        
//从备份内存读数据
//dst: 读出的数据暂存区
//len: 要读出的长度,单位：byte,一次最多读1440字节。总长度约1500byte
//off: 读数据的地址(偏移量)
        short NMC_BackSramRead(HAND devHandle, byte[] dst, NativeLong len, NativeLong off);
        
// 读时间
// pTime ：返回时间结构,参考 TNMCTime 结构定义
// 注：时间在出厂时根据实际时间设定,用户不可通过指令修改
        short NMC_GetTime(HAND devHandle, TNMCTime pTime);
        
// 写时间
// pTime ：时间结构,参考 TNMCTime 结构定义
// pPassword : 控制器系统密码,长度最多为16个字节
        short NMC_SetTime(HAND devHandle, TNMCTime pTime, byte[] pPassword);
        
// 修改控制器系统密码,密码用于修改系统时钟等
// pPasswordOld : 控制器系统当前密码,长度最多为15个字符
// pPasswordNew : 新的控制器系统密码,长度最多为15个字符
// 注意：1.初始出厂无密码
//            2.修改密码后,请务必记住新的密码。忘记密码只能返厂复位。
//            3.密码大小写敏感
        short NMC_ChangePassword(HAND devHandle, byte[] pPasswordOld, byte[] pPasswordNew);
        
// 验证系统密码
// pPassword : 控制器系统当前密码,长度最多为15个字符
// 返回0表示验证通过,其他表示错误
        short NMC_VerifyPassword(HAND devHandle, byte[] pPassword);
        
// 清除系统密码及用户密码
// pData:解密数据，长度为8
        short NMC_ClrPassword(HAND devHandle, ShortByReference pData);
        
// 读设备唯一序列号
// pUID ：返回设备唯一序列号,为四个Int32的数据
// example:unsigned long devID[4];
//         NMC_GetUID(g_hDev,devID);
        short NMC_GetUID(HAND devHandle, NativeLong pUID);
        
// 写用户参数
// add ：参数区的偏移地址(字节地址)
// len : 写入长度,单位：byte
// pWrData ：要写入的数据；
// 注：1)写入的数据掉电不丢失。
//     2)一次最多写256字节。参数区总长度为2048字节。
//     3)此指令比其它指令操作时间会长,如果出现通讯错误（返回-1）,则需要将通过NMC_SetCommPara延长指令通讯时间
        short NMC_UserParaWr(HAND devHandle, NativeLong add, NativeLong len, byte[] pWrData);
        
// 读用户参数
// add ：参数区的偏移地址(字节地址)
// len : 写入长度,单位：byte
// pRdData ：要读取的数据存储
// 注：一次最多读256字节。参数区总长度为2048字节。（参考函数 ： NMC_UserParaWr）
        short NMC_UserParaRd(HAND devHandle, NativeLong add, NativeLong len, byte[] pRdData);
        
// 写扩展用户参数
// add ：参数区的偏移地址(字节地址)
// len : 写入长度,单位：byte
// pWrData ：要写入的数据；
// 注：1)写入的数据掉电不丢失。
//     2)一次最多写1000字节。参数区总长度为32K字节。
//     3)此指令比其它指令操作时间会长,如果出现通讯错误（返回-1）,则需要将通过NMC_SetCommPara延长指令通讯时间
        short NMC_UserParaWrEx(HAND devHandle, NativeLong add, NativeLong len, byte[] pWrData);
        
// 读扩展用户参数
// add ：参数区的偏移地址(字节地址)
// len : 写入长度,单位：byte
// pRdData ：要读取的数据存储
// 注：一次最多读1000字节。参数区总长度为32K字节。（参考函数 ： NMC_UserParaWr）
        short NMC_UserParaRdEx(HAND devHandle, NativeLong add, NativeLong len, byte[] pRdData);
        
// 读取当前备份的变量数值（断电自动保存）
// pBackVar : 备份的变量值,参考结构体定义
        short NMC_GetBackedVarGroup1(HAND devHandle, TBackGroup1 pBackVar);
        
// 读取当前备份的变量数值（断电自动保存）
// pBackVar : 备份的变量值,参考结构体定义
        short NMC_GetBackedVarGroup2(HAND devHandle, TBackGroup2 pBackVar);
        
// 开始或者关闭变量的自动备份（断电自动保存,默认为关闭状态）
// en:是否开启,1：开启变量的自动备份,0：停止变量的自动备份
        short NMC_SetBackedVarOnOff(HAND devHandle, short en);
        
// 读取当前自动备份的开启状态
// pEn:当前的开启状态
        short NMC_GetBackedVarOnOff(HAND devHandle, ShortByReference pEn);
        
// 读取系统参数（long 型）
// paraID :　系统参数ID,参见后面定义。pValue : 返回值
// 注：此函数可用于设置板卡上的扩展资源
        short NMC_DevGetPara(HAND devHandle, NativeLong paraID, NativeLongByReference pValue);
        
// 设置系统参数（long 型）
// paraID :　系统参数ID,参见后面定义。value : 设置值
// 注：此函数可用于读取板卡上的扩展资源
// 注：IP地址等参数写成功后,需要调用NMC_DevSetPara(devHandle,PARA_WRITE_EN,1)才能使得写下去的参数保存
// 注：IP地址等参数写成功后,将在控制器重新启动后生效
        short NMC_DevSetPara(HAND devHandle, NativeLong paraID, NativeLong value);
        
// 设置用户密码
// pUserName    : 指定的用户名,目前只支持"USER1"
// pPasswordOld : 该用户的当前密码,长度最多为15个字符
// pPasswordNew : 新的该用户的密码,长度最多为15个字符
// 注意：1.初始出厂无密码,一旦设置密码,则必须要登陆后,控制器某些指令才能正常工作（包括启动运动指令,设置DO输出指令）
//      2.修改密码后,请务必记住新的密码。忘记密码只能返厂复位。
//      3.密码大小写敏感
        short NMC_UserSetPassword(HAND devHandle, byte[] pUserName, byte[] pPasswordOld, byte[] pPasswordNew);
        
// 用户登陆,注意：NMC_DevReset将复位登录状态
// pUserName    : 指定的用户名,目前只支持"USER1"
// pPassword    : 该用户的密码
        short NMC_UserLogin(HAND devHandle, byte[] pUserName, byte[] pPassword);
        
// 用户退出登陆
// pUserName    : 指定的用户名,目前只支持"USER1"
        short NMC_UserLogout(HAND devHandle, byte[] pUserName);
        
// 设置控制器的规划周期，默认1000
// period：单位us	只能为250 500 1000
// 注意：1.规划周期设置后立即生效，只能在控制器启动时配置
//       2.NMC_DevReset会复位规划周期为默认值
        short NMC_SetProfilePeriod(HAND devHandle, short period);
        
// 获取控制器的规划周期
// period：单位us	只能为250 500 1000
        short NMC_GetProfilePeriod(HAND devHandle, ShortByReference pPeriod);
        
// 打印信息
        short NMC_UserPrint(byte[] msg);
        
// 获取输出信息
        short NMC_DevGetOutputMsg(HAND devHandle, byte[] szBuf, short maxLen, ShortByReference pGetLen);

//------------------------------------------------------------------------------------------------------------
//
//	7.数据采集模块(高级指令)
//
//------------------------------------------------------------------------------------------------------------

// 获取需要采集数据变量的地址
//  index:变量的序号(从0开始)
//  type: 变量的类型,参数‘Collect模块：变量类型’宏定义
//  pAddr: 返回的数据地址
// pDataLen: 返回的该数据长度
        short NMC_GetCollectDataAddr(HAND devHandle, short index, short dataType, NativeLongByReference pAddr, ShortByReference pDataLen);
        
// 配置采集数据通道,需要配置对应结构体参数
// pCollect:采集模块配置
// pTrig:采集模块触发方式配置
        short NMC_ConfigCollect(HAND devHandle, TCollectCfg pCollect, TCollectTrig pTrig);
        
// 启动或停止数据采集
// en：1启动 0停止
        short NMC_CollectOnOff(HAND devHandle, short en);
        
// 获取采集状态:
// pSts：采集状态,按位表示各自状态,参考‘Collect模块：采集状态’宏定义
// pDataLen: 采集的数据量
        short NMC_GetCollectSts(HAND devHandle, ShortByReference pSts, NativeLongByReference pDataLen);
        
// 获取采集数据:
// len：采集数据长度（单位：char,一次最多读1440字节）
// pData: 采集的数据（均以char为单元存储）
        short NMC_GetCollectData(HAND devHandle, short len, byte[] pData);
        
// 清除采集状态
        short NMC_ClearCollectSts(HAND devHandle);

//------------------------------------------------------------------------------------------------------------
//
//	8.激光
//
//------------------------------------------------------------------------------------------------------------

//设置激光控制的模式。该模式的设定,约束相应指令的功能和操作
//mode: 激光控制模式,参考上述宏定义
        short NMC_LaserSetMode(HAND devHandle, short mode, short ch);
        
// 激光物理信号输出类型配置
// outputType：输出的类型
// index :输出通道序号,取值范围[0,n]
// optionVal: 当作为占空比输出时,该值为PWM的频率,单位HZ；
//            当为LASER_PWM_FRQ时,该值作为占空比值,（0~100）；
//            当为LASER_PWM_FRQ_EXT时,该值为脉宽,单位为0.5微秒,取值范围(0,~)
// ch :激光通道,取值范围[0,n]
        short NMC_LaserSetOutputType(HAND devHandle, short outputType, short index, NativeLong optionVal, short ch);
        
// 激光物理信号输出类型配置(高精度)
// outputType：输出的类型
// index :输出通道序号,取值范围[0,n]
// optionVal: 当作为占空比输出时,该值为PWM的频率,单位HZ；
//            当为LASER_PWM_FRQ时,该值作为占空比值,单位为百分比；
//            当为LASER_PWM_FRQ_EXT时,该值为脉宽,单位为微秒,取值范围(0,~)
// ch :激光通道,取值范围[0,n]
        short NMC_LaserSetOutputTypeEx(HAND devHandle, short outputType, short index, double optionVal, short ch);
        
// 功能：设置立即输出激光的能量,
// outVal: 激光能量（设定值意义与NMC_LaserSetOutputType设置的输出类型对应）
// ch：输出通道 (需要根据不同物理信号端口数量进行设定)
        short NMC_LaserSetPower(HAND devHandle, NativeLong outVal, short ch);
        
// 功能：读取当前激光的能量 
// pVal: 激光能量值
// ch：通道号
        short NMC_LaserGetPower(HAND devHandle, DoubleByReference pVal, short ch);
        
// 功能：读取当前激光开关状态 
// pOnOffState: 激光开关状态，1：激光处于打开状态，0:激光处于关闭状态
// ch：通道号
        short NMC_LaserGetOnOff(HAND devHandle, ShortByReference pOnOffState, short ch);
        
// 功能：设置立即输出激光的能量(高精度)
// chn：输出通道 (需要根据不同物理信号端口数量进行设定)
// outVal: 激光能量（设定值意义与NMC_LaserSetOutputTypeEx设置的输出类型对应）
        short NMC_LaserSetPowerEx(HAND devHandle, double outVal, short ch);
        
// 功能：激光立即输出开关 
// onOffl: 0或者1表示打开或关闭激光输出
// ch：输出通道 (需要根据不同物理信号端口数量进行设定)
        short NMC_LaserOnOff(HAND devHandle, short onOff, short ch);
        
// 设置激光参数
// onDelay:开光延时,单位us,取值范围[0,65535]
// offDelay:关光延时,单位us,取值范围[0,65535]
// minValue:最小输出值,取值范围[0,32767]
// maxValue:最大输出值,取值范围[0,32767]
// standbyPower:待机能量,为0表示取消待机能量输出功能
// ch:激光控制通道
        short NMC_LaserSetParam(HAND devHandle, NativeLong onDelay, NativeLong offDelay, NativeLong minValue, NativeLong maxValue, NativeLong standbyPower, short ch);
        
// 缓冲区设置激光参数
// onDelay:开光延时,单位us,取值范围[0,65535]
// offDelay:关光延时,单位us,取值范围[0,65535]
// minValue:最小输出值，DA输出时，范围[0,32767],占空比输出时，范围[0,100],频率输出时，范围[0,2000000]
// maxValue:最大输出值，DA输出时，范围[0,32767],占空比输出时，范围[0,100],频率输出时，范围[0,2000000]
// standbyPower:待机能量,为0表示取消待机能量输出功能
// ch:激光控制通道
        short NMC_CrdBufLaserSetParam(HAND crdHandle, NativeLong segment, NativeLong onDelay, NativeLong offDelay, NativeLong minValue, NativeLong maxValue, NativeLong standbyPower, short ch);
        
// 读取激光参数  
        short NMC_LaserGetParam(HAND devHandle, NativeLongByReference pOnDelay, NativeLongByReference pOffDelay, NativeLongByReference pMinValue, NativeLongByReference pMaxValue, NativeLongByReference pStandbyPower, short ch);       
        
// 设置缓冲区激光能量跟随
// segNo:段号
// overRide:跟随倍率,为0表示取消激光能量跟随
// followType:跟随类型,0：跟随规划速度,1：跟随实际速度
// ch:激光通道号,取值范围[0,n]
        short NMC_CrdBufLaserSetFollow(HAND crdHandle, NativeLong segNo, double overRide, short followType, short ch);
        
// 设置缓冲区激光能量跟随
// powerFilter:能量输出滤波系数，取值范围[0,32]，0：不开启（默认）
// followAdvMode:能量输出计算方法
// ch:激光通道号,取值范围[0,n]
        short NMC_LaserSetFollowParam(HAND devHandle, short powerFilter, short followAdvMode, short ch);
        
// 缓冲区激光开关
// segNo:段号
// onOff:开关,0：关光,1：开光
// ch:激光控制通道
        short NMC_CrdBufLaserOnOff(HAND crdHandle, NativeLong segNo, short onOff, short ch);
        
// 缓冲区设置激光能量,激光能量跟随模式下,调用这条指令无效
// segNo:段号
// power:能量
// ch:激光控制通道
        short NMC_CrdBufLaserPower(HAND crdHandle, NativeLong segNo, NativeLong power, short ch);
        
// 设置激光能量补偿表
// tableNo： 补偿表号 ：支持20张表
// pXCmpPos：X方向轴的比较位置,长度为xCount  
// pYCmpPos: Y方向轴的比较位置,长度为yCount  
// xCount： 表X方向的长度,取值范围[2,10]
// yCount： 表Y方向的长度,取值范围[2,10]
// powerMin:	大于该最小能量才补偿
// powerMax:	小于该最大能量才补偿
// pLaserCmpPower：补偿表的值，该参数为2维数组的首地址
// chn:对应的激光通道号
        short NMC_SetLaserPowerCmpTable(HAND devHandle, short tableNo, NativeLongByReference pXCmpPos, NativeLongByReference pYCmpPos, short xCount, short yCount, NativeLong powerMin, NativeLong powerMax, NativeLongByReference pLaserCmpPower, short chn);
        
// 启动激光能量补偿
// pAxisNo： pAxisNo[0]表X方向的位置比较轴号 pAxisNo[1]表Y方向的位置比较轴号
// chn：补偿输出给哪路激光通道
        short NMC_StartLaserPowerComp(HAND devHandle, ShortByReference pAxisNo, short chn);
        
// 停止激光能量补偿
        short NMC_StopLaserPowerComp(HAND devHandle, short chn);
        
// 设置时间数组输出参数
// ch : 激光通道
// pPara ： 参数
// 注：1.仅时间数组输出方式下有效
        short NMC_LaserSetTimeArrayPara(HAND devHandle, TTimeArrayPara pPara, short ch);
        
// 设置激光的能量,对于立即输出模式,group无效,pLaserPower为指定的单个能量信息
// group : 设置哪一组激光能量
// pLaserPower ： 设置的数据
// 注：1.即波形设置 
//     2.该接口对于SHIO模式无效
        short NMC_LaserSetTimeArrayPower(HAND devHandle, short group, TLaserPower pLaserPower);
        
// 执行时间序列激光,只在时间序列输出模式下有效
// group : 设置哪一组激光能量
// ch:激光通道
// 注：1.启用时间数组输出后,直到最后一个点,如果最后一个点能量不为0,则维持最后一个能量输出
//    2.如果最后一个点能量为0,且没有PWM输出配合,则自动关闭激光。有PWM配合则需要调用NMC_LaserOnOff或者NMC_CrdBufLaserOnOff关闭激光
        short NMC_LaserTimeArrayExe(HAND devHandle, short group, short ch);
        
// 缓冲区执行时间序列激光,只在时间序列输出模式下有效
// segNo:段号
// group:设置哪一组激光能量
// ch:激光控制通道
// 注：1.启用时间数组输出后,直到最后一个点,如果最后一个点能量不为0,则维持最后一个能量输出
//    2.如果最后一个点能量为0,且没有PWM输出配合,则自动关闭激光。有PWM配合则需要调用NMC_LaserOnOff或者NMC_CrdBufLaserOnOff关闭激光
        short NMC_CrdBufLaserTimeArrayExe(HAND crdHandle, NativeLong segNo, short group, short ch);
        
// 配置SHIO功能的参数
        short NMC_SHIOConfigPara(HAND devHandle, TSHIOPara pSHIOPara, short ch);
        
// SHIO输出的最小频率功能开
// minFrq:最低频率，单位HZ
        short NMC_SHIOEnableMinFrq(HAND devHandle, NativeLong minFrq, short ch);
        
// SHIO输出的最小频率功能关闭
        short NMC_SHIODisableMinFrq(HAND devHandle, short ch);
        
// 缓冲区配置SHIO功能的参数
        short NMC_CrdBufSHIOConfigPara(HAND crdHandle, NativeLong segment, TSHIOPara pSHIOPara, short ch);
        
// 缓冲区SHIO输出的最小频率功能开
// minFrq:最低频率，单位HZ
        short NMC_CrdBufSHIOSetMinFrq(HAND crdHandle, NativeLong segment, NativeLong minFrq, short ch);
        
// 缓冲区SHIO输出的最小频率功能关闭
        short NMC_CrdBufSHIOClrMinFrq(HAND crdHandle, NativeLong segment, short ch);
        
// 缓冲区配置SHIO功能的参数
// delay:延时开关光时间( 暂不用 ),单位：s。默认 0。
// gateTime:设置gate 打开时间,单位：s（内部最小值：1/36us ）,取值范围(0,0.0009),默认0。
// gateDistance:固定模式下的位置间隔 单位：pulse。
        short NMC_CrdBufSHIOSetParam(HAND crdHandle, NativeLong segment, double delay, double gateTime, double gateDistance, short ch);
        
// 切换轴（允许和坐标系不完全一致）
        short NMC_SHIOChangeAxisMask(HAND devHandle, short axisMask, short ch);
        
// 切换轴（允许和坐标系不完全一致）,缓冲区指令
        short NMC_CrdBufSHIOChangeAxisMask(HAND crdHandle, NativeLong segment, short axisMask, short ch);
        
// 允许GATE输出
// 注：设置后根据模式输出
        short NMC_SHIOGateOn(HAND devHandle, short ch);
        
// 禁止GATE输出
// 注：设置后立即禁止输出
        short NMC_SHIOGateOff(HAND devHandle, short ch);
        
// 设置Trigger 输出,
// triggerFreq : 设置triger 脉冲频率单位：HZ。
// triggerWidth : 设置triger 脉冲宽度,单位：s（内部最小值：1/36us ）。默认0。
// 注：设置后立即输出
        short NMC_SHIOTriggerOn(HAND devHandle, double freq, double width, short ch);
        
// 禁止GATE输出
// 注：设置后马上输出
        short NMC_SHIOTriggerOff(HAND devHandle, short ch);
        
// 允许GATE输出
// 注：设置后根据模式输出
        short NMC_BufSHIOGateOn(HAND crdHandle, NativeLong segNo, short ch);
        
//禁止GATE输出
//注：缓冲区执行到该指令后立即禁止输出
        short NMC_BufSHIOGateOff(HAND crdHandle, NativeLong segNo, short ch);
        
// PWM映射到GATE引脚输出
// pwmCh:pwm 通道号
// gateCh:gate信号通道号
// onOff: 0 -- 不映射，1 -- 映射 （默认为0）
        short NMC_SetPwmToGate(HAND devHandle, short pwmCh, short gateCh, short onOff);
        
// 缓冲区SHIO点动出光，输出一段gate脉冲,注意：必须在激光SHIO控制模式下使用
// gateTime:gate输出的脉宽，单位：微秒
// gateFrq:gate输出的频率，单位：HZ
// outCount:输出个数
// ch:通道
        short NMC_CrdBufSHIOGatePulse(HAND crdHandle, NativeLong segNo, double gateTime, double gateFrq, NativeLong outCount, short ch);
        
// SHIO点动出光，输出一段gate脉冲,注意：必须在激光SHIO控制模式下使用
// gateTime:gate输出的脉宽，单位：微秒
// gateFrq:gate输出的频率，单位：HZ
// outCount:输出个数
// ch:通道
        short NMC_SHIOGatePulse(HAND devHandle, double gateTime, double gateFrq, NativeLong outCount, short ch);
        
// 输出一段PWM脉冲,注意：必须在激光SHIO控制模式下使用
// onTime:PWM输出的脉宽，单位：微秒
// pwmFrq:PWM输出的频率，单位：HZ
// outCount:输出个数
// ch:通道
        short NMC_PwmPulseOut(HAND devHandle, double onTime, double pwmFrq, NativeLong outCount, short ch);

//------------------------------------------------------------------------------------------------------------
//
//	9.龙门
//
//------------------------------------------------------------------------------------------------------------

// 设置龙门主动轴
// axisHandle: 龙门主动轴句柄
// group     : 龙门组号,取值范围[0,n]
        short NMC_SetGantryMaster(HAND axisHandle, short group);
        
// 设置龙门从动轴
// axisHandle  : 龙门从动轴句柄;
// group       : 龙门组号,取值范围[0,n]
// gantryErrLmt: 龙门保护误差,取值范围(0,...)
        short NMC_SetGantrySlave(HAND axisHandle, short group, NativeLong gantryErrLmt);
        
// 龙门功能关闭
// group :       龙门组号,取值范围[0,n]
        short NMC_DelGantryGroup(HAND axisHandle, short group);

//------------------------------------------------------------------------------------------------------------
//
//	10.通讯扩展等其他
//
//------------------------------------------------------------------------------------------------------------

// 通讯扩展
// 用户指令传输,只写
        short NMC_UserCmdWrite(HAND devHandle, byte[] sendBuffer, NativeLong sendLen);
        
// 用户指令传输,只读
        short NMC_UserCmdRead(HAND devHandle, byte[] sendBuffer, NativeLong sendLen, byte[] recBuffer, NativeLong waitLen);
        
// 批量数据传输,只写
        short NMC_DataTransfer(HAND devHandle, byte[] sendBuffer, NativeLong sendLen);
        
// 禁止用户程序运行
        short NMC_SysSetUserApp(HAND devHandle, byte mode);
        
// 升级
        short NMC_SysUpgrade(HAND devHandle);
        
// 升级固件
        short NMC_SysUpgradeEx(HAND devHandle, byte cmd, byte[] sendBuffer, NativeLong sendLen, byte[] recBuffer, NativeLong recvedLen);
        
// 设置调试信息
        short NMC_SetDebugErrorEn(HAND devHandle, short debugErrEn);
        
// 读取最后一次的错误代码
// 返回值：错误代码
        short NMC_GetLastErr();

// 设置指令错误返回值模式
// mode:0-标准模式,将返回详细的错误代码(默认)；1--简洁模式,只返回错误代码类别
        short NMC_SetErrCodeMode(short mode);

// 设置指令通讯看门狗
// timeout:看门狗超时时间,单位毫秒,小于等于0代表关闭看门狗功能
// stopMode:超时停止模式,1:马上停止,0:缓冲区执行完毕后停止
// groupID:超时输出do的组号
// doValue:超时输出do状态
        short NMC_SetWatchDog(HAND devHandle, NativeLong timeout, short stopMode, short groupID, NativeLong doValue);

//------------------------------------------------------------------------------------------------------------
//
//	11.手轮
//
//------------------------------------------------------------------------------------------------------------

// 退出手轮
        short NMC_ClrHandWheel(HAND devHandle);

// 启动手轮
// axis:轴号,取值范围[0,n]
// ratio:跟随倍率,取值范围(0,..],数值越大,则同样的输入,跟随轴运动距离越长
// acc:跟随的加速度
// vel:跟随的速度
// 注：编码器信号源为控制器上手脉端口
        short NMC_SetHandWheel(HAND devHandle, short axis, double ratio, double acc, double vel);

// 选择手轮跟随的编码器通道
// index:编码器通道编号,如果是轴通道,取值范围[0,n]
//                    如果是扩展编码器通道,则256表示第一个扩展编码器通道,257表示第二个,以此类推
        short NMC_SetHandWheelInput(HAND devHandle, short index);

// 设置手轮跟随的倍率
// ratio:跟随倍率,取值范围(0,..]
        short NMC_SetHandWheelRatio(HAND devHandle, double ratio);

//------------------------------------------------------------------------------------------------------------
//
//	12.PT
//
//------------------------------------------------------------------------------------------------------------

// 设置PT运动的相关参数 
// pPara：参数,参考结构定义
        short NMC_MtPtSetPara(HAND axisHandle, TPtPara pPara);

// onOff:		1：数据驻存模式   0：数据刷新模式(默认模式)
// loopCount:	循环次数 ：仅数据驻存模式下有效
        short NMC_MtPtSetStatic(HAND axisHandle, short onOff, NativeLong loopCount);

// onOff:		1：数据驻存模式   0：数据刷新模式(默认模式)
// loopCount:	循环次数 ：仅数据驻存模式下有效
        short NMC_MtPtGetStatic(HAND axisHandle, ShortByReference pOnOff, NativeLongByReference pLoopCount);

// 查询PT数据剩余空间大小
// pSpace:返回的剩余空间大小
// pUsed: 已使用的空间段数
        short NMC_MtPtGetSpace(HAND axisHandle, ShortByReference pSpace, ShortByReference pUsed);

// 向Pt运动缓存区中压运动数据段
// count:压入的数据段数
// pPosArray:段运行距离
// pTimeArray:段运行时间
// pTypeArray:段类型,见宏定义
        short NMC_MtPtPush(HAND axisHandle, short count, double[] pPosArray, NativeLong[] pTimeArray, short[] pTypeArray);

// 清空PT数据
        short NMC_MtPtBufClr(HAND axisHandle);

// 启动Pt运动
// otherSynAxCnts： 不包括axisHandle 的其他同步启动轴数量
// pOtherSynAxArray: 其他同步启动轴的序号：0~N	
// 注：同步的轴必须属于同一个控制器
        short NMC_MtPtStartMtn(HAND axisHandle, short otherSynAxCnts, ShortByReference pOtherSynAxArray);

//-------------------------------------------------------------------------------
// PTEx
//-------------------------------------------------------------------------------

// 打开PtEx句柄
        short NMC_PtExOpen(HAND devHandle, short chn, PHAND pHandle);

// 设置PTEx运动的相关参数 
// pPara：参数,参考结构定义
        short NMC_PtExSetPara(HAND ptExHandle, TPtExPara pPara);

// 向PtEx运动缓存区中压运动数据段
// count:压入的数据段数
// pMvData:运动数据区
        short NMC_PtExPushMvData(HAND ptExHandle, short count, TPtExMvData[] pMvDataArray);

// 向PtEx运动缓存区中压DO输出指令
// count:数量，取值范围[1,16]
// pDataArray:数据
        short NMC_PtExPushDo(HAND ptExHandle, short count, TPtExDo[] pDataArray);

// 向PtEx运动缓存区中压DO脉冲输出指令
// count:数量，取值范围[1,16]
// pDataArray:数据
        short NMC_PtExPushDoBitPulse(HAND ptExHandle, short count, TPtExDoBitPulse[] pDataArray);

// 清空PTEx数据
        short NMC_PtExBufClr(HAND ptExHandle);

// 启动PtEx运动
        short NMC_PtExStartMtn(HAND ptExHandle);

// 停止PtEx运动
        short NMC_PtExStopMtn(HAND ptExHandle);

// 获取PtEx状态
        short NMC_PtExGetSts(HAND ptExHandle, TPtExSts pSts);

//-------------------------------------------------------------------------------
// 13.线性距离位置比较
//-------------------------------------------------------------------------------

// 功能：设置精确位置比较的参数，并清除线性位置比较位置数据
// dimens:比较的维数 1或者2
// axisMask：选比较的轴号,按bit选择:不能超过2个bit同时为1
// src：比较源：1:编码器位置  0：规划位置
// cmpMode：比较的模式：0 按输出数组位置比较,1 线性比较,按interval间距比较
// gateTime:输出的脉冲宽度
// chn：输出通道 目前只支持0
        short NMC_LinearCompSetParam(HAND devHandle, short dimens, short axisMask, short src, short cmpMode, double gateTime, short chn);

// 获取配置参数
        short NMC_LinearCompGetParam(HAND devHandle, TLinearCmpPara pLinearCmpPara, short chn);

// 功能：设置精确比较位置数据
// pStartPos：起始比较位置，注意：暂时没用
// pPos :比较的位置数组地址。
//		 注意：这里为相对距离，第一点为相对于NMC_LinearCompOnOff调用时的位置的距离，第二点为相对第一点的距离
// count：比较的位置个数，最大不能超过250，如果比较数据过多，可以通过多次调用的方式下压数据，缓冲区长度
// chn：输出通道 目前只支持0
        short NMC_LinearCompSetData(HAND devHandle, NativeLong[] pStartPos, NativeLong[] pPos, NativeLong count, short chn);

// 功能：线性比较输出
// pStartPos：起始比较位置
// interval:线性比较间距（小于32767）
// count: 线性比较次数
        short NMC_LinearCompInterval(HAND devHandle, NativeLong[] pStartPos, NativeLong interval, NativeLong count, short chn);

// 功能：精确位置比较使能
// onOff： 0 停止,1输出
// chn：输出通道 目前只支持0
        short NMC_LinearCompOnOff(HAND devHandle, short onOff, short chn);

// 功能：比较的输出状态
// pStatus: 0 未启动比较 1 比较输出中
// pOutCount：输出的个数,对于数组输出模式，输出计数计算请咨询我们
// chn：输出通道 目前只支持0
        short NMC_LinearCompStatus(HAND devHandle, ShortByReference pStatus, ShortByReference pOutCount, short chn);

//-------------------------------------------------------------------------------
//14.二维位置点比较
//-------------------------------------------------------------------------------

// 功能：设置2维位置比较的参数
// param: 二维比较参数
// group:组号,0 或者1
// chn:保留,设为0
        short NMC_Comp2DimensSetParam(HAND devHandle, short group, TComp2DimensParam param, short chn);

// 功能：获取2维位置比较的参数
// param: 二维比较参数
// group:组号,0 或者1
// chn:保留,设为0
        short NMC_Comp2DimensGetParam(HAND devHandle, short group, TComp2DimensParam param, short chn);

// 功能：设置2维位置比较的参数
// param: 二维比较参数
// group:组号,0 或者1
// chn:保留,设为0
        short NMC_Comp2DimensSetParamEx(HAND devHandle, short group, TComp2DimensParamEx param, short chn);

// 功能：读取2维位置比较的参数
        short NMC_Comp2DimensGetParamEx(HAND devHandle, short group, TComp2DimensParamEx param, short chn);

// 功能：设置二维比较数据
// pArrayPos:比较数组地址
// count:位置点数,count=0表示清除已经缓存的数据。一次性最多压入128组数据
// group:组号,0 或者1
// chn:保留,设为0
        short NMC_Comp2DimensSetData(HAND devHandle, short group, NativeLong[] pArrayPos, short count, short chn);

// 功能：2维位置比较使能
// onOff： 0 停止,1输出 2手动
// group:组号,0 或者1
// chn:保留,设为0
        short NMC_Comp2DimensOnoff(HAND devHandle, short group, short onOff, short chn);

// 功能：2维位置比较的输出状态
// pStatus: 0 未启动比较 1 比较输出中
// pOutCount：输出的个数
// group:组号,0 或者1
// chn:保留,设为0
        short NMC_Comp2DimensStatus(HAND devHandle, short group, ShortByReference pStatus, ShortByReference pOutCount, short chn);

// 功能：2维位置比较的输出状态
// pStatus: 状态结构体
// group:组号,0 或者1
// chn:保留,设为0
        short NMC_Comp2DimensStatusEx(HAND devHandle, short group, TComp2DimensSts pStatus, short chn);

// 功能：缓存区位置比较开关
// onOff： 0 停止,1输出 2手动
// group:组号,取值范围[0,n]
// compareType:位置比较类型，0:高速一维，1：高速二维
        short NMC_CrdBufCompareOnOff(HAND crdHandle, NativeLong segNo, short group, short onOff, short compareType);

// 功能：设置二维比较数据
// pArrayPos:比较数组地址
// count:位置点数,count=0表示清除已经缓存的数据。一次性最多压入6个数据
// group:组号,0 或者1
// compareType:位置比较类型，0:高速一维，1：高速二维
        short NMC_CrdBufComp2DimensSetData(HAND crdHandle, NativeLong segNo, short group, NativeLongByReference pArrayPos, short count, short compareType);

//-------------------------------------------------------------------------------
//15.多维位置比较输出通用接口
//-------------------------------------------------------------------------------

// 功能：设置X维位置比较的参数
// param: X维比较参数
// ch:组号,0~2
        short NMC_CompXDimensSetParam(HAND devHandle, TCompXDimensParam param, short chn);

// 功能：获取X维位置比较的参数
// param: 二维比较参数
// chn:组号
        short NMC_CompXDimensGetParam(HAND devHandle, TCompXDimensParam param, short chn);

// 功能：设置X维位置比较的输出模式
// outMode: 输出模式 0：同时输出模式 1： 轮循输出模式
// ch:组号,0~N
        short NMC_CompXDimensSetCmpOutMode(HAND devHandle, short outMode, short chn);

// 功能：设置X维比较数据
// pArrayPos:比较数组地址,注：若是1维比较,则pPosArray传入一维数组地址,若是2维比较,则pPosArray应传入2维数组地址
// outValue
// count:位置点数,注：若为2维数组比较时,每两个数据为一个点数
// ch:组号,0~N
// 注：按结构体定义的IO,同时输出
        short NMC_CompXDimensSetData(HAND devHandle, NativeLong[] pPosArray, short count, short chn);

// 功能：X维位置比较使能
// onOff： 0 停止,1输出
// chn： 组号
// 注：按结构体定义的IO,同时输出
        short NMC_CompXDimensOnoff(HAND devHandle, short onOff, short chn);

// 功能：X维位置比较的输出状态
// pStatus: 0 未启动比较 1 比较输出中
// pOutCount：输出的个数
// chn：组号
        short NMC_CompXDimensStatus(HAND devHandle, ShortByReference pStatus, ShortByReference pOutCount, short chn);

//-------------------------------------------------------------------------------
//16.坐标系输出转换（根据机械结构进行转换）
//-------------------------------------------------------------------------------

// 功能：使能旋转转换处理
//       用户数据是按照直角坐标描述,实际加工在一个旋转面上加工,可以用此功能
// rotAxisNo：旋转轴轴号
// angleRadEqual：旋转轴脉冲转弧度系数
// firstAxisInitPos：旋转中心,X轴的位置
// secAxisInitPos：旋转中心,Y轴的位置
        short NMC_CrdSetTransRotate(HAND crdHandle, short rotAxisNo, double angleRadEqual, NativeLong firstAxisInitPos, NativeLong secAxisInitPos);

// 功能：关闭旋转转换处理
        short NMC_CrdDelTransRotate(HAND crdHandle);

// 功能：使能极坐标转换处理
//       用户数据是按照直角坐标描述,实际机械机构是一个旋转轴和一个进给轴
//参数：	rotAxNo：旋转轴轴号
//		transAxNo：平移轴轴号
//		rotEquiv：旋转轴当量,2PI/电机一圈脉冲数
        short NMC_CrdSetTransPolar(HAND crdHandle, short rotAxNo, short transAxNo, double rotEquiv);

// 功能：运行至设定的极坐标位置并且进行圈数清零处理（利用单轴PTP运行到指定位置）
//参数：	xPos:极坐标系下X方向位置
//		yPos:极坐标系下Y方向位置,比如运动到（5000,5000）的位置,则相当于旋转轴转到45度角,进给轴运动到根号2*5000的位置
//		rotVel:旋转速度
//		transVel:进给速度
        short NMC_CrdRunToPolarPos(HAND crdHandle, double xPos, double yPos, double rotVel, double transVel);

// 功能：运行至设定的极坐标角度位置（利用单轴PTP运行到指定位置）
//参数：	theta:旋转轴目标角度
//				vel:旋转速度
//				clrRoundFlag:是否清除圈数
        short NMC_CrdRunToPolarTheta(HAND crdHandle, double theta, double vel, short clrRoundFlag);

// 功能：销毁极坐标机型（只恢复直角坐标系）
        short NMC_CrdDelTransPolar(HAND crdHandle);

// XYZA机型设置接口
// 设置XYZA的映射轴号
// pAxisMapArray[0]~[3]分别对应X、Y、Z和A
        short NMC_CrdSetTransXYZA(HAND crdHandle, short[] pAxisMapArray);

// 销毁XYZA机型，回归XYZ结构
        short NMC_CrdDelTransXYZA(HAND crdHandle);

// 求工具参数
// deltaTheta：从0°往正方向旋转过的角度值
// deltaX：旋转deltaTheta角度后，重新校正到同一点位置后，X轴的相对移动量
// deltaY：旋转deltaTheta角度后，重新校正到同一点位置后，Y轴的相对移动量
// pToolX: 工具的X值
// pToolY: 工具的Y值
        short NMC_CrdSetXYZAToolCalc(HAND crdHandle, double deltaTheta, NativeLong deltaX, NativeLong deltaY, NativeLongByReference pToolX, NativeLongByReference pToolY);

// 设置XYZA机型参数
// pulse2Rad: A轴的每个脉冲对应的弧度值
// toolX：工具的X值
// toolY: 工具的Y值
        short NMC_CrdSetXYZAPara(HAND crdHandle, double pulse2Rad, NativeLong toolX, NativeLong toolY);

// 获取XYZA机型参数
// pPulse2Rad:A轴的每个脉冲对应的弧度值
// pToolX:工具的X值
// pToolY:工具的Y值
        short NMC_CrdGetXYZAPara(HAND crdHandle, DoubleByReference pPulse2Rad, NativeLongByReference pToolX, NativeLongByReference pToolY);

// 设置压入插补数据的位置是否需要关节到笛卡尔的坐标转换
        short NMC_CrdSetXYZAJointTransCrdPos(HAND crdHandle, short isTrans);
//-------------------------------------------------------------------------------
//17.结构体初始化函数
//-------------------------------------------------------------------------------

        short NMC_TSafeParaStructInit(HAND devHandle, TSafePara pPara);
        
        short NMC_TCrdConfigStructInit(HAND devHandle, TCrdConfig pPara);
        
        short NMC_TCrdSafeParaStructInit(HAND devHandle, TCrdSafePara pPara);
        
        short NMC_THomeSettingStructInit(HAND devHandle, THomeSetting pPara);
        
        short NMC_TArcSecSettingStructInit(HAND devHandle, TArcSecSetting pPara);
        
        short NMC_TCrdParaStructInit(HAND devHandle, TCrdPara pPara);
        
        short NMC_TCollectCfgStructInit(HAND devHandle, TCollectCfg pPara);
        
        short NMC_TCollectTrigStructInit(HAND devHandle, TCollectTrig pPara);
        
        short NMC_TTimeArrayParaStructInit(HAND devHandle, TTimeArrayPara pPara);
        
        short NMC_TLaserPowerStructInit(HAND devHandle, TLaserPower pPara);
        
        short NMC_TSHIOParaStructInit(HAND devHandle, TSHIOPara pPara);
       
        short NMC_TLinearCmpParaStructInit(HAND devHandle, TLinearCmpPara pPara);
       
        short NMC_TComp2DimensParamStructInit(HAND devHandle, TComp2DimensParam pPara);
       
        short NMC_TPtpParaStructInit(HAND devHandle, TPtpPara pPara);
       
        short NMC_TJogParaStructInit(HAND devHandle, TJogPara pPara);
       
        short NMC_TNMCTimeStructInit(HAND devHandle, TNMCTime pPara);
     
// 清除轴错误状态,同时多个        
        short NMC_MtClrErrorEx(HAND axisHandle, short count);

// 输出DO,16位
// bitsFlag,0:低16位,1：高16位
        short NMC_SetDOGroupEx(HAND devHandle, NativeLong value, short groupID, short bitsFlag);

//-------------------------------------------------------------------------------
//18.闭环
//-------------------------------------------------------------------------------

// 设置单轴闭环控制的DA参数,轴与DA通道的对应
        short NMC_MtSetCloseLoopDac(HAND axisHandle, TDacMotor pDacPara);

// 获取单轴闭环控制的DA参数
        short NMC_MtGetCloseLoopDac(HAND axisHandle, TDacMotor pDacPara);

// 设置单轴的控制模式：默认使用对应轴的编码器作为输入反馈,对应序号的DAC作为输出
// 闭环模式下,先调用NMC_SetCloseLoopDac指令
//mode: 0 脉冲控制  1 DA闭环控制，默认为脉冲控制
        short NMC_MtSetCtrlMode(HAND axisHandle, short mode);

// 读取单轴的控制模式
        short NMC_MtGetCtrlMode(HAND axisHandle, ShortByReference pMode);

//设置对应组号的PID参数
        short NMC_MtSetPIDPara(HAND axisHandle, short index, TPidPara pidPara);

// 获取对应组号的PID参数
        short NMC_MtGetPIDPara(HAND axisHandle, short index, TPidPara pPidPara);

// 设置使用哪组PID
        short NMC_MtSetPIDIndex(HAND axisHandle, short index);

// 获取正使用的PID组号
        short NMC_MtGetPIDIndex(HAND axisHandle, ShortByReference pIndex);

//-------------------------------------------------------------------------------
//19.高级BufIo输出配置及控制
//-------------------------------------------------------------------------------

// 设置BufIo输出参数
        short NMC_AdvBufIoSetParam(HAND devHandle, TAdvBufIoParam pPrm, short ch);

// 读取BufIo输出参数
        short NMC_AdvBufIoGetParam(HAND devHandle, TAdvBufIoParam pPrm, short ch);

// 缓冲区设置高级BufIo输出有效（运动一段距离后输出特定状态）
// outLength:距离，单位：脉冲
// value: 脉冲模式下输出脉冲个数，电平方式下无意义。
// ch:输出组，取值范围：[0,MAX_ADV_BUFIO_GROUP)
        short NMC_CrdAdvBufIoOnAfterLen(HAND crdHandle, NativeLong segNo, NativeLong outLength, NativeLong value, short ch);

// 缓冲区设置高级BufIo关闭输出（缓冲区全部运动结束前提前一段距离输出特定状态）
// outLength:距离，单位：脉冲
// ch:输出组，取值范围：[0,MAX_ADV_BUFIO_GROUP)
        short NMC_CrdAdvBufIoOffBeforeLen(HAND crdHandle, NativeLong segNo, NativeLong outLength, short ch);

// 立即设置高级BufIo输出
// value: 脉冲模式下输出脉冲个数，电平方式下0:关闭，1:打开。
// ch:输出组，取值范围：[0,MAX_ADV_BUFIO_GROUP)
        short NMC_AdvBufIoOut(HAND devHandle, NativeLong value, short ch);

// 读取BufIo的输出数量
// pOutCout:输出脉冲个数
// ch:输出组，取值范围：[0,MAX_ADV_BUFIO_GROUP)
        short NMC_AdvBufIoGetPulseCnt(HAND devHandle, NativeLongByReference pOutCout, short ch);

// DO脉冲输出
// doType:DO类型,0：通用输出；其他保留
// doIndex:DO序号，取值范围[0,n]
// highLevelTime:高电平宽度，单位:us
// lowLevelTime:低电平宽度，单位:us
// outCount:输出脉冲个数
// firstLevel:0：先输出低电平，1：先输出高电平
// ch:输出脉冲通道号,取值范围:[0,MAX_NUM_DOBIT_PULSE-1]
        short NMC_DoBitPulseEnable(HAND devHandle, short doType, short doIndex, NativeLong highLevelTime, NativeLong lowLevelTime, NativeLong outCount, short initialLevel, short ch);

// 关闭DO脉冲输出
        short NMC_DoBitPulseDisable(HAND devHandle, short ch);

// DO脉冲输出 （缓冲区）
        short NMC_CrdBufDoBitPulseEnable(HAND crdHandle, NativeLong segNo, short doType, short doIndex, NativeLong highLevelTime, NativeLong lowLevelTime, NativeLong outCount, short initialLevel, short ch);

// 关闭DO脉冲输出（缓冲区）
        short NMC_CrdBufDoBitPulseDisable(HAND crdHandle, NativeLong segNo, short ch);

//-------------------------------------------------------------------------------
//20.模拟量控制
//-------------------------------------------------------------------------------

// 设置DAC（模拟量输出）通道的模式
// ch:模拟量通道号,取值范围[0,n]
// mode:模拟量输出范围,0:0~5V, 1:0~10V, 2: 0~10.8V, 3:+/-5V, 4:+/-10V, 5:+/-10.8V,其他无效，默认为4
        short NMC_SetDacMode(HAND devHandle, short ch, short mode);

// 读取DAC（模拟量输出）通道的模式
// ch:模拟量通道号,取值范围[0,n]
// pMode:返回的模拟量输出范围设定值
        short NMC_GetDacMode(HAND devHandle, short ch, ShortByReference pMode);

// 设置Adc参数
// ch:模拟量通道号,0~7表示轴通道上的AD，256：表示扩展AD
// mode:模拟量范围,0:0~5V, 1:0~10V, 2: 0~10.8V, 3:+/-5V, 4:+/-10V, 5:+/-10.8V,默认为4
// 注意：目前只支持+/-10V
// filterCoe:滤波系数，取值范围[0,64],0表示取消Adc滤波，单位:ms，默认值为0
        short NMC_SetAdcMode(HAND devHandle, short ch, short range, short filterCoe);

// 读取Adc参数
// ch:模拟量通道号,0~7表示轴通道上的AD，256：表示扩展AD
// pMode:模拟量范围
// pFilterCoe:滤波系数
        short NMC_GetAdcMode(HAND devHandle, short ch, ShortByReference pRange, ShortByReference pFilterCoe);

// 设置DAC（模拟量输出）输出值
// ch:模拟量通道号,取值范围[0,n]
// dacValue:模拟量输出值,取值范围[-32768,32767],对应DAC输出范围
        short NMC_SetDac(HAND devHandle, short ch, short dacValue);

// 读取DAC（模拟量输出）输出值
// ch:模拟量通道号,取值范围[0,n]
// pDacValue:返回模拟量输出值,取值范围[-32768,32767],对应DAC输出范围
        short NMC_GetDac(HAND devHandle, short ch, ShortByReference pDacValue);

// 读取ADC（模拟量输入）值
// ch:模拟量通道号,取值范围[0,n]
// pAdcValue:返回模拟量输入值，取值范围[-32768,32767],对应Adc输入电压范围
        short NMC_GetAdc(HAND devHandle, short ch, ShortByReference pAdcValue);

// 设置模拟量输出的偏移值
// ch:模拟量通道号，[0,n]表示本地,[256,n]表示扩展模拟量通道
// bias:DAC输出偏移值
        short NMC_SetDacBias(HAND devHandle, short ch, short bias);

// 读取模拟量输出的偏移值
// ch:模拟量通道号，[0,n]表示本地,[256,n]表示扩展模拟量通道
// pBias:DAC输出偏移值
        short NMC_GetDacBias(HAND devHandle, short ch, ShortByReference pBias);

// 设置模拟量输出的极限值
// ch:模拟量通道号，[0,n]表示本地,[256,n]表示扩展模拟量通道
// maxVal:输出最大值
// minVal:输出最小值
        short NMC_SetDacLmt(HAND devHandle, short ch, short maxVal, short minVal);

// 读取模拟量输出的极限值
// ch:模拟量通道号，[0,n]表示本地,[256,n]表示扩展模拟量通道
// pMaxVal:输出最大值
// pMinVal:输出最小值
        short NMC_GetDacLmt(HAND devHandle, short ch, ShortByReference pMaxVal, ShortByReference pMinVal);

//-------------------------------------------------------------------------------
//21.scara
//-------------------------------------------------------------------------------

// 设置机械参数
        short NMC_CrdSetScaraMechPara(HAND crdHandle, TScaraMechPara pScaraMechPara);

// 读取机械参数
        short NMC_CrdGetScaraMechPara(HAND crdHandle, TScaraMechPara pScaraMechPara);

// 设置关节参数
        short NMC_CrdSetScaraJiontPara(HAND crdHandle, short jointNo, TScaraJiontPara pScaraJiontPara);
        short NMC_CrdGetScaraJiontPara(HAND crdHandle, short jointNo, TScaraJiontPara pScaraJiontPara);

// 设置crd类型为scara
// jointNum: 2/3
// jointAxNoArray 数组长度为4，不用的数据设置为0
        short NMC_CrdSetTransScara(HAND crdHandle, short jointNum, short[] jointAxNoArray);

// 销毁scara机型
        short NMC_CrdDelTransScara(HAND crdHandle);

// 设置crd启用飞行跟随模式
// *pFlyFollowPara 模式参数
        short NMC_CrdSetFlyFollow(HAND crdHandle, TFlyFollowPara pFlyFollowPara);

// 销毁飞行跟随
        short NMC_CrdDelFlyFollow(HAND crdHandle);

// 查询是否在暂停后已经跟随上状态
// sts : 1表示跟随上  0表示没有跟随上
        short NMC_CrdGetFlyFollowUpSts(HAND crdHandle, ShortByReference pSts);

// 缓冲区设置飞行跟随功能的启动和关闭
// enable:0:关闭跟随
//        1:激活跟随
//        2:暂停跟随
        short NMC_CrdBufEnableFlyFollow(HAND crdHandle, NativeLong segNo, short enable);

// 缓冲区：飞行跟随情况下，移动到机械位置
        short NMC_CrdBufFlyFollowLineXY(HAND crdHandle, NativeLong segNo, NativeLongByReference tgtPos, double acc, double vel);

// 缓冲区：等待缓冲区数据
// usedSpace:等待缓冲区数据段数（大于等于usedSpace继续往下执行）
        short NMC_CrdBufWaitData(HAND crdHandle, NativeLong segNo, NativeLong usedSpace);

// 缓冲区：坐标系内轴跟随
// crdAxMaster:跟随的主轴，取值范围[0,n],为坐标系内的轴，0:X轴，1:Y轴，2:Z轴，3:A轴
// axFllowMask:跟随的从轴掩码
// onOff：启动跟随或者关闭跟随,1:启动跟随，0:关闭跟随，此时，crdAxMaster和axFllowMask忽略，可任意值
        short NMC_CrdBufAxFollowOnOff(HAND crdHandle, NativeLong segNo, short crdAxMaster, short axFllowMask, short onOff);

//-------------------------------------------------------------------------------
//22.坐标系干涉保护指令
//-------------------------------------------------------------------------------

// 启动坐标系的干涉保护
// groupNo: 干涉坐标系组号（目前只有两个坐标系，所以该值为0）
// mode:	0:基本模式，出现干涉，两坐标系均停止  1：激光模式，出现干涉，其中一个停止并离开
        short NMC_SetMvProtect(HAND devHandle, short groupNo, short mode);

// 取消坐标系的干涉保护
// groupNo: 干涉坐标系组号（目前只有两个坐标系，所以该值为0）
        short NMC_DelMvProtect(HAND devHandle, short groupNo);

// 获取坐标系的干涉状态
// groupNo: 干涉坐标系组号（目前只有两个坐标系，所以该值为0）
// pSts:	0 没有启动干涉功能 1  没有出现干涉  2 干涉发生
        short NMC_GetMvProtectSts(HAND devHandle,short groupNo,ShortByReference pSts);

// 设置坐标系的干涉保护参数
// groupNo:	干涉坐标系组号（目前只有两个坐标系，所以该值为0）
// pCrdInterfProtectPara： 干涉参数
        short NMC_SetMvProtectMode01Para(HAND devHandle, short groupNo, TMvProtectPara pMvProtectPara);

// 获取坐标系的干涉保护参数
// groupNo:	干涉坐标系组号（目前只有两个坐标系，所以该值为0）
// pCrdInterfProtectPara： 干涉参数
        short NMC_GetMvProtectMode01Para(HAND devHandle, short groupNo, TMvProtectPara pMvProtectPara);

//-------------------------------------------------------------------------------
//23.不常用指令
//-------------------------------------------------------------------------------

// 坐标系运动模式下,打包读取控制器状态
        short NMC_CrdGetStsPack3(HAND crdHandle, TPackedCrdSts3 pPackSts);

// 坐标系模式下,读取多个轴的机械坐标位置
// cnts: 读取个数,1~N
// pPos：返回坐标数组
        short NMC_CrdGetAxisPos(HAND crdHandle, short cnts, NativeLong[] pPosArray);

// 读取规划位置XYZ
// cnts: 读取个数,1~N
// pPosArray：返回坐标数组
        short NMC_CrdGetPrfPos(HAND crdHandle, short cnts, NativeLong[] pPosArray);

// 读取编码器位置
// cnts: 读取个数,1~N
// pPos：返回坐标数组。
        short NMC_CrdGetEncPos(HAND crdHandle, short cnts, NativeLong[] pPosArray);

// 获取坐标系合成速度
// pVel：坐标系合成速度
        short NMC_CrdGetVel(HAND crdHandle, DoubleByReference pVel);

// 打开坐标系组
// pCrdHandle：返回坐标系组句柄
        short NMC_CrdOpen(HAND devHandle, PHAND pCrdHandle);

// 单轴急停
// 注：运动会按设定的急停加速度停止。如果没有设置,则会立即停止。
        short NMC_MtEstp(HAND axisHandle);

// 打包读取8个轴的状态,从第一个轴开始读取
// axisFirstHandle : 第一个轴句柄
// pPackSts: 打包的状态数据,参考结构体定义
        short NMC_MtGetStsPack8(HAND axisFirstHandle, TAxisStsPack8 pPackSts);

// 直线插补
// segNo:段号；endVel:终点速度;vel:最大速度;synAcc:合成加速度
// crdAxMask:参与的轴,按位表示
// pTgPosArray：目标位置数组,长度为3
        short NMC_CrdLineXYZ(HAND crdHandle, NativeLong segNo, short crdAxMask, NativeLong[] pTgPosArray, double endVel, double vel, double synAcc);

// 读取通用输出(按通道,支持超过32位)
// groupID:DO组,取值范围[0,n],,0: 本地DO31~DO0, 1: 本地DO63~DO32,其他指扩展IO模块
// pDoValue: 设置通用数字量输出。1, 高电平,0,低电平
        short NMC_GetDO(HAND devHandle, short groupID, NativeLongByReference pDoValue);

// 设置通用输出(按通道,支持超过32位)
// groupID:DO组,取值范围[0,n],具体需要看控制器是否存在多组数字量输出
// value: 设置通用数字量输出。1, 输出高电平,0,输出低电平
        short NMC_SetDO(HAND devHandle, short groupID, NativeLong value);

// 读通用输入(按通道,支持超过32位) 
// groupID:DI组,取值范围[0,n],0: 本地DI31~DI0, 1: 本地DI63~DI32,其他指扩展IO模块
// pInValue: 通用数字量输入值。1, 高电平,0,低电平
        short NMC_GetDI(HAND devHandle, short groupID, NativeLongByReference pInValue);

// 设置限位开关输入是否停止运动
// posEn：正向限位触发允许设置,1为允许,0为禁止
// negEn: 负向限位触发允许设置
        short NMC_MtLmtOnOff(HAND axisHandle, short posSwt, short negSwt);

// 设置限位开关触发电平
// posSwt：正向限位触发电平设置,1为高电平触发,0为低电平触发
// negSwt: 负向限位触发电平设置
        short NMC_MtLmtSns(HAND axisHandle, short posSwt, short negSwt);

// 设置原点开关触发电平，注意：这里的电平设置不会影响捕获的电平
// sns：原点电平设置,1为高电平触发,0为低电平触发
        short NMC_MtHomeSns(HAND axisHandle, short sns);

// 读取原点开关触发电平
// pSns：当前的原点电平设置,1为高电平触发,0为低电平触发
        short NMC_MtGetHomeSns(HAND axisHandle, ShortByReference pSns);

// 设置伺服报警开关是否停止运动
// swt：伺服报警开关输入允许设置,1为允许,0为禁止。（默认为高电平触发）
        short NMC_MtAlarmOnOff(HAND axisHandle, short swt);

// 设置伺服报警开关电平
// swt：伺服报警触发电平设置,1为高电平触发,0为低电平触发
        short NMC_MtAlarmSns(HAND axisHandle, short swt);

// 打包读取12个轴的状态,从第一个轴开始读取
// axisFirstHandle : 第一个轴句柄
// pPackSts: 打包的状态数据,参考结构体定义
        short NMC_MtGetStsPack12(HAND axisFirstHandle, TAxisStsPack12 pPackSts);

//------------------------------------------------------------------------
//                                                     
//  24.自动状态返回
//                                                   
//------------------------------------------------------------------------

// 设置启用自动状态返回
// mode1 : 设置哪些状态主动返回，0：固定时间周期返回（默认）; 1：周期+轴状态变化，坐标系状态变化；
// mode2 : 备用
// cycleInMs: 周期，单位ms。取值5~10000。建议值100ms。
// port: 端口，写0（库里会修改）
// hostTag : 上位机标签，写0（库里会修改）
        short NMC_DevAutoRtnSet(HAND devHandle, NativeLong mode1, NativeLong mode2, NativeLong cycleInMs, NativeLong port, NativeLong hostTag);

// 设置禁用自动状态返回
        short NMC_DevAutoRtnClr(HAND devHandle);

// 同步，
// 把之前的状态缓冲清除掉。以后读到的是同步指令发送后的状态
// hostTag : 上位机标签，写0
        short NMC_DevAutoRtnSyn(HAND devHandle, NativeLong hostTag);

// 读状态
// packedSts : 打包状态
        short NMC_DevAutoRtnGet(HAND devHandle, TAutoRtnPackedSts packedSts, ShortByReference pReady);

// 设置PTP位置比较输出
// comparaPos： 目标位置，单位是 脉冲
// upDateVel：比较后的更新速度 pulse/ms
        short NMC_MtSetPtpComparePara(HAND axisHandle, short dir, NativeLong comparaPos, double upDateVel);

// 获取PTP比较输出状态
        short NMC_MtGetPtpCompareSts(HAND axisHandle, ShortByReference pIsCompareActive, ShortByReference pIsCompareOut);

//------------------------------------------------------------------------
//                                                     
//  Group 25 : 点位自动收发
//                                                   
//------------------------------------------------------------------------

// 设置启用点位自动收发
        short NMC_DevAsynCommSet(HAND devHandle, NativeLong delayInMs);

// 设置关闭点位自动收发
        short NMC_DevAsynCommClr(HAND devHandle);

// 设置启用自动状态返回
        short NMC_DevAsynGetSts(HAND devHandle, TAutoRtnPackedSts packedSts, ShortByReference pReady);

// 多轴点位运动
        short NMC_DevAsynAbsMoveType1(HAND axisHandle, float acc, float dec, float vel, short smooth, NativeLong arrivalBand, NativeLong stableTime, NativeLong tgtPos);

// 设置Do
        short NMC_DevAsynSetDoBit(HAND devHandle, short bitIdx, short setValue);

//------------------------------------------------------------------------
//                                                     
//  Group 26 : 高速一维位置比较
//                                                   
//------------------------------------------------------------------------

// 功能：设置高速1维位置比较的参数（比较编码器）
// param: 一维比较参数
// chn：通道号,范围0~3
// 注：1)需要先设置编码器模式，可设置外部编码器或内部计数。
//???? 2)比较输出引脚位置请参考硬件手册。
//???? 3)out1比较位置到后马上输出, out2到位后延时输出。
        short NMC_CompHs1DimensSetParam(HAND devHandle, TCompHs1DimensParam param, short chn);

// 功能：读取高速1维位置比较的参数
// param, chn：同上
        short NMC_CompHs1DimensGetParam(HAND devHandle, TCompHs1DimensParam param, short chn);

// 功能：设置高速1维比较数据
// pArrayPos:比较数组地址
// count:位置点数
// chn: 同上
        short NMC_CompHs1DimensSetData(HAND devHandle, NativeLongByReference pArrayPos, short count, short chn);

// 功能：高速1维位置比较使能
// onOff： 0:停止,1:输出,2:手动输出（必须在空闲状态下,也需要提前设置参数）
// chn: 同上
        short NMC_CompHs1DimensOnOff(HAND devHandle, short onOff, short chn);

// 功能：高速1维位置比较的状态
// pBusy: 0 未启动比较 1 比较输出中
// pOutCount：输出的个数
// pWaitCnts：等待比较的个数
// pFreeCnts：缓冲区空闲的个数
// chn: 同上
        short NMC_CompHs1DimensStatus(HAND devHandle, ShortByReference pBusy, ShortByReference pOutCount, ShortByReference pWaitCnts, ShortByReference pFreeCnts, short chn);

//------------------------------------------------------------------------
//                                                     
//  Group 27 : 获取多轴信息
//                                                   
//------------------------------------------------------------------------

// 读取计时时钟，控制器上电开始
// pClock:计数值，单位:125us
// pLoop: 循环周期计数
        short NMC_GetClock(HAND devHandle, NativeLongByReference pClock, NativeLongByReference pLoop);

// 获取多轴状态
// firstAxisHandle:第一个轴句柄
// pSts:返回的状态数组
// count:轴数量
// pClock:返回当前控制器时钟，单位125us
        short NMC_MtGetStsMulti(HAND firstAxisHandle, short[] pStsArray, short count, NativeLongByReference pClock);

// 获取多轴规划模式
// firstAxisHandle:第一个轴句柄
// pModes:返回的数组
// count:轴数量
// pClock:返回当前控制器时钟
        short NMC_MtGetPrfModeMulti(HAND firstAxisHandle, short[] pModeArray, short count, NativeLongByReference pClock);
       
        short NMC_MtGetAxisPrfPosMulti(HAND firstAxisHandle, NativeLong[] pPosArray, short count, NativeLongByReference pClock);
        
        short NMC_MtGetAxisPrfVelMulti(HAND firstAxisHandle, double[] pVelArray, short count, NativeLongByReference pClock);
        
        short NMC_MtGetAxisPrfAccMulti(HAND firstAxisHandle, double[] pAccArray, short count, NativeLongByReference pClock);
       
        short NMC_MtGetAxisEncPosMulti(HAND firstAxisHandle, NativeLong[] pPosArray, short count, NativeLongByReference pClock);
       
        short NMC_MtGetAxisEncVelMulti(HAND firstAxisHandle, double[] pVelArray, short count, NativeLongByReference pClock);
       
        short NMC_MtGetAxisEncAccMulti(HAND firstAxisHandle, double[] pAccArray, short count, NativeLongByReference pClock);

// 获取多轴位置误差
        short NMC_MtGetAxisErrorMulti(HAND firstAxisHandle, NativeLong[] pErrArray, short count, NativeLongByReference pClock);
        
        short NMC_GetEncPosMulti(HAND devHandle, short encoder, NativeLong[] pEncPosArray, short count, NativeLongByReference pClock);

// 设置DI的滤波系数
// diType:DI类型,见DI type宏定义
// groupID:DI组,取值范围[0,n],对于DI_TYPE_GPI，则0: 本地DI31~DI0, 1: 本地DI63~DI32,其他指扩展IO模块；对于其他DI类型，暂时保留
// diIndex:DI通道号，取值范围[0,n]
// filtTime:滤波时间，单位ms，默认为3,取值范围[0,32],默认为3毫秒
        short NMC_SetDIFilter(HAND devHandle, short diType, short diGroup, short diIndex, short filtTime);

// 获取DI的滤波系数
        short NMC_GetDIFilter(HAND devHandle, short diType, short diGroup, short diIndex, ShortByReference pFiltTime);

// 读取数字量输入信号值
// diType:DI类型,见DI type宏定义
// groupID:DI组,取值范围[0,n],对于DI_TYPE_GPI，则0: 本地DI31~DI0, 1: 本地DI63~DI32,其他指扩展IO模块；对于其他DI类型，暂时保留
// pDiValue:返回的输入值
        short NMC_GetDIEx(HAND devHandle, short diType, short groupID, NativeLongByReference pDiValue);

// 读取数字量输入信号值(原始值)
// diType:DI类型,见DI type宏定义
// groupID:DI组,取值范围[0,n],对于DI_TYPE_GPI，则0: 本地DI31~DI0, 1: 本地DI63~DI32,其他指扩展IO模块；对于其他DI类型，暂时保留
// pDiValue:返回的输入值
        short NMC_GetDIRaw(HAND devHandle, short diType, short groupID, NativeLongByReference pDiValue);

// 设置数字量输入信号的翻转计数
// diType:DI类型,见DI type宏定义
// diIndex:DI序号，取值范围[0,n]，对于通用输入，只支持0~15，对于其他只支持0~7
// pReverseCountArray:返回的翻转计数数组
// count:同时获取的数量，取值范围[1,16]
        short NMC_SetDiReverseCount(HAND devHandle, short diType, short diIndex, NativeLong[] pReverseCountArray, short count);

// 获取数字量输入信号的翻转计数
// diType:DI类型,如DI_TYPE_GPI
// diIndex:DI序号，取值范围[0,n]
// pReverseCountArray:翻转计数数组
// count:同时获取的数量，取值范围[1,16]
        short NMC_GetDiReverseCount(HAND devHandle, short diType, short diIndex, NativeLong[] pReverseCountArray, short count);

// 按位设置及读取输入信号取反配置
// diType:输入类型,如DI_TYPE_GPI
// group:组号，目前只对于GPI有意义
// bitIndex:位序号，取值[0,31]
// revs:是否取反，0：不取反，默认值，1：取反
        short NMC_SetDIBitRevsEx(HAND devHandle, short diType, short group, short bitIndex, short revs);
        short NMC_GetDIBitRevsEx(HAND devHandle, short diType, short group, short bitIndex, ShortByReference pRevs);

// 输出DO,按照掩码
// doType:do类型
// groupID:组号
// outMask:按位输出掩码
// outValue:按位输出数值
        short NMC_SetDOMask(HAND devHandle, NativeLong outMask, NativeLong outValue, short doType, short groupID);

// 读取模拟量输入电压值
// ch:通道号，[0,n]表示本地，256表示扩展模拟量通道
// count:获取的通道数量,取值范围[1,8]
// pAdcVolArray:获取的电压值数组
        short NMC_GetAdcVoltageMulti(HAND devHandle, short ch, short count, double[] pAdcVolArray);

// 设置模拟量输出电压值
// ch:通道号，[0,n]表示本地，256表示扩展模拟量通道
// count:获取的通道数量,取值范围[1,8]
// pDacVolArray:获取的电压值数组
        short NMC_SetDacVoltageMulti(HAND devHandle, short ch, short count, double[] pDacVolArray);

// 读取模拟量输出电压值
// ch:通道号，[0,n]表示本地，256表示扩展模拟量通道
// count:获取的通道数量,取值范围[1,8]
// pDacVolArray:获取的电压值数组
        short NMC_GetDacVoltageMulti(HAND devHandle, short ch, short count, double[] pDacVolArray);

// 设置重复捕获次数
// count:重复捕获次数，取值范围[0,REPEAT_CAPT_MAX_NUM],0表示取消重复捕获
// 注意:设置后将清除捕获数据
        short NMC_MtSetCaptRepeat(HAND axisHandle, short count);

// 读取重复捕获计数
// pCount:已经捕获次数
        short NMC_MtGetCaptRepeatStatus(HAND axisHandle, ShortByReference pCount);

// 读取重复捕获位置值
// pPosArray:返回的位置值数组
// startNum:起始计数
// count:重复捕获次数，取值范围[1,32],一次最多读32个
        short NMC_MtGetCaptRepeatPosMulti(HAND axisHandle, NativeLong[] pPosArray, short startNum, short count);

// 获取中断的执行时间
// pServoRunTime:伺服周期当前值
// pProfileRunTime:规划周期当前值
        short NMC_GetInterruptTime(HAND devHandle, DoubleByReference pServoRunTime, DoubleByReference pProfileRunTime);

// 获取中断的最大执行时间
// pServoRunTimeMax:伺服周期最大值
// pProfileRunTimeMax:规划周期最大值
        short NMC_GetInterruptTimeMax(HAND devHandle, DoubleByReference pServoRunTimeMax, DoubleByReference pProfileRunTimeMax);

// 缓冲区停止坐标系运动
// crdIdx:停止坐标系序号，-1表示停止自身
        short NMC_CrdBufStopMtn(HAND crdHandle, NativeLong segNo, short crdIdx);

// 使能或关闭输入整形功能
// enable: 0:取消 1：使能
// bufCount: 整形的宽度
// kCoef: 整形的系数
        short NMC_MtSetAxisInputShaping(HAND axisHandle, short enable, short bufCount, double kCoef);

// 获取输出DO
// doType:do类型
// groupID:组号
// pOutValue:获取的数值
        short NMC_GetDOEx(HAND devHandle, short doType, short groupID, NativeLongByReference pOutValue);

// 按位设置通用输出信号取反
// doType:DO类型,例如：DO_TYPE_GPDO
// group:组号，暂时只对GPO有效，指DO的组号
// bitIndex:取值范围[0,n],位序号,前64位为本地的通用输出,大于64为扩展Do
// revs:是否取反,1：取反,0：不取反
        short NMC_SetDOBitRevsEx(HAND devHandle, short doType, short group, short bitIndex, short revs);

// 按位读取通用输出信号取反
        short NMC_GetDOBitRevsEx(HAND devHandle, short doType, short group, short bitIndex, ShortByReference pRevs);

// 获取坐标系状态
// pSts：crd状态，按位表示
// pUserSeg：当前的用户段号
        short NMC_CrdGetStsEx(HAND crdHandle, ShortByReference pSts, NativeLongByReference pUserSeg);

// 输入沿触发
// diIndex:通用输入序号，只支持通用输入信号，取值范围[0,32]
// diSns:触发沿，0为下降沿,1为上升沿
        short NMC_MtPtStartMtnEx(HAND axisHandle, short diIndex, short diSns);

// 设置补偿表：以XY为基准参考，标定XYZ方向的偏差数据，并进行设置
// tableIndex: 取值0（为后续扩展准备）
// pData:数据包含X*Y个点，点数组总长度X*Y*3<= 3000,每个点包含XYZ3个方向的补偿值,数组按照x方向排列
        short NMC_Set2DCompensationTable(HAND devHandle, short tableIndex, T2DCompensationTable pTable, TCompData[] pData);

// 获取补偿表
        short NMC_Get2DCompensationTable(HAND devHandle, short tableIndex, T2DCompensationTable pTable, TCompData[] pData);
        
// 设置并启动XY平面误差补偿
        short NMC_Set2DCompensation(HAND devHandle, T2DCompensation pComp);

// 获取XY平面的误差补偿参数
        short NMC_Get2DCompensation(HAND devHandle, T2DCompensation pComp);

// 设置PWM的输出通道
// portType: 0:默认通道，1：GPDO
// portIdx: 　映射通道号
// ch: PWM通道
        short NMC_SetPWMPort(HAND devHandle, short portType, short portIdx, short ch);

// 读取PWM的输出通道
        short NMC_GetPWMPort(HAND devHandle, ShortByReference pPortType, ShortByReference pGpoIdx, short ch);

//------------------------------------------------------------------------------------------------------------
//
//	28.PVT
//
//------------------------------------------------------------------------------------------------------------

// 设置PVT运动的相关参数 
// pPara：参数,参考结构定义
        short NMC_MtPvtSetPara(HAND axisHandle, TPvtPara pPara);

// 读取PVT运动的相关参数
        short NMC_MtPvtGetPara(HAND axisHandle, TPvtPara pPara);

// 向PVT运动缓存区中压运动数据段
// count:压入的数据段数：1~32
// pPosArray:段运行距离
// pTimeArray:段运行时间
// pVelArray:段运行速度
        short NMC_MtPvtData(HAND axisHandle, short count, double[] pPosArray, double[] pTimeArray, double[] pVelArray);

// 查询PVT数据剩余空间大小
// pFreeSpace:返回的剩余空间大小
// pUsedSpace: 已使用的空间段数
        short NMC_MtPvtBufGetSpace(HAND axisHandle, ShortByReference pFreeSpace, ShortByReference pUsedSpace);

// 清空PVT数据
        short NMC_MtPvtBufClr(HAND axisHandle);

// 启动Pvt运动
// otherSynAxCnts： 不包括axisHandle 的其RR_C他同步启动轴数量
// pOtherSynAxArray: 其他同步启动轴的序号：0~N	
// 注：同步的轴必须属于同一个控制器
        short NMC_MtPvtStartMtn(HAND axisHandle, short otherSynAxCnts, ShortByReference pOtherSynAxArray);

// 获取规划位置对应的补偿位置
// tableIndex: 补偿表序号，取值0（为后续扩展准备）
// posX,posY:补偿前的规划位置
// pCompPosX,pCompPosY,pCompPosZ:计算得到的补偿量
        short OEM_Get2DCompensationPos(HAND devHandle, short tableIndex, NativeLong posX, NativeLong posY, NativeLongByReference pCompPosX, NativeLongByReference pCompPosY, NativeLongByReference pCompPosZ);

//------------------------------------------------------------------------
//                                                     
//  Group 1 : 高速输入触发
//                                                   
//------------------------------------------------------------------------

        // 设置高级捕获参数
        // ch:通道号
        // pParam:参数
        short OEMLY_SetConfig(HAND devHandle,TAdvCaptureParamEx pParam,short ch);

        // 读取高级捕获参数
        short OEMLY_GetConfig(HAND devHandle,TAdvCaptureParamEx pParam,short ch);

        // 清除捕获数据
        short OEMLY_Clear(HAND devHandle,short ch);

        // 启动或关闭捕获
        short OEMLY_OnOff(HAND devHandle,short onOff,short ch);

        // 清除
        // firstAx：第一个轴,取值范围[0,n]
        // count：清除位置的轴数量
        // flag:0：用户坐标系零点，1：机械坐标系零点
        short OEMLY_ZeroPos(HAND devHandle,short firstAx,short count,short flag);
    
        // 获取采集状态
        // pSts：工作状态,按位表示，如上宏定义
        // pDataLenByte: 采集到的数据量,单位:Byte
        // pTrigCnt:触发计数
        short OEMLY_GetSts ( HAND devHandle, ShortByReference pSts, NativeLongByReference pTrigCnt,NativeLongByReference pDataLenByte ,short ch);

        // 获取采集数据
        // byteLenToGet：采集数据长度,单位byte，取值范围[8,1024]（单位：Byte,一次最多读1024字节）
        // pGetLenByte:实际返回的数据长度,单位:Byte
        // pData: 采集的数据,每个通道的一个数据为32Bit，读取的数据按顺序排列
        // 比如配置中capAxMask=0x3,则拿回来的数据，排列为：x1,y1,x2,y2,x3,y3....
        // 比如配置中capAxMask=0x7,则拿回来的数据，排列为：x1,y1,z1,x2,y2,z2,x3,y3,z3....
        // 以上（x1,y1,z1）指第一次触发采集到的数据，（x2,y2,z2）指第二次触发采集到的数据，依次类推
        short OEMLY_GetData ( HAND devHandle, short byteLenToGet, ShortByReference pGetLenByte,NativeLongByReference pData ,short ch);
    
    }

    private static final NativeLib lib = NativeLib.INSTANCE;

       public static short NMC_SetCommPara(HAND devHandle, NativeLong waitTimeInUs, NativeLong retryTimes) {
        return lib.NMC_SetCommPara(devHandle, waitTimeInUs, retryTimes);
    }

    public static short NMC_DevOpenByID(byte[] idStr, PHAND pDevHandle) {
        return lib.NMC_DevOpenByID(idStr, pDevHandle);
    }

    public static short NMC_DevOpenByIP(byte[] pIPv4Array, PHAND pDevHandle) {
        return lib.NMC_DevOpenByIP(pIPv4Array, pDevHandle);
    }

    public static short NMC_DevWriteID(HAND devHandle, byte[] pIdStr) {
        return lib.NMC_DevWriteID(devHandle, pIdStr);
    }

    public static short NMC_DevReadID(HAND devHandle, byte[] pIdStr) {
        return lib.NMC_DevReadID(devHandle, pIdStr);
    }

    public static short NMC_GetDllVersion(byte[] pVersion) {
        return lib.NMC_GetDllVersion(pVersion);
    }

    public static short NMC_GetMtLibVersion(HAND devHandle, TMtLibVersion pVersion) {
        return lib.NMC_GetMtLibVersion(devHandle, pVersion);
    }

    public static short NMC_GetCardInfo(HAND devHandle, TCardInfo pInfo) {
        return lib.NMC_GetCardInfo(devHandle, pInfo);
    }

    public static short NMC_GetCardInfoEx(HAND devHandle, TCardInfoEx pInfo) {
        return lib.NMC_GetCardInfoEx(devHandle, pInfo);
    }

    public static short NMC_DevIndexCheck(IntByReference instCardNum) {
        return lib.NMC_DevIndexCheck(instCardNum);
    }

    public static short NMC_SetCmdDebug(short enable, byte[] debugOutputFile) {
        return lib.NMC_SetCmdDebug(enable, debugOutputFile);
    }

    public static short NMC_GetErrDesc(short errCode, byte[] errDesc) {
        return lib.NMC_GetErrDesc(errCode, errDesc);
    }

    public static short NMC_LoadConfigFromFile(HAND devHandle, byte[] pFilePath) {
        return lib.NMC_LoadConfigFromFile(devHandle, pFilePath);
    }

    public static short NMC_SaveConfigToFile(HAND devHandle, byte[] pFilePath) {
        return lib.NMC_SaveConfigToFile(devHandle, pFilePath);
    }

    public static short NMC_SaveMotionConfig(HAND devHandle, short enable) {
        return lib.NMC_SaveMotionConfig(devHandle, enable);
    }

    public static short NMC_GetVersion(HAND devHandle, byte[] verArray) {
        return lib.NMC_GetVersion(devHandle, verArray);
    }

    public static short NMC_DevGetMcInfoFlag(HAND devHandle, byte[] flags) {
        return lib.NMC_DevGetMcInfoFlag(devHandle, flags);
    }

    public static short NMC_DevGetSts(HAND devHandle, NativeLong sts) {
        return lib.NMC_DevGetSts(devHandle, sts);
    }

    public static short NMC_MtGetPrfMode(HAND axisHandle, ShortByReference pMode) {
        return lib.NMC_MtGetPrfMode(axisHandle, pMode);
    }

    public static short NMC_MtGetPtpPara(HAND axisHandle, TPtpPara pAxPara) {
        return lib.NMC_MtGetPtpPara(axisHandle, pAxPara);
    }

    public static short NMC_MtGetJogPara(HAND axisHandle, TJogPara pAxPara) {
        return lib.NMC_MtGetJogPara(axisHandle, pAxPara);
    }

    public static short NMC_MtGetVel(HAND axisHandle, DoubleByReference pVel) {
        return lib.NMC_MtGetVel(axisHandle, pVel);
    }

    public static short NMC_MtGetPtpTgtPos(HAND axisHandle, NativeLongByReference pPos) {
        return lib.NMC_MtGetPtpTgtPos(axisHandle, pPos);
    }

    public static short NMC_GetEncPos(HAND devHandle, short encId, NativeLongByReference pPos) {
        return lib.NMC_GetEncPos(devHandle, encId, pPos);
    }

    public static short NMC_SetEncPos(HAND devHandle, short encId, NativeLong encPos) {
        return lib.NMC_SetEncPos(devHandle, encId, encPos);
    }

    public static short NMC_MtSetPosErrLmt(HAND axisHandle, NativeLong posErr) {
        return lib.NMC_MtSetPosErrLmt(axisHandle, posErr);
    }

    public static short NMC_MtGetPosErrLmt(HAND axisHandle, NativeLongByReference pPosErr) {
        return lib.NMC_MtGetPosErrLmt(axisHandle, pPosErr);
    }

    public static short NMC_GetEncMode(HAND devHandle, short encId, ShortByReference encMode) {
        return lib.NMC_GetEncMode(devHandle, encId, encMode);
    }

    public static short NMC_MtGetLmtOnOff(HAND axisHandle, ShortByReference pPosSwt, ShortByReference pNegSwt) {
        return lib.NMC_MtGetLmtOnOff(axisHandle, pPosSwt, pNegSwt);
    }

    public static short NMC_MtGetLmtSns(HAND axisHandle, ShortByReference pPosSwt, ShortByReference pNegSwt) {
        return lib.NMC_MtGetLmtSns(axisHandle, pPosSwt, pNegSwt);
    }

    public static short NMC_MtGetAlarmOnOff(HAND axisHandle, ShortByReference pSwt) {
        return lib.NMC_MtGetAlarmOnOff(axisHandle, pSwt);
    }

    public static short NMC_MtGetAlarmSns(HAND axisHandle, ShortByReference pSwt) {
        return lib.NMC_MtGetAlarmSns(axisHandle, pSwt);
    }

    public static short NMC_MtGetSwLmtOnOff(HAND axisHandle, ShortByReference pSwt) {
        return lib.NMC_MtGetSwLmtOnOff(axisHandle, pSwt);
    }

    public static short NMC_MtGetSwLmtValue(HAND axisHandle, NativeLongByReference pPosLmt, NativeLongByReference pNegLmt) {
        return lib.NMC_MtGetSwLmtValue(axisHandle, pPosLmt, pNegLmt);
    }

    public static short NMC_MtGetSafePara(HAND axisHandle, TSafePara pPara) {
        return lib.NMC_MtGetSafePara(axisHandle, pPara);
    }

    public static short NMC_MtGetStepMode(HAND axisHandle, ShortByReference pInv, ShortByReference pMode) {
        return lib.NMC_MtGetStepMode(axisHandle, pInv, pMode);
    }

    public static short NMC_MtGetAxisVelFilter(HAND axisHandle, ShortByReference pFilterCoef) {
        return lib.NMC_MtGetAxisVelFilter(axisHandle, pFilterCoef);
    }

    public static short NMC_MtGetHomePara(HAND axisHandle, THomeSetting pHomePara) {
        return lib.NMC_MtGetHomePara(axisHandle, pHomePara);
    }

    public static short NMC_MtGetAxisPos(HAND axisHandle, NativeLongByReference pPos) {
        return lib.NMC_MtGetAxisPos(axisHandle, pPos);
    }

    public static short NMC_MtGetCmdPos(HAND axisHandle, NativeLongByReference pPos) {
        return lib.NMC_MtGetCmdPos(axisHandle, pPos);
    }

    public static short NMC_MtSetAxisPos(HAND axisHandle, NativeLong axisPos) {
        return lib.NMC_MtSetAxisPos(axisHandle, axisPos);
    }

    public static short NMC_MtSetEncPos(HAND axisHandle, NativeLong encPos) {
        return lib.NMC_MtSetEncPos(axisHandle, encPos);
    }

    public static short NMC_MtPrfConfig(HAND axisHandle, short mapAxisNo, short port, NativeLong startPos) {
        return lib.NMC_MtPrfConfig(axisHandle, mapAxisNo, port, startPos);
    }

    public static short NMC_MtGetPrfConfig(HAND axisHandle, ShortByReference mapAxisNo, ShortByReference port, NativeLong startPos) {
        return lib.NMC_MtGetPrfConfig(axisHandle, mapAxisNo, port, startPos);
    }

    public static short NMC_MtSetPrfCoe(HAND axisHandle, double inCoe) {
        return lib.NMC_MtSetPrfCoe(axisHandle, inCoe);
    }

    public static short NMC_MtGetPrfCoe(HAND axisHandle, DoubleByReference pInCoe) {
        return lib.NMC_MtGetPrfCoe(axisHandle, pInCoe);
    }

    public static short NMC_MtSetEncCoe(HAND axisHandle, double encCoe) {
        return lib.NMC_MtSetEncCoe(axisHandle, encCoe);
    }

    public static short NMC_MtGetEncCoe(HAND axisHandle, DoubleByReference pEncCoe) {
        return lib.NMC_MtGetEncCoe(axisHandle, pEncCoe);
    }

    public static short NMC_MtSetAxisArrivalPara(HAND axisHandle, NativeLong arrivalBand, NativeLong stableTime) {
        return lib.NMC_MtSetAxisArrivalPara(axisHandle, arrivalBand, stableTime);
    }

    public static short NMC_MtGetAxisArrivalPara(HAND axisHandle, NativeLongByReference pArrivalBand, NativeLongByReference pStableTime) {
        return lib.NMC_MtGetAxisArrivalPara(axisHandle, pArrivalBand, pStableTime);
    }

    public static short NMC_MtSetLeadScrewCompPara(HAND axisHandle, short num, NativeLong startPos, NativeLong cmpLen, short[] pCompPos, short[] pCompNeg) {
        return lib.NMC_MtSetLeadScrewCompPara(axisHandle, num, startPos, cmpLen, pCompPos, pCompNeg);
    }

    public static short NMC_MtEnableLeadScrew(HAND axisHandle, short enable) {
        return lib.NMC_MtEnableLeadScrew(axisHandle, enable);
    }

    public static short NMC_MtSetBacklash(HAND axisHandle, NativeLong compValue, double compDelta, NativeLong compDir) {
        return lib.NMC_MtSetBacklash(axisHandle, compValue, compDelta, compDir);
    }

    public static short NMC_MtGetBacklash(HAND axisHandle, NativeLongByReference pCompValue, DoubleByReference pCompDelta, NativeLongByReference pCompDir) {
        return lib.NMC_MtGetBacklash(axisHandle, pCompValue, pCompDelta, pCompDir);
    }

    public static short NMC_MtSetEstopDI(HAND axisHandle, short gpiIndex, short sense) {
        return lib.NMC_MtSetEstopDI(axisHandle, gpiIndex, sense);
    }

    public static short NMC_MtGetEstopDI(HAND axisHandle, ShortByReference gpiIndex, ShortByReference sense) {
        return lib.NMC_MtGetEstopDI(axisHandle, gpiIndex, sense);
    }

    public static short NMC_MtSetEstopDIMask(HAND axisHandle, NativeLong gpiMask, NativeLong senseMask) {
        return lib.NMC_MtSetEstopDIMask(axisHandle, gpiMask, senseMask);
    }

    public static short NMC_MtGetEstopDIMask(HAND axisHandle, NativeLongByReference pGpiMask, NativeLongByReference pSenseMask) {
        return lib.NMC_MtGetEstopDIMask(axisHandle, pGpiMask, pSenseMask);
    }

    public static short NMC_SetEstopDIEx(HAND devHandle, TEstopExParam pParam, short group) {
        return lib.NMC_SetEstopDIEx(devHandle, pParam, group);
    }

    public static short NMC_GetEstopDIEx(HAND devHandle, TEstopExParam pParam, short group) {
        return lib.NMC_GetEstopDIEx(devHandle, pParam, group);
    }

    public static short NMC_CrdBufEstopDIExOnOff(HAND crdHandle, NativeLong segNo, short onOff, short group) {
        return lib.NMC_CrdBufEstopDIExOnOff(crdHandle, segNo, onOff, group);
    }

    public static short NMC_ClrEstopDIEx(HAND devHandle, short group) {
        return lib.NMC_ClrEstopDIEx(devHandle, group);
    }

    public static short NMC_MtSetAdvCaptParam(HAND devHandle, TAdvCaptureParam pParam, short ch) {
        return lib.NMC_MtSetAdvCaptParam(devHandle, pParam, ch);
    }

    public static short NMC_MtClrAdvCaptSts(HAND devHandle, short ch) {
        return lib.NMC_MtClrAdvCaptSts(devHandle, ch);
    }

    public static short NMC_MtGetAdvCaptPos(HAND devHandle, ShortByReference captSts, NativeLong[] pPosArray, short ch) {
        return lib.NMC_MtGetAdvCaptPos(devHandle, captSts, pPosArray, ch);
    }

    public static short NMC_MtSetAxisDampCompParam(HAND axisHandle, short enable, short param1, short param2) {
        return lib.NMC_MtSetAxisDampCompParam(axisHandle, enable, param1, param2);
    }

    public static short NMC_MtSetPosErrAction(HAND axisHandle, short actionsBits) {
        return lib.NMC_MtSetPosErrAction(axisHandle, actionsBits);
    }

    public static short NMC_MtGetPosErrAction(HAND axisHandle, ShortByReference pActionsBits) {
        return lib.NMC_MtGetPosErrAction(axisHandle, pActionsBits);
    }

    public static short NMC_CrdSetExtPara(HAND crdHandle, TExtCrdPara extCrdPara) {
        return lib.NMC_CrdSetExtPara(crdHandle, extCrdPara);
    }

    public static short NMC_CrdSetLookaheadPara(HAND crdHandle, TLookaheadPara lkhPara) {
        return lib.NMC_CrdSetLookaheadPara(crdHandle, lkhPara);
    }

    public static short NMC_CrdSetStartVel(HAND crdHandle, double startVel) {
        return lib.NMC_CrdSetStartVel(crdHandle, startVel);
    }

    public static short NMC_CrdLineDbXYZA(HAND crdHandle, NativeLong segNo, short mask, double[] pTgPosArray, double endVel, double vel, double synAcc, short lookaheadDis) {
        return lib.NMC_CrdLineDbXYZA(crdHandle, segNo, mask, pTgPosArray, endVel, vel, synAcc, lookaheadDis);
    }

    public static short NMC_CrdGetLookaheadPara(HAND crdHandle, TLookaheadPara lkhPara, short defaultFlag) {
        return lib.NMC_CrdGetLookaheadPara(crdHandle, lkhPara, defaultFlag);
    }

    public static short NMC_EnableCrdSdram(HAND crdHandle, short enFlag) {
        return lib.NMC_EnableCrdSdram(crdHandle, enFlag);
    }

    public static short NMC_CrdGetExtPara(HAND crdHandle, TExtCrdPara extCrdPara) {
        return lib.NMC_CrdGetExtPara(crdHandle, extCrdPara);
    }

    public static short NMC_CrdSetArcSecPara(HAND crdHandle, TArcSecSetting pSetting) {
        return lib.NMC_CrdSetArcSecPara(crdHandle, pSetting);
    }

    public static short NMC_CrdGetArcSecPara(HAND crdHandle, TArcSecSetting pSetting) {
        return lib.NMC_CrdGetArcSecPara(crdHandle, pSetting);
    }

    public static short NMC_CrdSetPara(HAND crdHandle, TCrdPara pCrdPara) {
        return lib.NMC_CrdSetPara(crdHandle, pCrdPara);
    }

    public static short NMC_CrdGetConfig(HAND crdHandle, TCrdConfig pConfig) {
        return lib.NMC_CrdGetConfig(crdHandle, pConfig);
    }

    public static short NMC_CrdGetPara(HAND crdHandle, TCrdPara pCrdPara) {
        return lib.NMC_CrdGetPara(crdHandle, pCrdPara);
    }

    public static short NMC_CrdGetOverRide(HAND crdHandle, DoubleByReference pOverRide) {
        return lib.NMC_CrdGetOverRide(crdHandle, pOverRide);
    }

    public static short NMC_CrdGetInnerSts(HAND crdHandle, NativeLongByReference pStsWord) {
        return lib.NMC_CrdGetInnerSts(crdHandle, pStsWord);
    }

    public static short NMC_CrdModifyOffset(HAND crdHandle, NativeLong[] pOffsetArray, short cnt) {
        return lib.NMC_CrdModifyOffset(crdHandle, pOffsetArray, cnt);
    }

    public static short NMC_CrdBufSetEstopDI(HAND crdHandle, NativeLong segNo, short axis, short gpiIndex, short sense) {
        return lib.NMC_CrdBufSetEstopDI(crdHandle, segNo, axis, gpiIndex, sense);
    }

    public static short NMC_CrdBufDataPack(HAND crdHandle, byte[] pBufData, short dataLen) {
        return lib.NMC_CrdBufDataPack(crdHandle, pBufData, dataLen);
    }

    public static short NMC_CrdBufSetStopOffset(HAND crdHandle, NativeLong segNo, short axis, short gpiIndex, short sense, short useCaptPos) {
        return lib.NMC_CrdBufSetStopOffset(crdHandle, segNo, axis, gpiIndex, sense, useCaptPos);
    }

    public static short NMC_CrdBufClrStopOffset(HAND crdHandle, NativeLong segNo, short axis) {
        return lib.NMC_CrdBufClrStopOffset(crdHandle, segNo, axis);
    }

    public static short NMC_CrdSetBufLengthFlag(HAND crdHandle, short flag) {
        return lib.NMC_CrdSetBufLengthFlag(crdHandle, flag);
    }

    public static short NMC_CrdGetBufLength(HAND crdHandle, DoubleByReference pLen) {
        return lib.NMC_CrdGetBufLength(crdHandle, pLen);
    }

    public static short NMC_CrdSetIsShortLine(HAND crdHandle, short isShortLine) {
        return lib.NMC_CrdSetIsShortLine(crdHandle, isShortLine);
    }

    public static short NMC_CrdSetLookAheadCentriAcc(HAND crdHandle, short isUsingSetAcc, double centriAcc) {
        return lib.NMC_CrdSetLookAheadCentriAcc(crdHandle, isUsingSetAcc, centriAcc);
    }

    public static short NMC_MtSetCaptSns(HAND axisHandle, short mode, short ioSrc, short level) {
        return lib.NMC_MtSetCaptSns(axisHandle, mode, ioSrc, level);
    }

    public static short NMC_MtGetCaptSns(HAND axisHandle, ShortByReference pMode, ShortByReference pIoSrc, ShortByReference pLevel) {
        return lib.NMC_MtGetCaptSns(axisHandle, pMode, pIoSrc, pLevel);
    }

    public static short NMC_MtSetCapt(HAND axisHandle) {
        return lib.NMC_MtSetCapt(axisHandle);
    }

    public static short NMC_MtClrCaptSts(HAND axisHandle) {
        return lib.NMC_MtClrCaptSts(axisHandle);
    }

    public static short NMC_MtGetCaptPos(HAND axisHandle, NativeLongByReference pPos) {
        return lib.NMC_MtGetCaptPos(axisHandle, pPos);
    }

    public static short NMC_MtGetStepFilter(HAND axisHandle, ShortByReference pCoe) {
        return lib.NMC_MtGetStepFilter(axisHandle, pCoe);
    }

    public static short NMC_MtUpdateMulti(HAND axisHandle, NativeLong axisMask) {
        return lib.NMC_MtUpdateMulti(axisHandle, axisMask);
    }

    public static short NMC_MtStopMulti(HAND axisHandle, NativeLong axisMask) {
        return lib.NMC_MtStopMulti(axisHandle, axisMask);
    }

    public static short NMC_SetDIBitRevs(HAND devHandle, short bitIndex, short revs) {
        return lib.NMC_SetDIBitRevs(devHandle, bitIndex, revs);
    }

    public static short NMC_GetDIBitRevs(HAND devHandle, short bitIndex, ShortByReference pRevs) {
        return lib.NMC_GetDIBitRevs(devHandle, bitIndex, pRevs);
    }

    public static short NMC_SetDOBitRevs(HAND devHandle, short bitIndex, short revs) {
        return lib.NMC_SetDOBitRevs(devHandle, bitIndex, revs);
    }

    public static short NMC_GetDOBitRevs(HAND devHandle, short bitIndex, ShortByReference pRevs) {
        return lib.NMC_GetDOBitRevs(devHandle, bitIndex, pRevs);
    }

    public static short NMC_SetDOBitAutoReverse(HAND devHandle, short bitIndex, short value, short reverseTime) {
        return lib.NMC_SetDOBitAutoReverse(devHandle, bitIndex, value, reverseTime);
    }

    public static short NMC_SetDioMapping(HAND devHandle, TDioMappingCfg[] pDioCfg) {
        return lib.NMC_SetDioMapping(devHandle, pDioCfg);
    }

    public static short NMC_GetAllDioMapping(HAND devHandle, TDioMappingCfg[] pDioCfg) {
        return lib.NMC_GetAllDioMapping(devHandle, pDioCfg);
    }

    public static short NMC_ClrAllDioMapping(HAND devHandle) {
        return lib.NMC_ClrAllDioMapping(devHandle);
    }

    public static short NMC_SetVar8B(HAND devHandle, NativeLong varID, Long value) {
        return lib.NMC_SetVar8B(devHandle, varID, value);
    }

    public static short NMC_GetVar8B(HAND devHandle, NativeLong varID, NativeLongByReference pValue) {
        return lib.NMC_GetVar8B(devHandle, varID, pValue);
    }

    public static short NMC_SysSetVar8B(HAND devHandle, NativeLong varID, long value) {
        return lib.NMC_SysSetVar8B(devHandle, varID, value);
    }

    public static short NMC_SysGetVar8B(HAND devHandle, NativeLong varID, long pValue) {
        return lib.NMC_SysGetVar8B(devHandle, varID, pValue);
    }

    public static short NMC_BackSramWrite(HAND devHandle, byte[] src, NativeLong len, NativeLong off) {
        return lib.NMC_BackSramWrite(devHandle, src, len, off);
    }

    public static short NMC_BackSramRead(HAND devHandle, byte[] dst, NativeLong len, NativeLong off) {
        return lib.NMC_BackSramRead(devHandle, dst, len, off);
    }

    public static short NMC_GetTime(HAND devHandle, TNMCTime pTime) {
        return lib.NMC_GetTime(devHandle, pTime);
    }

    public static short NMC_SetTime(HAND devHandle, TNMCTime pTime, byte[] pPassword) {
        return lib.NMC_SetTime(devHandle, pTime, pPassword);
    }

    public static short NMC_ChangePassword(HAND devHandle, byte[] pPasswordOld, byte[] pPasswordNew) {
        return lib.NMC_ChangePassword(devHandle, pPasswordOld, pPasswordNew);
    }

    public static short NMC_VerifyPassword(HAND devHandle, byte[] pPassword) {
        return lib.NMC_VerifyPassword(devHandle, pPassword);
    }

    public static short NMC_ClrPassword(HAND devHandle, ShortByReference pData) {
        return lib.NMC_ClrPassword(devHandle, pData);
    }

    public static short NMC_GetUID(HAND devHandle, NativeLong pUID) {
        return lib.NMC_GetUID(devHandle, pUID);
    }

    public static short NMC_UserParaWr(HAND devHandle, NativeLong add, NativeLong len, byte[] pWrData) {
        return lib.NMC_UserParaWr(devHandle, add, len, pWrData);
    }

    public static short NMC_UserParaRd(HAND devHandle, NativeLong add, NativeLong len, byte[] pRdData) {
        return lib.NMC_UserParaRd(devHandle, add, len, pRdData);
    }

    public static short NMC_UserParaWrEx(HAND devHandle, NativeLong add, NativeLong len, byte[] pWrData) {
        return lib.NMC_UserParaWrEx(devHandle, add, len, pWrData);
    }

    public static short NMC_UserParaRdEx(HAND devHandle, NativeLong add, NativeLong len, byte[] pRdData) {
        return lib.NMC_UserParaRdEx(devHandle, add, len, pRdData);
    }

    public static short NMC_GetBackedVarGroup1(HAND devHandle, TBackGroup1 pBackVar) {
        return lib.NMC_GetBackedVarGroup1(devHandle, pBackVar);
    }

    public static short NMC_GetBackedVarGroup2(HAND devHandle, TBackGroup2 pBackVar) {
        return lib.NMC_GetBackedVarGroup2(devHandle, pBackVar);
    }

    public static short NMC_SetBackedVarOnOff(HAND devHandle, short en) {
        return lib.NMC_SetBackedVarOnOff(devHandle, en);
    }

    public static short NMC_GetBackedVarOnOff(HAND devHandle, ShortByReference pEn) {
        return lib.NMC_GetBackedVarOnOff(devHandle, pEn);
    }

    public static short NMC_DevGetPara(HAND devHandle, NativeLong paraID, NativeLongByReference pValue) {
        return lib.NMC_DevGetPara(devHandle, paraID, pValue);
    }

    public static short NMC_DevSetPara(HAND devHandle, NativeLong paraID, NativeLong value) {
        return lib.NMC_DevSetPara(devHandle, paraID, value);
    }

    public static short NMC_UserSetPassword(HAND devHandle, byte[] pUserName, byte[] pPasswordOld, byte[] pPasswordNew) {
        return lib.NMC_UserSetPassword(devHandle, pUserName, pPasswordOld, pPasswordNew);
    }

    public static short NMC_UserLogin(HAND devHandle, byte[] pUserName, byte[] pPassword) {
        return lib.NMC_UserLogin(devHandle, pUserName, pPassword);
    }

    public static short NMC_UserLogout(HAND devHandle, byte[] pUserName) {
        return lib.NMC_UserLogout(devHandle, pUserName);
    }

    public static short NMC_SetProfilePeriod(HAND devHandle, short period) {
        return lib.NMC_SetProfilePeriod(devHandle, period);
    }

    public static short NMC_GetProfilePeriod(HAND devHandle, ShortByReference pPeriod) {
        return lib.NMC_GetProfilePeriod(devHandle, pPeriod);
    }

    public static short NMC_UserPrint(byte[] msg) {
        return lib.NMC_UserPrint(msg);
    }

    public static short NMC_DevGetOutputMsg(HAND devHandle, byte[] szBuf, short maxLen, ShortByReference pGetLen) {
        return lib.NMC_DevGetOutputMsg(devHandle, szBuf, maxLen, pGetLen);
    }

    public static short NMC_GetCollectDataAddr(HAND devHandle, short index, short dataType, NativeLongByReference pAddr, ShortByReference pDataLen) {
        return lib.NMC_GetCollectDataAddr(devHandle, index, dataType, pAddr, pDataLen);
    }

    public static short NMC_ConfigCollect(HAND devHandle, TCollectCfg pCollect, TCollectTrig pTrig) {
        return lib.NMC_ConfigCollect(devHandle, pCollect, pTrig);
    }

    public static short NMC_CollectOnOff(HAND devHandle, short en) {
        return lib.NMC_CollectOnOff(devHandle, en);
    }

    public static short NMC_GetCollectSts(HAND devHandle, ShortByReference pSts, NativeLongByReference pDataLen) {
        return lib.NMC_GetCollectSts(devHandle, pSts, pDataLen);
    }

    public static short NMC_GetCollectData(HAND devHandle, short len, byte[] pData) {
        return lib.NMC_GetCollectData(devHandle, len, pData);
    }

    public static short NMC_ClearCollectSts(HAND devHandle) {
        return lib.NMC_ClearCollectSts(devHandle);
    }

    public static short NMC_LaserSetMode(HAND devHandle, short mode, short ch) {
        return lib.NMC_LaserSetMode(devHandle, mode, ch);
    }

    public static short NMC_LaserSetOutputType(HAND devHandle, short outputType, short index, NativeLong optionVal, short ch) {
        return lib.NMC_LaserSetOutputType(devHandle, outputType, index, optionVal, ch);
    }

    public static short NMC_LaserSetOutputTypeEx(HAND devHandle, short outputType, short index, double optionVal, short ch) {
        return lib.NMC_LaserSetOutputTypeEx(devHandle, outputType, index, optionVal, ch);
    }

    public static short NMC_LaserSetPower(HAND devHandle, NativeLong outVal, short ch) {
        return lib.NMC_LaserSetPower(devHandle, outVal, ch);
    }

    public static short NMC_LaserGetPower(HAND devHandle, DoubleByReference pVal, short ch) {
        return lib.NMC_LaserGetPower(devHandle, pVal, ch);
    }

    public static short NMC_LaserGetOnOff(HAND devHandle, ShortByReference pOnOffState, short ch) {
        return lib.NMC_LaserGetOnOff(devHandle, pOnOffState, ch);
    }

    public static short NMC_LaserSetPowerEx(HAND devHandle, double outVal, short ch) {
        return lib.NMC_LaserSetPowerEx(devHandle, outVal, ch);
    }

    public static short NMC_LaserOnOff(HAND devHandle, short onOff, short ch) {
        return lib.NMC_LaserOnOff(devHandle, onOff, ch);
    }

    public static short NMC_LaserSetParam(HAND devHandle, NativeLong onDelay, NativeLong offDelay, NativeLong minValue, NativeLong maxValue, NativeLong standbyPower, short ch) {
        return lib.NMC_LaserSetParam(devHandle, onDelay, offDelay, minValue, maxValue, standbyPower, ch);
    }

    public static short NMC_CrdBufLaserSetParam(HAND crdHandle, NativeLong segment, NativeLong onDelay, NativeLong offDelay, NativeLong minValue, NativeLong maxValue, NativeLong standbyPower, short ch) {
        return lib.NMC_CrdBufLaserSetParam(crdHandle, segment, onDelay, offDelay, minValue, maxValue, standbyPower, ch);
    }

    public static short NMC_LaserGetParam(HAND devHandle, NativeLongByReference pOnDelay, NativeLongByReference pOffDelay, NativeLongByReference pMinValue, NativeLongByReference pMaxValue, NativeLongByReference pStandbyPower, short ch) {
        return lib.NMC_LaserGetParam(devHandle, pOnDelay, pOffDelay, pMinValue, pMaxValue, pStandbyPower, ch);
    }

    public static short NMC_CrdBufLaserSetFollow(HAND crdHandle, NativeLong segNo, double overRide, short followType, short ch) {
        return lib.NMC_CrdBufLaserSetFollow(crdHandle, segNo, overRide, followType, ch);
    }

    public static short NMC_LaserSetFollowParam(HAND devHandle, short powerFilter, short followAdvMode, short ch) {
        return lib.NMC_LaserSetFollowParam(devHandle, powerFilter, followAdvMode, ch);
    }

    public static short NMC_CrdBufLaserOnOff(HAND crdHandle, NativeLong segNo, short onOff, short ch) {
        return lib.NMC_CrdBufLaserOnOff(crdHandle, segNo, onOff, ch);
    }

    public static short NMC_CrdBufLaserPower(HAND crdHandle, NativeLong segNo, NativeLong power, short ch) {
        return lib.NMC_CrdBufLaserPower(crdHandle, segNo, power, ch);
    }

    public static short NMC_SetLaserPowerCmpTable(HAND devHandle, short tableNo, NativeLongByReference pXCmpPos, NativeLongByReference pYCmpPos, short xCount, short yCount, NativeLong powerMin, NativeLong powerMax, NativeLongByReference pLaserCmpPower, short chn) {
        return lib.NMC_SetLaserPowerCmpTable(devHandle, tableNo, pXCmpPos, pYCmpPos, xCount, yCount, powerMin, powerMax, pLaserCmpPower, chn);
    }

    public static short NMC_StartLaserPowerComp(HAND devHandle, ShortByReference pAxisNo, short chn) {
        return lib.NMC_StartLaserPowerComp(devHandle, pAxisNo, chn);
    }

    public static short NMC_StopLaserPowerComp(HAND devHandle, short chn) {
        return lib.NMC_StopLaserPowerComp(devHandle, chn);
    }

    public static short NMC_LaserSetTimeArrayPara(HAND devHandle, TTimeArrayPara pPara, short ch) {
        return lib.NMC_LaserSetTimeArrayPara(devHandle, pPara, ch);
    }

    public static short NMC_LaserSetTimeArrayPower(HAND devHandle, short group, TLaserPower pLaserPower) {
        return lib.NMC_LaserSetTimeArrayPower(devHandle, group, pLaserPower);
    }

    public static short NMC_LaserTimeArrayExe(HAND devHandle, short group, short ch) {
        return lib.NMC_LaserTimeArrayExe(devHandle, group, ch);
    }

    public static short NMC_CrdBufLaserTimeArrayExe(HAND crdHandle, NativeLong segNo, short group, short ch) {
        return lib.NMC_CrdBufLaserTimeArrayExe(crdHandle, segNo, group, ch);
    }

    public static short NMC_SHIOConfigPara(HAND devHandle, TSHIOPara pSHIOPara, short ch) {
        return lib.NMC_SHIOConfigPara(devHandle, pSHIOPara, ch);
    }

    public static short NMC_SHIOEnableMinFrq(HAND devHandle, NativeLong minFrq, short ch) {
        return lib.NMC_SHIOEnableMinFrq(devHandle, minFrq, ch);
    }

    public static short NMC_SHIODisableMinFrq(HAND devHandle, short ch) {
        return lib.NMC_SHIODisableMinFrq(devHandle, ch);
    }

    public static short NMC_CrdBufSHIOConfigPara(HAND crdHandle, NativeLong segment, TSHIOPara pSHIOPara, short ch) {
        return lib.NMC_CrdBufSHIOConfigPara(crdHandle, segment, pSHIOPara, ch);
    }

    public static short NMC_CrdBufSHIOSetMinFrq(HAND crdHandle, NativeLong segment, NativeLong minFrq, short ch) {
        return lib.NMC_CrdBufSHIOSetMinFrq(crdHandle, segment, minFrq, ch);
    }

    public static short NMC_CrdBufSHIOClrMinFrq(HAND crdHandle, NativeLong segment, short ch) {
        return lib.NMC_CrdBufSHIOClrMinFrq(crdHandle, segment, ch);
    }

    public static short NMC_CrdBufSHIOSetParam(HAND crdHandle, NativeLong segment, double delay, double gateTime, double gateDistance, short ch) {
        return lib.NMC_CrdBufSHIOSetParam(crdHandle, segment, delay, gateTime, gateDistance, ch);
    }

    public static short NMC_SHIOChangeAxisMask(HAND devHandle, short axisMask, short ch) {
        return lib.NMC_SHIOChangeAxisMask(devHandle, axisMask, ch);
    }

    public static short NMC_CrdBufSHIOChangeAxisMask(HAND crdHandle, NativeLong segment, short axisMask, short ch) {
        return lib.NMC_CrdBufSHIOChangeAxisMask(crdHandle, segment, axisMask, ch);
    }

    public static short NMC_SHIOGateOn(HAND devHandle, short ch) {
        return lib.NMC_SHIOGateOn(devHandle, ch);
    }

    public static short NMC_SHIOGateOff(HAND devHandle, short ch) {
        return lib.NMC_SHIOGateOff(devHandle, ch);
    }

    public static short NMC_SHIOTriggerOn(HAND devHandle, double freq, double width, short ch) {
        return lib.NMC_SHIOTriggerOn(devHandle, freq, width, ch);
    }

    public static short NMC_SHIOTriggerOff(HAND devHandle, short ch) {
        return lib.NMC_SHIOTriggerOff(devHandle, ch);
    }

    public static short NMC_BufSHIOGateOn(HAND crdHandle, NativeLong segNo, short ch) {
        return lib.NMC_BufSHIOGateOn(crdHandle, segNo, ch);
    }

    public static short NMC_BufSHIOGateOff(HAND crdHandle, NativeLong segNo, short ch) {
        return lib.NMC_BufSHIOGateOff(crdHandle, segNo, ch);
    }

    public static short NMC_SetPwmToGate(HAND devHandle, short pwmCh, short gateCh, short onOff) {
        return lib.NMC_SetPwmToGate(devHandle, pwmCh, gateCh, onOff);
    }

    public static short NMC_CrdBufSHIOGatePulse(HAND crdHandle, NativeLong segNo, double gateTime, double gateFrq, NativeLong outCount, short ch) {
        return lib.NMC_CrdBufSHIOGatePulse(crdHandle, segNo, gateTime, gateFrq, outCount, ch);
    }

    public static short NMC_SHIOGatePulse(HAND devHandle, double gateTime, double gateFrq, NativeLong outCount, short ch) {
        return lib.NMC_SHIOGatePulse(devHandle, gateTime, gateFrq, outCount, ch);
    }

    public static short NMC_PwmPulseOut(HAND devHandle, double onTime, double pwmFrq, NativeLong outCount, short ch) {
        return lib.NMC_PwmPulseOut(devHandle, onTime, pwmFrq, outCount, ch);
    }

    public static short NMC_SetGantryMaster(HAND axisHandle, short group) {
        return lib.NMC_SetGantryMaster(axisHandle, group);
    }

    public static short NMC_SetGantrySlave(HAND axisHandle, short group, NativeLong gantryErrLmt) {
        return lib.NMC_SetGantrySlave(axisHandle, group, gantryErrLmt);
    }

    public static short NMC_DelGantryGroup(HAND axisHandle, short group) {
        return lib.NMC_DelGantryGroup(axisHandle, group);
    }

    public static short NMC_UserCmdWrite(HAND devHandle, byte[] sendBuffer, NativeLong sendLen) {
        return lib.NMC_UserCmdWrite(devHandle, sendBuffer, sendLen);
    }

    public static short NMC_UserCmdRead(HAND devHandle, byte[] sendBuffer, NativeLong sendLen, byte[] recBuffer, NativeLong waitLen) {
        return lib.NMC_UserCmdRead(devHandle, sendBuffer, sendLen, recBuffer, waitLen);
    }

    public static short NMC_DataTransfer(HAND devHandle, byte[] sendBuffer, NativeLong sendLen) {
        return lib.NMC_DataTransfer(devHandle, sendBuffer, sendLen);
    }

    public static short NMC_SysSetUserApp(HAND devHandle, byte mode) {
        return lib.NMC_SysSetUserApp(devHandle, mode);
    }

    public static short NMC_SysUpgrade(HAND devHandle) {
        return lib.NMC_SysUpgrade(devHandle);
    }

    public static short NMC_SysUpgradeEx(HAND devHandle, byte cmd, byte[] sendBuffer, NativeLong sendLen, byte[] recBuffer, NativeLong recvedLen) {
        return lib.NMC_SysUpgradeEx(devHandle, cmd, sendBuffer, sendLen, recBuffer, recvedLen);
    }

    public static short NMC_SetDebugErrorEn(HAND devHandle, short debugErrEn) {
        return lib.NMC_SetDebugErrorEn(devHandle, debugErrEn);
    }

    public static short NMC_GetLastErr() {
        return lib.NMC_GetLastErr();
    }

    public static short NMC_SetErrCodeMode(short mode) {
        return lib.NMC_SetErrCodeMode(mode);
    }

    public static short NMC_SetWatchDog(HAND devHandle, NativeLong timeout, short stopMode, short groupID, NativeLong doValue) {
        return lib.NMC_SetWatchDog(devHandle, timeout, stopMode, groupID, doValue);
    }

    public static short NMC_ClrHandWheel(HAND devHandle) {
        return lib.NMC_ClrHandWheel(devHandle);
    }

    public static short NMC_SetHandWheel(HAND devHandle, short axis, double ratio, double acc, double vel) {
        return lib.NMC_SetHandWheel(devHandle, axis, ratio, acc, vel);
    }

    public static short NMC_SetHandWheelInput(HAND devHandle, short index) {
        return lib.NMC_SetHandWheelInput(devHandle, index);
    }

    public static short NMC_SetHandWheelRatio(HAND devHandle, double ratio) {
        return lib.NMC_SetHandWheelRatio(devHandle, ratio);
    }

    public static short NMC_MtPtSetPara(HAND axisHandle, TPtPara pPara) {
        return lib.NMC_MtPtSetPara(axisHandle, pPara);
    }

    public static short NMC_MtPtSetStatic(HAND axisHandle, short onOff, NativeLong loopCount) {
        return lib.NMC_MtPtSetStatic(axisHandle, onOff, loopCount);
    }

    public static short NMC_MtPtGetStatic(HAND axisHandle, ShortByReference pOnOff, NativeLongByReference pLoopCount) {
        return lib.NMC_MtPtGetStatic(axisHandle, pOnOff, pLoopCount);
    }

    public static short NMC_MtPtGetSpace(HAND axisHandle, ShortByReference pSpace, ShortByReference pUsed) {
        return lib.NMC_MtPtGetSpace(axisHandle, pSpace, pUsed);
    }

    public static short NMC_MtPtPush(HAND axisHandle, short count, double[] pPosArray, NativeLong[] pTimeArray, short[] pTypeArray) {
        return lib.NMC_MtPtPush(axisHandle, count, pPosArray, pTimeArray, pTypeArray);
    }

    public static short NMC_MtPtBufClr(HAND axisHandle) {
        return lib.NMC_MtPtBufClr(axisHandle);
    }

    public static short NMC_MtPtStartMtn(HAND axisHandle, short otherSynAxCnts, ShortByReference pOtherSynAxArray) {
        return lib.NMC_MtPtStartMtn(axisHandle, otherSynAxCnts, pOtherSynAxArray);
    }

    public static short NMC_PtExOpen(HAND devHandle, short chn, PHAND pHandle) {
        return lib.NMC_PtExOpen(devHandle, chn, pHandle);
    }

    public static short NMC_PtExSetPara(HAND ptExHandle, TPtExPara pPara) {
        return lib.NMC_PtExSetPara(ptExHandle, pPara);
    }

    public static short NMC_PtExPushMvData(HAND ptExHandle, short count, TPtExMvData[] pMvDataArray) {
        return lib.NMC_PtExPushMvData(ptExHandle, count, pMvDataArray);
    }

    public static short NMC_PtExPushDo(HAND ptExHandle, short count, TPtExDo[] pDataArray) {
        return lib.NMC_PtExPushDo(ptExHandle, count, pDataArray);
    }

    public static short NMC_PtExPushDoBitPulse(HAND ptExHandle, short count, TPtExDoBitPulse[] pDataArray) {
        return lib.NMC_PtExPushDoBitPulse(ptExHandle, count, pDataArray);
    }

    public static short NMC_PtExBufClr(HAND ptExHandle) {
        return lib.NMC_PtExBufClr(ptExHandle);
    }

    public static short NMC_PtExStartMtn(HAND ptExHandle) {
        return lib.NMC_PtExStartMtn(ptExHandle);
    }

    public static short NMC_PtExStopMtn(HAND ptExHandle) {
        return lib.NMC_PtExStopMtn(ptExHandle);
    }

    public static short NMC_PtExGetSts(HAND ptExHandle, TPtExSts pSts) {
        return lib.NMC_PtExGetSts(ptExHandle, pSts);
    }

    public static short NMC_LinearCompSetParam(HAND devHandle, short dimens, short axisMask, short src, short cmpMode, double gateTime, short chn) {
        return lib.NMC_LinearCompSetParam(devHandle, dimens, axisMask, src, cmpMode, gateTime, chn);
    }

    public static short NMC_LinearCompGetParam(HAND devHandle, TLinearCmpPara pLinearCmpPara, short chn) {
        return lib.NMC_LinearCompGetParam(devHandle, pLinearCmpPara, chn);
    }

    public static short NMC_LinearCompSetData(HAND devHandle, NativeLong[] pStartPos, NativeLong[] pPos, NativeLong count, short chn) {
        return lib.NMC_LinearCompSetData(devHandle, pStartPos, pPos, count, chn);
    }

    public static short NMC_LinearCompInterval(HAND devHandle, NativeLong[] pStartPos, NativeLong interval, NativeLong count, short chn) {
        return lib.NMC_LinearCompInterval(devHandle, pStartPos, interval, count, chn);
    }

    public static short NMC_LinearCompOnOff(HAND devHandle, short onOff, short chn) {
        return lib.NMC_LinearCompOnOff(devHandle, onOff, chn);
    }

    public static short NMC_LinearCompStatus(HAND devHandle, ShortByReference pStatus, ShortByReference pOutCount, short chn) {
        return lib.NMC_LinearCompStatus(devHandle, pStatus, pOutCount, chn);
    }

    public static short NMC_Comp2DimensSetParam(HAND devHandle, short group, TComp2DimensParam param, short chn) {
        return lib.NMC_Comp2DimensSetParam(devHandle, group, param, chn);
    }

    public static short NMC_Comp2DimensGetParam(HAND devHandle, short group, TComp2DimensParam param, short chn) {
        return lib.NMC_Comp2DimensGetParam(devHandle, group, param, chn);
    }

    public static short NMC_Comp2DimensSetParamEx(HAND devHandle, short group, TComp2DimensParamEx param, short chn) {
        return lib.NMC_Comp2DimensSetParamEx(devHandle, group, param, chn);
    }

    public static short NMC_Comp2DimensGetParamEx(HAND devHandle, short group, TComp2DimensParamEx param, short chn) {
        return lib.NMC_Comp2DimensGetParamEx(devHandle, group, param, chn);
    }

    public static short NMC_Comp2DimensSetData(HAND devHandle, short group, NativeLong[] pArrayPos, short count, short chn) {
        return lib.NMC_Comp2DimensSetData(devHandle, group, pArrayPos, count, chn);
    }

    public static short NMC_Comp2DimensOnoff(HAND devHandle, short group, short onOff, short chn) {
        return lib.NMC_Comp2DimensOnoff(devHandle, group, onOff, chn);
    }

    public static short NMC_Comp2DimensStatus(HAND devHandle, short group, ShortByReference pStatus, ShortByReference pOutCount, short chn) {
        return lib.NMC_Comp2DimensStatus(devHandle, group, pStatus, pOutCount, chn);
    }

    public static short NMC_Comp2DimensStatusEx(HAND devHandle, short group, TComp2DimensSts pStatus, short chn) {
        return lib.NMC_Comp2DimensStatusEx(devHandle, group, pStatus, chn);
    }

    public static short NMC_CrdBufCompareOnOff(HAND crdHandle, NativeLong segNo, short group, short onOff, short compareType) {
        return lib.NMC_CrdBufCompareOnOff(crdHandle, segNo, group, onOff, compareType);
    }

    public static short NMC_CrdBufComp2DimensSetData(HAND crdHandle, NativeLong segNo, short group, NativeLongByReference pArrayPos, short count, short compareType) {
        return lib.NMC_CrdBufComp2DimensSetData(crdHandle, segNo, group, pArrayPos, count, compareType);
    }

    public static short NMC_CompXDimensSetParam(HAND devHandle, TCompXDimensParam param, short chn) {
        return lib.NMC_CompXDimensSetParam(devHandle, param, chn);
    }

    public static short NMC_CompXDimensGetParam(HAND devHandle, TCompXDimensParam param, short chn) {
        return lib.NMC_CompXDimensGetParam(devHandle, param, chn);
    }

    public static short NMC_CompXDimensSetCmpOutMode(HAND devHandle, short outMode, short chn) {
        return lib.NMC_CompXDimensSetCmpOutMode(devHandle, outMode, chn);
    }

    public static short NMC_CompXDimensSetData(HAND devHandle, NativeLong[] pPosArray, short count, short chn) {
        return lib.NMC_CompXDimensSetData(devHandle, pPosArray, count, chn);
    }

    public static short NMC_CompXDimensOnoff(HAND devHandle, short onOff, short chn) {
        return lib.NMC_CompXDimensOnoff(devHandle, onOff, chn);
    }

    public static short NMC_CompXDimensStatus(HAND devHandle, ShortByReference pStatus, ShortByReference pOutCount, short chn) {
        return lib.NMC_CompXDimensStatus(devHandle, pStatus, pOutCount, chn);
    }

    public static short NMC_CrdSetTransRotate(HAND crdHandle, short rotAxisNo, double angleRadEqual, NativeLong firstAxisInitPos, NativeLong secAxisInitPos) {
        return lib.NMC_CrdSetTransRotate(crdHandle, rotAxisNo, angleRadEqual, firstAxisInitPos, secAxisInitPos);
    }

    public static short NMC_CrdDelTransRotate(HAND crdHandle) {
        return lib.NMC_CrdDelTransRotate(crdHandle);
    }

    public static short NMC_CrdSetTransPolar(HAND crdHandle, short rotAxNo, short transAxNo, double rotEquiv) {
        return lib.NMC_CrdSetTransPolar(crdHandle, rotAxNo, transAxNo, rotEquiv);
    }

    public static short NMC_CrdRunToPolarPos(HAND crdHandle, double xPos, double yPos, double rotVel, double transVel) {
        return lib.NMC_CrdRunToPolarPos(crdHandle, xPos, yPos, rotVel, transVel);
    }

    public static short NMC_CrdRunToPolarTheta(HAND crdHandle, double theta, double vel, short clrRoundFlag) {
        return lib.NMC_CrdRunToPolarTheta(crdHandle, theta, vel, clrRoundFlag);
    }

    public static short NMC_CrdDelTransPolar(HAND crdHandle) {
        return lib.NMC_CrdDelTransPolar(crdHandle);
    }

    public static short NMC_CrdSetTransXYZA(HAND crdHandle, short[] pAxisMapArray) {
        return lib.NMC_CrdSetTransXYZA(crdHandle, pAxisMapArray);
    }

    public static short NMC_CrdDelTransXYZA(HAND crdHandle) {
        return lib.NMC_CrdDelTransXYZA(crdHandle);
    }

    public static short NMC_CrdSetXYZAToolCalc(HAND crdHandle, double deltaTheta, NativeLong deltaX, NativeLong deltaY, NativeLongByReference pToolX, NativeLongByReference pToolY) {
        return lib.NMC_CrdSetXYZAToolCalc(crdHandle, deltaTheta, deltaX, deltaY, pToolX, pToolY);
    }

    public static short NMC_CrdSetXYZAPara(HAND crdHandle, double pulse2Rad, NativeLong toolX, NativeLong toolY) {
        return lib.NMC_CrdSetXYZAPara(crdHandle, pulse2Rad, toolX, toolY);
    }

    public static short NMC_CrdGetXYZAPara(HAND crdHandle, DoubleByReference pPulse2Rad, NativeLongByReference pToolX, NativeLongByReference pToolY) {
        return lib.NMC_CrdGetXYZAPara(crdHandle, pPulse2Rad, pToolX, pToolY);
    }

    public static short NMC_CrdSetXYZAJointTransCrdPos(HAND crdHandle, short isTrans) {
        return lib.NMC_CrdSetXYZAJointTransCrdPos(crdHandle, isTrans);
    }

    public static short NMC_TSafeParaStructInit(HAND devHandle, TSafePara pPara) {
        return lib.NMC_TSafeParaStructInit(devHandle, pPara);
    }

    public static short NMC_TCrdConfigStructInit(HAND devHandle, TCrdConfig pPara) {
        return lib.NMC_TCrdConfigStructInit(devHandle, pPara);
    }

    public static short NMC_TCrdSafeParaStructInit(HAND devHandle, TCrdSafePara pPara) {
        return lib.NMC_TCrdSafeParaStructInit(devHandle, pPara);
    }

    public static short NMC_THomeSettingStructInit(HAND devHandle, THomeSetting pPara) {
        return lib.NMC_THomeSettingStructInit(devHandle, pPara);
    }

    public static short NMC_TArcSecSettingStructInit(HAND devHandle, TArcSecSetting pPara) {
        return lib.NMC_TArcSecSettingStructInit(devHandle, pPara);
    }

    public static short NMC_TCrdParaStructInit(HAND devHandle, TCrdPara pPara) {
        return lib.NMC_TCrdParaStructInit(devHandle, pPara);
    }

    public static short NMC_TCollectCfgStructInit(HAND devHandle, TCollectCfg pPara) {
        return lib.NMC_TCollectCfgStructInit(devHandle, pPara);
    }

    public static short NMC_TCollectTrigStructInit(HAND devHandle, TCollectTrig pPara) {
        return lib.NMC_TCollectTrigStructInit(devHandle, pPara);
    }

    public static short NMC_TTimeArrayParaStructInit(HAND devHandle, TTimeArrayPara pPara) {
        return lib.NMC_TTimeArrayParaStructInit(devHandle, pPara);
    }

    public static short NMC_TLaserPowerStructInit(HAND devHandle, TLaserPower pPara) {
        return lib.NMC_TLaserPowerStructInit(devHandle, pPara);
    }

    public static short NMC_TSHIOParaStructInit(HAND devHandle, TSHIOPara pPara) {
        return lib.NMC_TSHIOParaStructInit(devHandle, pPara);
    }

    public static short NMC_TLinearCmpParaStructInit(HAND devHandle, TLinearCmpPara pPara) {
        return lib.NMC_TLinearCmpParaStructInit(devHandle, pPara);
    }

    public static short NMC_TComp2DimensParamStructInit(HAND devHandle, TComp2DimensParam pPara) {
        return lib.NMC_TComp2DimensParamStructInit(devHandle, pPara);
    }

    public static short NMC_TPtpParaStructInit(HAND devHandle, TPtpPara pPara) {
        return lib.NMC_TPtpParaStructInit(devHandle, pPara);
    }

    public static short NMC_TJogParaStructInit(HAND devHandle, TJogPara pPara) {
        return lib.NMC_TJogParaStructInit(devHandle, pPara);
    }

    public static short NMC_TNMCTimeStructInit(HAND devHandle, TNMCTime pPara) {
        return lib.NMC_TNMCTimeStructInit(devHandle, pPara);
    }

    public static short NMC_MtClrErrorEx(HAND axisHandle, short count) {
        return lib.NMC_MtClrErrorEx(axisHandle, count);
    }

    public static short NMC_SetDOGroupEx(HAND devHandle, NativeLong value, short groupID, short bitsFlag) {
        return lib.NMC_SetDOGroupEx(devHandle, value, groupID, bitsFlag);
    }

    public static short NMC_MtSetCloseLoopDac(HAND axisHandle, TDacMotor pDacPara) {
        return lib.NMC_MtSetCloseLoopDac(axisHandle, pDacPara);
    }

    public static short NMC_MtGetCloseLoopDac(HAND axisHandle, TDacMotor pDacPara) {
        return lib.NMC_MtGetCloseLoopDac(axisHandle, pDacPara);
    }

    public static short NMC_MtSetCtrlMode(HAND axisHandle, short mode) {
        return lib.NMC_MtSetCtrlMode(axisHandle, mode);
    }

    public static short NMC_MtGetCtrlMode(HAND axisHandle, ShortByReference pMode) {
        return lib.NMC_MtGetCtrlMode(axisHandle, pMode);
    }

    public static short NMC_MtSetPIDPara(HAND axisHandle, short index, TPidPara pidPara) {
        return lib.NMC_MtSetPIDPara(axisHandle, index, pidPara);
    }

    public static short NMC_MtGetPIDPara(HAND axisHandle, short index, TPidPara pPidPara) {
        return lib.NMC_MtGetPIDPara(axisHandle, index, pPidPara);
    }

    public static short NMC_MtSetPIDIndex(HAND axisHandle, short index) {
        return lib.NMC_MtSetPIDIndex(axisHandle, index);
    }

    public static short NMC_MtGetPIDIndex(HAND axisHandle, ShortByReference pIndex) {
        return lib.NMC_MtGetPIDIndex(axisHandle, pIndex);
    }

    public static short NMC_AdvBufIoSetParam(HAND devHandle, TAdvBufIoParam pPrm, short ch) {
        return lib.NMC_AdvBufIoSetParam(devHandle, pPrm, ch);
    }

    public static short NMC_AdvBufIoGetParam(HAND devHandle, TAdvBufIoParam pPrm, short ch) {
        return lib.NMC_AdvBufIoGetParam(devHandle, pPrm, ch);
    }

    public static short NMC_CrdAdvBufIoOnAfterLen(HAND crdHandle, NativeLong segNo, NativeLong outLength, NativeLong value, short ch) {
        return lib.NMC_CrdAdvBufIoOnAfterLen(crdHandle, segNo, outLength, value, ch);
    }

    public static short NMC_CrdAdvBufIoOffBeforeLen(HAND crdHandle, NativeLong segNo, NativeLong outLength, short ch) {
        return lib.NMC_CrdAdvBufIoOffBeforeLen(crdHandle, segNo, outLength, ch);
    }

    public static short NMC_AdvBufIoOut(HAND devHandle, NativeLong value, short ch) {
        return lib.NMC_AdvBufIoOut(devHandle, value, ch);
    }

    public static short NMC_AdvBufIoGetPulseCnt(HAND devHandle, NativeLongByReference pOutCout, short ch) {
        return lib.NMC_AdvBufIoGetPulseCnt(devHandle, pOutCout, ch);
    }

    public static short NMC_DoBitPulseEnable(HAND devHandle, short doType, short doIndex, NativeLong highLevelTime, NativeLong lowLevelTime, NativeLong outCount, short initialLevel, short ch) {
        return lib.NMC_DoBitPulseEnable(devHandle, doType, doIndex, highLevelTime, lowLevelTime, outCount, initialLevel, ch);
    }

    public static short NMC_DoBitPulseDisable(HAND devHandle, short ch) {
        return lib.NMC_DoBitPulseDisable(devHandle, ch);
    }

    public static short NMC_CrdBufDoBitPulseEnable(HAND crdHandle, NativeLong segNo, short doType, short doIndex, NativeLong highLevelTime, NativeLong lowLevelTime, NativeLong outCount, short initialLevel, short ch) {
        return lib.NMC_CrdBufDoBitPulseEnable(crdHandle, segNo, doType, doIndex, highLevelTime, lowLevelTime, outCount, initialLevel, ch);
    }

    public static short NMC_CrdBufDoBitPulseDisable(HAND crdHandle, NativeLong segNo, short ch) {
        return lib.NMC_CrdBufDoBitPulseDisable(crdHandle, segNo, ch);
    }

    public static short NMC_SetDacMode(HAND devHandle, short ch, short mode) {
        return lib.NMC_SetDacMode(devHandle, ch, mode);
    }

    public static short NMC_GetDacMode(HAND devHandle, short ch, ShortByReference pMode) {
        return lib.NMC_GetDacMode(devHandle, ch, pMode);
    }

    public static short NMC_SetAdcMode(HAND devHandle, short ch, short range, short filterCoe) {
        return lib.NMC_SetAdcMode(devHandle, ch, range, filterCoe);
    }

    public static short NMC_GetAdcMode(HAND devHandle, short ch, ShortByReference pRange, ShortByReference pFilterCoe) {
        return lib.NMC_GetAdcMode(devHandle, ch, pRange, pFilterCoe);
    }

    public static short NMC_SetDac(HAND devHandle, short ch, short dacValue) {
        return lib.NMC_SetDac(devHandle, ch, dacValue);
    }

    public static short NMC_GetDac(HAND devHandle, short ch, ShortByReference pDacValue) {
        return lib.NMC_GetDac(devHandle, ch, pDacValue);
    }

    public static short NMC_GetAdc(HAND devHandle, short ch, ShortByReference pAdcValue) {
        return lib.NMC_GetAdc(devHandle, ch, pAdcValue);
    }

    public static short NMC_SetDacBias(HAND devHandle, short ch, short bias) {
        return lib.NMC_SetDacBias(devHandle, ch, bias);
    }

    public static short NMC_GetDacBias(HAND devHandle, short ch, ShortByReference pBias) {
        return lib.NMC_GetDacBias(devHandle, ch, pBias);
    }

    public static short NMC_SetDacLmt(HAND devHandle, short ch, short maxVal, short minVal) {
        return lib.NMC_SetDacLmt(devHandle, ch, maxVal, minVal);
    }

    public static short NMC_GetDacLmt(HAND devHandle, short ch, ShortByReference pMaxVal, ShortByReference pMinVal) {
        return lib.NMC_GetDacLmt(devHandle, ch, pMaxVal, pMinVal);
    }

    public static short NMC_CrdSetScaraMechPara(HAND crdHandle, TScaraMechPara pScaraMechPara) {
        return lib.NMC_CrdSetScaraMechPara(crdHandle, pScaraMechPara);
    }

    public static short NMC_CrdGetScaraMechPara(HAND crdHandle, TScaraMechPara pScaraMechPara) {
        return lib.NMC_CrdGetScaraMechPara(crdHandle, pScaraMechPara);
    }

    public static short NMC_CrdSetScaraJiontPara(HAND crdHandle, short jointNo, TScaraJiontPara pScaraJiontPara) {
        return lib.NMC_CrdSetScaraJiontPara(crdHandle, jointNo, pScaraJiontPara);
    }

    public static short NMC_CrdGetScaraJiontPara(HAND crdHandle, short jointNo, TScaraJiontPara pScaraJiontPara) {
        return lib.NMC_CrdGetScaraJiontPara(crdHandle, jointNo, pScaraJiontPara);
    }

    public static short NMC_CrdSetTransScara(HAND crdHandle, short jointNum, short[] jointAxNoArray) {
        return lib.NMC_CrdSetTransScara(crdHandle, jointNum, jointAxNoArray);
    }

    public static short NMC_CrdDelTransScara(HAND crdHandle) {
        return lib.NMC_CrdDelTransScara(crdHandle);
    }

    public static short NMC_CrdSetFlyFollow(HAND crdHandle, TFlyFollowPara pFlyFollowPara) {
        return lib.NMC_CrdSetFlyFollow(crdHandle, pFlyFollowPara);
    }

    public static short NMC_CrdDelFlyFollow(HAND crdHandle) {
        return lib.NMC_CrdDelFlyFollow(crdHandle);
    }

    public static short NMC_CrdGetFlyFollowUpSts(HAND crdHandle, ShortByReference pSts) {
        return lib.NMC_CrdGetFlyFollowUpSts(crdHandle, pSts);
    }

    public static short NMC_CrdBufEnableFlyFollow(HAND crdHandle, NativeLong segNo, short enable) {
        return lib.NMC_CrdBufEnableFlyFollow(crdHandle, segNo, enable);
    }

    public static short NMC_CrdBufFlyFollowLineXY(HAND crdHandle, NativeLong segNo, NativeLongByReference tgtPos, double acc, double vel) {
        return lib.NMC_CrdBufFlyFollowLineXY(crdHandle, segNo, tgtPos, acc, vel);
    }

    public static short NMC_CrdBufWaitData(HAND crdHandle, NativeLong segNo, NativeLong usedSpace) {
        return lib.NMC_CrdBufWaitData(crdHandle, segNo, usedSpace);
    }

    public static short NMC_CrdBufAxFollowOnOff(HAND crdHandle, NativeLong segNo, short crdAxMaster, short axFllowMask, short onOff) {
        return lib.NMC_CrdBufAxFollowOnOff(crdHandle, segNo, crdAxMaster, axFllowMask, onOff);
    }

    public static short NMC_SetMvProtect(HAND devHandle, short groupNo, short mode) {
        return lib.NMC_SetMvProtect(devHandle, groupNo, mode);
    }

    public static short NMC_DelMvProtect(HAND devHandle, short groupNo) {
        return lib.NMC_DelMvProtect(devHandle, groupNo);
    }

    public static short NMC_GetMvProtectSts(HAND devHandle, short groupNo, ShortByReference pSts) {
        return lib.NMC_GetMvProtectSts(devHandle, groupNo, pSts);
    }

    public static short NMC_SetMvProtectMode01Para(HAND devHandle, short groupNo, TMvProtectPara pMvProtectPara) {
        return lib.NMC_SetMvProtectMode01Para(devHandle, groupNo, pMvProtectPara);
    }

    public static short NMC_GetMvProtectMode01Para(HAND devHandle, short groupNo, TMvProtectPara pMvProtectPara) {
        return lib.NMC_GetMvProtectMode01Para(devHandle, groupNo, pMvProtectPara);
    }

    public static short NMC_CrdGetStsPack3(HAND crdHandle, TPackedCrdSts3 pPackSts) {
        return lib.NMC_CrdGetStsPack3(crdHandle, pPackSts);
    }

    public static short NMC_CrdGetAxisPos(HAND crdHandle, short cnts, NativeLong[] pPosArray) {
        return lib.NMC_CrdGetAxisPos(crdHandle, cnts, pPosArray);
    }

    public static short NMC_CrdGetPrfPos(HAND crdHandle, short cnts, NativeLong[] pPosArray) {
        return lib.NMC_CrdGetPrfPos(crdHandle, cnts, pPosArray);
    }

    public static short NMC_CrdGetEncPos(HAND crdHandle, short cnts, NativeLong[] pPosArray) {
        return lib.NMC_CrdGetEncPos(crdHandle, cnts, pPosArray);
    }

    public static short NMC_CrdGetVel(HAND crdHandle, DoubleByReference pVel) {
        return lib.NMC_CrdGetVel(crdHandle, pVel);
    }

    public static short NMC_CrdOpen(HAND devHandle, PHAND pCrdHandle) {
        return lib.NMC_CrdOpen(devHandle, pCrdHandle);
    }

    public static short NMC_MtEstp(HAND axisHandle) {
        return lib.NMC_MtEstp(axisHandle);
    }

    public static short NMC_MtGetStsPack8(HAND axisFirstHandle, TAxisStsPack8 pPackSts) {
        return lib.NMC_MtGetStsPack8(axisFirstHandle, pPackSts);
    }

    public static short NMC_CrdLineXYZ(HAND crdHandle, NativeLong segNo, short crdAxMask, NativeLong[] pTgPosArray, double endVel, double vel, double synAcc) {
        return lib.NMC_CrdLineXYZ(crdHandle, segNo, crdAxMask, pTgPosArray, endVel, vel, synAcc);
    }

    public static short NMC_GetDO(HAND devHandle, short groupID, NativeLongByReference pDoValue) {
        return lib.NMC_GetDO(devHandle, groupID, pDoValue);
    }

    public static short NMC_SetDO(HAND devHandle, short groupID, NativeLong value) {
        return lib.NMC_SetDO(devHandle, groupID, value);
    }

    public static short NMC_GetDI(HAND devHandle, short groupID, NativeLongByReference pInValue) {
        return lib.NMC_GetDI(devHandle, groupID, pInValue);
    }

    public static short NMC_MtLmtOnOff(HAND axisHandle, short posSwt, short negSwt) {
        return lib.NMC_MtLmtOnOff(axisHandle, posSwt, negSwt);
    }

    public static short NMC_MtLmtSns(HAND axisHandle, short posSwt, short negSwt) {
        return lib.NMC_MtLmtSns(axisHandle, posSwt, negSwt);
    }

    public static short NMC_MtHomeSns(HAND axisHandle, short sns) {
        return lib.NMC_MtHomeSns(axisHandle, sns);
    }

    public static short NMC_MtGetHomeSns(HAND axisHandle, ShortByReference pSns) {
        return lib.NMC_MtGetHomeSns(axisHandle, pSns);
    }

    public static short NMC_MtAlarmOnOff(HAND axisHandle, short swt) {
        return lib.NMC_MtAlarmOnOff(axisHandle, swt);
    }

    public static short NMC_MtAlarmSns(HAND axisHandle, short swt) {
        return lib.NMC_MtAlarmSns(axisHandle, swt);
    }

    public static short NMC_MtGetStsPack12(HAND axisFirstHandle, TAxisStsPack12 pPackSts) {
        return lib.NMC_MtGetStsPack12(axisFirstHandle, pPackSts);
    }

    public static short NMC_DevAutoRtnSet(HAND devHandle, NativeLong mode1, NativeLong mode2, NativeLong cycleInMs, NativeLong port, NativeLong hostTag) {
        return lib.NMC_DevAutoRtnSet(devHandle, mode1, mode2, cycleInMs, port, hostTag);
    }

    public static short NMC_DevAutoRtnClr(HAND devHandle) {
        return lib.NMC_DevAutoRtnClr(devHandle);
    }

    public static short NMC_DevAutoRtnSyn(HAND devHandle, NativeLong hostTag) {
        return lib.NMC_DevAutoRtnSyn(devHandle, hostTag);
    }

    public static short NMC_DevAutoRtnGet(HAND devHandle, TAutoRtnPackedSts packedSts, ShortByReference pReady) {
        return lib.NMC_DevAutoRtnGet(devHandle, packedSts, pReady);
    }

    public static short NMC_MtSetPtpComparePara(HAND axisHandle, short dir, NativeLong comparaPos, double upDateVel) {
        return lib.NMC_MtSetPtpComparePara(axisHandle, dir, comparaPos, upDateVel);
    }

    public static short NMC_MtGetPtpCompareSts(HAND axisHandle, ShortByReference pIsCompareActive, ShortByReference pIsCompareOut) {
        return lib.NMC_MtGetPtpCompareSts(axisHandle, pIsCompareActive, pIsCompareOut);
    }

    public static short NMC_DevAsynCommSet(HAND devHandle, NativeLong delayInMs) {
        return lib.NMC_DevAsynCommSet(devHandle, delayInMs);
    }

    public static short NMC_DevAsynCommClr(HAND devHandle) {
        return lib.NMC_DevAsynCommClr(devHandle);
    }

    public static short NMC_DevAsynGetSts(HAND devHandle, TAutoRtnPackedSts packedSts, ShortByReference pReady) {
        return lib.NMC_DevAsynGetSts(devHandle, packedSts, pReady);
    }

    public static short NMC_DevAsynAbsMoveType1(HAND axisHandle, float acc, float dec, float vel, short smooth, NativeLong arrivalBand, NativeLong stableTime, NativeLong tgtPos) {
        return lib.NMC_DevAsynAbsMoveType1(axisHandle, acc, dec, vel, smooth, arrivalBand, stableTime, tgtPos);
    }

    public static short NMC_DevAsynSetDoBit(HAND devHandle, short bitIdx, short setValue) {
        return lib.NMC_DevAsynSetDoBit(devHandle, bitIdx, setValue);
    }

    public static short NMC_CompHs1DimensSetParam(HAND devHandle, TCompHs1DimensParam param, short chn) {
        return lib.NMC_CompHs1DimensSetParam(devHandle, param, chn);
    }

    public static short NMC_CompHs1DimensGetParam(HAND devHandle, TCompHs1DimensParam param, short chn) {
        return lib.NMC_CompHs1DimensGetParam(devHandle, param, chn);
    }

    public static short NMC_CompHs1DimensSetData(HAND devHandle, NativeLongByReference pArrayPos, short count, short chn) {
        return lib.NMC_CompHs1DimensSetData(devHandle, pArrayPos, count, chn);
    }

    public static short NMC_CompHs1DimensOnOff(HAND devHandle, short onOff, short chn) {
        return lib.NMC_CompHs1DimensOnOff(devHandle, onOff, chn);
    }

    public static short NMC_CompHs1DimensStatus(HAND devHandle, ShortByReference pBusy, ShortByReference pOutCount, ShortByReference pWaitCnts, ShortByReference pFreeCnts, short chn) {
        return lib.NMC_CompHs1DimensStatus(devHandle, pBusy, pOutCount, pWaitCnts, pFreeCnts, chn);
    }

    public static short NMC_GetClock(HAND devHandle, NativeLongByReference pClock, NativeLongByReference pLoop) {
        return lib.NMC_GetClock(devHandle, pClock, pLoop);
    }

    public static short NMC_MtGetStsMulti(HAND firstAxisHandle, short[] pStsArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetStsMulti(firstAxisHandle, pStsArray, count, pClock);
    }

    public static short NMC_MtGetPrfModeMulti(HAND firstAxisHandle, short[] pModeArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetPrfModeMulti(firstAxisHandle, pModeArray, count, pClock);
    }

    public static short NMC_MtGetAxisPrfPosMulti(HAND firstAxisHandle, NativeLong[] pPosArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetAxisPrfPosMulti(firstAxisHandle, pPosArray, count, pClock);
    }

    public static short NMC_MtGetAxisPrfVelMulti(HAND firstAxisHandle, double[] pVelArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetAxisPrfVelMulti(firstAxisHandle, pVelArray, count, pClock);
    }

    public static short NMC_MtGetAxisPrfAccMulti(HAND firstAxisHandle, double[] pAccArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetAxisPrfAccMulti(firstAxisHandle, pAccArray, count, pClock);
    }

    public static short NMC_MtGetAxisEncPosMulti(HAND firstAxisHandle, NativeLong[] pPosArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetAxisEncPosMulti(firstAxisHandle, pPosArray, count, pClock);
    }

    public static short NMC_MtGetAxisEncVelMulti(HAND firstAxisHandle, double[] pVelArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetAxisEncVelMulti(firstAxisHandle, pVelArray, count, pClock);
    }

    public static short NMC_MtGetAxisEncAccMulti(HAND firstAxisHandle, double[] pAccArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetAxisEncAccMulti(firstAxisHandle, pAccArray, count, pClock);
    }

    public static short NMC_MtGetAxisErrorMulti(HAND firstAxisHandle, NativeLong[] pErrArray, short count, NativeLongByReference pClock) {
        return lib.NMC_MtGetAxisErrorMulti(firstAxisHandle, pErrArray, count, pClock);
    }

    public static short NMC_GetEncPosMulti(HAND devHandle, short encoder, NativeLong[] pEncPosArray, short count, NativeLongByReference pClock) {
        return lib.NMC_GetEncPosMulti(devHandle, encoder, pEncPosArray, count, pClock);
    }

    public static short NMC_SetDIFilter(HAND devHandle, short diType, short diGroup, short diIndex, short filtTime) {
        return lib.NMC_SetDIFilter(devHandle, diType, diGroup, diIndex, filtTime);
    }

    public static short NMC_GetDIFilter(HAND devHandle, short diType, short diGroup, short diIndex, ShortByReference pFiltTime) {
        return lib.NMC_GetDIFilter(devHandle, diType, diGroup, diIndex, pFiltTime);
    }

    public static short NMC_GetDIEx(HAND devHandle, short diType, short groupID, NativeLongByReference pDiValue) {
        return lib.NMC_GetDIEx(devHandle, diType, groupID, pDiValue);
    }

    public static short NMC_GetDIRaw(HAND devHandle, short diType, short groupID, NativeLongByReference pDiValue) {
        return lib.NMC_GetDIRaw(devHandle, diType, groupID, pDiValue);
    }

    public static short NMC_SetDiReverseCount(HAND devHandle, short diType, short diIndex, NativeLong[] pReverseCountArray, short count) {
        return lib.NMC_SetDiReverseCount(devHandle, diType, diIndex, pReverseCountArray, count);
    }

    public static short NMC_GetDiReverseCount(HAND devHandle, short diType, short diIndex, NativeLong[] pReverseCountArray, short count) {
        return lib.NMC_GetDiReverseCount(devHandle, diType, diIndex, pReverseCountArray, count);
    }

    public static short NMC_SetDIBitRevsEx(HAND devHandle, short diType, short group, short bitIndex, short revs) {
        return lib.NMC_SetDIBitRevsEx(devHandle, diType, group, bitIndex, revs);
    }

    public static short NMC_GetDIBitRevsEx(HAND devHandle, short diType, short group, short bitIndex, ShortByReference pRevs) {
        return lib.NMC_GetDIBitRevsEx(devHandle, diType, group, bitIndex, pRevs);
    }

    public static short NMC_SetDOMask(HAND devHandle, NativeLong outMask, NativeLong outValue, short doType, short groupID) {
        return lib.NMC_SetDOMask(devHandle, outMask, outValue, doType, groupID);
    }

    public static short NMC_GetAdcVoltageMulti(HAND devHandle, short ch, short count, double[] pAdcVolArray) {
        return lib.NMC_GetAdcVoltageMulti(devHandle, ch, count, pAdcVolArray);
    }

    public static short NMC_SetDacVoltageMulti(HAND devHandle, short ch, short count, double[] pDacVolArray) {
        return lib.NMC_SetDacVoltageMulti(devHandle, ch, count, pDacVolArray);
    }

    public static short NMC_GetDacVoltageMulti(HAND devHandle, short ch, short count, double[] pDacVolArray) {
        return lib.NMC_GetDacVoltageMulti(devHandle, ch, count, pDacVolArray);
    }

    public static short NMC_MtSetCaptRepeat(HAND axisHandle, short count) {
        return lib.NMC_MtSetCaptRepeat(axisHandle, count);
    }

    public static short NMC_MtGetCaptRepeatStatus(HAND axisHandle, ShortByReference pCount) {
        return lib.NMC_MtGetCaptRepeatStatus(axisHandle, pCount);
    }

    public static short NMC_MtGetCaptRepeatPosMulti(HAND axisHandle, NativeLong[] pPosArray, short startNum, short count) {
        return lib.NMC_MtGetCaptRepeatPosMulti(axisHandle, pPosArray, startNum, count);
    }

    public static short NMC_GetInterruptTime(HAND devHandle, DoubleByReference pServoRunTime, DoubleByReference pProfileRunTime) {
        return lib.NMC_GetInterruptTime(devHandle, pServoRunTime, pProfileRunTime);
    }

    public static short NMC_GetInterruptTimeMax(HAND devHandle, DoubleByReference pServoRunTimeMax, DoubleByReference pProfileRunTimeMax) {
        return lib.NMC_GetInterruptTimeMax(devHandle, pServoRunTimeMax, pProfileRunTimeMax);
    }

    public static short NMC_CrdBufStopMtn(HAND crdHandle, NativeLong segNo, short crdIdx) {
        return lib.NMC_CrdBufStopMtn(crdHandle, segNo, crdIdx);
    }

    public static short NMC_MtSetAxisInputShaping(HAND axisHandle, short enable, short bufCount, double kCoef) {
        return lib.NMC_MtSetAxisInputShaping(axisHandle, enable, bufCount, kCoef);
    }

    public static short NMC_GetDOEx(HAND devHandle, short doType, short groupID, NativeLongByReference pOutValue) {
        return lib.NMC_GetDOEx(devHandle, doType, groupID, pOutValue);
    }

    public static short NMC_SetDOBitRevsEx(HAND devHandle, short doType, short group, short bitIndex, short revs) {
        return lib.NMC_SetDOBitRevsEx(devHandle, doType, group, bitIndex, revs);
    }

    public static short NMC_GetDOBitRevsEx(HAND devHandle, short doType, short group, short bitIndex, ShortByReference pRevs) {
        return lib.NMC_GetDOBitRevsEx(devHandle, doType, group, bitIndex, pRevs);
    }

    public static short NMC_CrdGetStsEx(HAND crdHandle, ShortByReference pSts, NativeLongByReference pUserSeg) {
        return lib.NMC_CrdGetStsEx(crdHandle, pSts, pUserSeg);
    }

    public static short NMC_MtPtStartMtnEx(HAND axisHandle, short diIndex, short diSns) {
        return lib.NMC_MtPtStartMtnEx(axisHandle, diIndex, diSns);
    }

    public static short NMC_Set2DCompensationTable(HAND devHandle, short tableIndex, T2DCompensationTable pTable, TCompData[] pData) {
        return lib.NMC_Set2DCompensationTable(devHandle, tableIndex, pTable, pData);
    }

    public static short NMC_Get2DCompensationTable(HAND devHandle, short tableIndex, T2DCompensationTable pTable, TCompData[] pData) {
        return lib.NMC_Get2DCompensationTable(devHandle, tableIndex, pTable, pData);
    }

    public static short NMC_Set2DCompensation(HAND devHandle, T2DCompensation pComp) {
        return lib.NMC_Set2DCompensation(devHandle, pComp);
    }

    public static short NMC_Get2DCompensation(HAND devHandle, T2DCompensation pComp) {
        return lib.NMC_Get2DCompensation(devHandle, pComp);
    }

    public static short NMC_SetPWMPort(HAND devHandle, short portType, short portIdx, short ch) {
        return lib.NMC_SetPWMPort(devHandle, portType, portIdx, ch);
    }

    public static short NMC_GetPWMPort(HAND devHandle, ShortByReference pPortType, ShortByReference pGpoIdx, short ch) {
        return lib.NMC_GetPWMPort(devHandle, pPortType, pGpoIdx, ch);
    }

    public static short NMC_MtPvtSetPara(HAND axisHandle, TPvtPara pPara) {
        return lib.NMC_MtPvtSetPara(axisHandle, pPara);
    }

    public static short NMC_MtPvtGetPara(HAND axisHandle, TPvtPara pPara) {
        return lib.NMC_MtPvtGetPara(axisHandle, pPara);
    }

    public static short NMC_MtPvtData(HAND axisHandle, short count, double[] pPosArray, double[] pTimeArray, double[] pVelArray) {
        return lib.NMC_MtPvtData(axisHandle, count, pPosArray, pTimeArray, pVelArray);
    }

    public static short NMC_MtPvtBufGetSpace(HAND axisHandle, ShortByReference pFreeSpace, ShortByReference pUsedSpace) {
        return lib.NMC_MtPvtBufGetSpace(axisHandle, pFreeSpace, pUsedSpace);
    }

    public static short NMC_MtPvtBufClr(HAND axisHandle) {
        return lib.NMC_MtPvtBufClr(axisHandle);
    }

    public static short NMC_MtPvtStartMtn(HAND axisHandle, short otherSynAxCnts, ShortByReference pOtherSynAxArray) {
        return lib.NMC_MtPvtStartMtn(axisHandle, otherSynAxCnts, pOtherSynAxArray);
    }

    public static short OEM_Get2DCompensationPos(HAND devHandle, short tableIndex, NativeLong posX, NativeLong posY, NativeLongByReference pCompPosX, NativeLongByReference pCompPosY, NativeLongByReference pCompPosZ) {
        return lib.OEM_Get2DCompensationPos(devHandle, tableIndex, posX, posY, pCompPosX, pCompPosY, pCompPosZ);
    }

    public static short OEMLY_SetConfig(HAND devHandle, TAdvCaptureParamEx pParam,short ch) {
        return lib.OEMLY_SetConfig(devHandle, pParam, ch);
    }

    public static short OEMLY_GetConfig(HAND devHandle, TAdvCaptureParamEx pParam,short ch) {
        return lib.OEMLY_GetConfig(devHandle, pParam, ch);
    }

    public static short OEMLY_Clear(HAND devHandle,short ch) {
        return lib.OEMLY_Clear(devHandle, ch);
    }

    public static short OEMLY_OnOff(HAND devHandle,short onOff,short ch) {
        return lib.OEMLY_OnOff(devHandle, onOff, ch);
    }

    public static short OEMLY_ZeroPos(HAND devHandle,short firstAx,short count,short flag) {
        return lib.OEMLY_ZeroPos(devHandle, firstAx, count, flag);
    }

    public static short OEMLY_GetSts (HAND devHandle, ShortByReference pSts, NativeLongByReference pTrigCnt, NativeLongByReference pDataLenByte ,short ch) {
        return lib.OEMLY_GetSts (devHandle, pSts, pTrigCnt, pDataLenByte, ch);
    }
    
    public static short OEMLY_GetData (HAND devHandle, short byteLenToGet, ShortByReference pGetLenByte,NativeLongByReference pData ,short ch) {
        return lib.OEMLY_GetData (devHandle, byteLenToGet, pGetLenByte, pData , ch);
    }
}

