package lib;
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import java.util.Arrays;
import java.util.List;
import lib.mtn_lib20_com.HAND;
import lib.mtn_lib20_com.PHAND;



/**
 * JNA封装类，用于调用 mtn_lib20.so 动态库
 */
public class mtn_lib20_oem {


    // 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 int LASER_PARAM_TAB_UNIT_MAX = 64;      // 最大的激光参数表数量
    public static final int LASER_CRDVELCOMP_PT_MAX = 64;       // 根据坐标系的速度，补偿激光输出的相关控制量
    public static final int LASER_CRDVELCOMP_GROUP_MAX = 4;

    public static final int PTPBUFMV_MAX_GROUP = 2;         // 最大的组数
    public static final int PTPBUFMV_MAX_AX = 4;        // 最大的参与轴数量
    public static final int PTPBUFMV_MAX_SEC = 4;       // 最大的段数

    public static final int EVENT_MAX_CHN = 8;

// UART相关常量
    public static final short UART_PARITY_N = 0;      // 无校验
    public static final short UART_PARITY_O = 1;      // 奇校验
    public static final short UART_PARITY_E = 2;      // 偶校验
    public static final short UART_STOP_BITS_10 = 0;      // 停止位为1
    public static final short UART_STOP_BITS_15 = 1;      // 停止位为1.5
    public static final short UART_STOP_BITS_20 = 2;      // 停止位为2

// Event相关常量
    public static final int EVENT_SRC_PRFPOS = 0;       // 规划位置
    public static final int EVENT_SRC_ENCPOS = 1;       // 实际位置
    public static final int EVENT_DIR_BIGGER = 0;       // 大于
    public static final int EVENT_DIR_SMALLER = 1;      // 小于
    public static final int EVENT_DIR_EQUAL = 2;        // 等于
    public static final int EVENT_DIR_NOT_BIGGER = 3;       // 不大于
    public static final int EVENT_DIR_NOT_SMALLER = 4;      // 不小于
    public static final int EVENT_DIR_NOT_EQUAL = 5;        // 不等于

    public static final int EVENT_ACTION_NONE = 0;      // 不执行任何的动作
    public static final int EVENT_ACTION_SETDO = 1;     // 设置DO（idx:组号，param1:输出位掩码，param2:输出值掩码
    public static final int EVENT_ACTION_PTP_VEL = 2;       // 更新PTP的速度（idx:轴号，param1:速度，param2:保留

// Scan相关常量
    public static final int OEM_SCAN_MAX_CHN = 1;       // 振镜通道数量
    public static final int BIT_SCAN_EN = 0x00000001;       // 使能标志位
    public static final int BIT_SCAN_RUN = 0x00000002;      // 运动:1 ,静止 0
    public static final int BIT_SCAN_END = 0x00000004;      // 是否End标志位
    public static final int BIT_SCAN_BUF_FULL = 0x00000008;     // 数据满
    public static final int BIT_SCAN_BUF_EMPTY = 0x00000010;        // 数据空
    public static final int BIT_SCAN_ERR_PUSH = 0x00001000;     // 压数据错误
    public static final int BIT_SCAN_ERR_POP = 0x00002000;      // 取数据错误
    public static final int BIT_SCAN_ERR_OTHER = 0x00004000;        // 其他错误，参考errCode


    /**
     * TComp2DimensDataGroup 结构体
     */
    public static class TComp2DimensDataGroup extends Structure {
        public int xStart;      // X起点
        public int yStart;      // Y起点
        public int xIntv;       // X间距
        public int yIntv;       // Y间距
        public int cnt;     // 数量
        public int reserved;

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("xStart", "yStart", "xIntv", "yIntv", "cnt", "reserved");
        }
    }
    /**
     * TPtpTwoStagePrm 结构体
     */
    public static class TPtpTwoStagePrm extends Structure {
        public short inType;
        public short inIndex;
        public short inTrigLevel;
        public short action;
        public double prm1;
        public double prm2;
        public double prm3;
        public double prm4;
        public short blockEn;
        public short reserved[] = new short[3];

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("inType", "inIndex", "inTrigLevel", "action",
                    "prm1", "prm2", "prm3", "prm4", "blockEn", "reserved");
        }
    } 

    /**
     * TLaserParamTableUnit 结构体
     */
    public static class TLaserParamTableUnit extends Structure {
        public double gateTime;     // 设置gate 打开时间,单位：s（内部最小值：1/36us ）,取值范围(0,0.0009)
        public int minFrq;      //最低频率，单位Hz
        public short gateDistance;      // 固定模式下的位置间隔 单位:pulse
        public short k;     // 低频过渡系数
        public short startDot;      // 启动时出光打点
        public short lowFrqRange;       // 低频范围:0:100k，1:1M,2:9M
        public short accLowFrqOnVel;        // 加速段低频功能的启用速度值
        public short decLowFrqOffVel;       //减速段低频功能的关闭速度值
        public short yCoe;      // Y向补偿，取值范围[0,255],实际比例为0~2的比例，coe*256后设到这个变量
        public short yAng;      // 光斑的旋转角度

        // 普通模式下的参数
        public int onDelay;     //开光延时,单位us,取值范围[0,65535]
        public int offDelay;        //关光延时,单位us,取值范围[0,65535]
        public int minValue;        //最小输出值，DA输出时，范围[0,32767],占空比输出时，范围[0,100],频率输出时，范围[0,2000000]
        public int maxValue;        //最大输出值，DA输出时，范围[0,32767],占空比输出时，范围[0,100],频率输出时，范围[0,2000000]
        public int standbyPower;        //待机能量,为0表示取消待机能量输出功能
        public double overRide;     //跟随倍率,为0表示取消激光能量跟随
        public short followType;        //跟随类型,0:跟随规划速度，1:跟随实际速度
        public short reserved[] = new short[7];     //保留


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("gateTime", "minFrq", "gateDistance", "k", "startDot", "lowFrqRange", "accLowFrqOnVel", "decLowFrqOffVel", "yCoe", "yAng", "onDelay", "offDelay", "minValue", "maxValue", "standbyPower", "overRide", "followType", "reserved");
        }
    }

    /**
     * TPvtMoveHighToLow 结构体
     */
    public static class TPvtMoveHighToLow extends Structure {
        public double startVel;     // 第一段起跳速度
        public double highVel;      // 高速段最大速度
        public double highAcc;      // 高速段加速度
        public double highDec;      // 高速段减速度
        public double lowVel;       //低速段最大速度
        public double lowDec;       // 低速段减速度
        public int highDist;        // 高速段目标位置
        public int lowDist;     // 低速段目标位置
        public short smooth;        //平滑系数，取值[0,50]
        public short reseved[] = new short[3];      // 保留字段

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("startVel", "highVel", "highAcc", "highDec", "lowVel", "lowDec", "highDist", "lowDist", "smooth", "reseved");
        }
    }

    /**
     * TPvtMoveLowToHigh 结构体
     */
    public static class TPvtMoveLowToHigh extends Structure {
        public double startVel;     // 第一段起跳速度
        public double highVel;      // 高速段最大速度
        public double highAcc;      // 高速段加速度
        public double highDec;      // 高速段减速度
        public double lowVel;       // 低速段最大速度
        public double lowAcc;       // 低速段加速度
        public int highDist;        // 高速段目标位置
        public int lowDist;     //低速段目标位置
        public short smooth;        //平滑系数，取值[0,50]
        public short reseved[] = new short[3];      // 保留字段


        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("startVel", "highVel", "highAcc", "highDec", "lowVel", "lowAcc", "highDist", "lowDist", "smooth", "reseved");
        }
    }

    /**
     * TPvtMove3Stage 结构体
     */
    public static class TPvtMove3Stage extends Structure {
        public double startVel;     //起跳速度
        public double vel1;     //第1段匀速运动的速度(单位:脉冲/毫秒)
        public double acc1;     //第1段加速度(单位:脉冲/毫秒^2)
        public double dec1;     //第1段减速度(单位:脉冲/亳秒^2)
        public double vel2;     //第2段匀速运动的速度(单位:脉冲/毫秒)
        public double vel3;     //第3段匀速运动速度
        public double acc3;     //第3段加速到第3段的加速度
        public double dec3;     //第3段减速度

        public int dist1;       //第1段行程(单位:脉冲)
        public int dist2;       //第2段行程(单位:脉冲)       
        public int dist3;       //第3段行程
        public int reserved2;       // 保留
        public short smooth;        // 平滑系数，取值[0,50]        
        public short reseved[] = new short[3];      // 保留字段

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("startVel", "vel1", "acc1", "dec1", "vel2", "vel3", "acc3", "dec3", "dist1", "dist2", "dist3", "reserved2", "smooth", "reseved");
        }
    }

    /**
     * TLaserCrdVelCompTable 结构体
     */

    public static class TLaserCrdVelCompTable extends Structure {
        public short count;     // 实际点数
        public short mode;      // 补偿对象，0：补偿option值，1：补偿输出能量 2:更新能量跟随倍率
        public short src;       // 跟随类型,0:编码器速度，1：规划速度
        public short reserved[] = new short[5];     // 保留
        public float vel[] = new float[LASER_CRDVELCOMP_PT_MAX];        // 速度表
        public float comp[] = new float[LASER_CRDVELCOMP_PT_MAX];       // 补偿值

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("count", "mode", "src", "reserved", "vel", "comp");
        }
    }

    /**
     * TUartPara 结构体
     */
    public static class TUartPara extends Structure {
        public int baudrate;        // 波特率
        public short mode;      // 端口的工作模式:0:默认，扩展模块工作模式，1:自由协议模式
        public short dataBits;      // 数据位,取值范围[7,8]
        public short stopBits;      // 停止位,取值范围[0,2]，参考宏定义，如UART STOP BITS 10等
        public short parity;        //校验方式，如UART PARITY N等
        public short rxBufLen;      // 接收缓存长度，默认128
        public short txBufLen;      //发送缓存长度，默认128
        public short reserved[] = new short[4];     //保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("baudrate", "mode", "dataBits", "stopBits", "parity", "rxBufLen", "txBufLen", "reserved");
        }
    }

    /**
     * TRepeatCaptParamEx 结构体
     */
    public static class TRepeatCaptParamEx extends Structure {
        public short axMask;        // 捕获的轴掩码，最多8轴
        public short captMode;      // 捕获模式，参考NMC_MtSetCaptSns的参数定义
        public short captIoSrc;     // 捕获源，参考NMC_MtSetCaptSns的参数定义
        public short captLev;       // 捕获电平，参考NMC_MtSetCaptSns的参数定义
        public int captMaxCnt;      // 最多捕获多少个数据
        public short reserved[] = new short[2];

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("axMask", "captMode", "captIoSrc", "captLev", "captMaxCnt", "reserved");
        }
    }

    /**
     * TModbusParam 结构体
     */
    public static class TModbusParam extends Structure {
        public short mode;      // 模式 -1:扩展模块,0:RTU,1:ASCII,16:RTU Master
        public short slaveAddr;     //从站地址,仅在为从站时有效
        public short port;      // 硬件端口，仅2有效
        public short parity;        // 校验类型，0:无校验，1:奇校验，2:偶校验
        public short dataBit;       // 数据位 
        public short stopBit;       //停止位
        public int bautrate;        //波特率
        public short masterTimeout;     //主站的最大响应时间，单位:毫秒
        public short reserved[] = new short[7];     //保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("mode", "slaveAddr", "port", "parity", "dataBit", "stopBit", "bautrate", "masterTimeout", "reserved");
        }
    }

    /**
     * TCrdSymmParam 结构体
     */
    public static class TCrdSymmParam extends Structure {
        public int masterCent[] = new int[2];       // 主平面的圆心坐标
        public int slaveCent[] = new int[2];        // 次平面的圆心坐标
        public int masterStart[] = new int[2];      // 主平面的起点坐标
        public int slaveStart[] = new int[2];       // 次平面的起点坐标
        public short slaveAxMask;       // 从轴掩码，两个轴，非坐标系内
        public short reserved[] = new short[3];     // 保留参数

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("masterCent", "slaveCent", "masterStart", "slaveStart", "slaveAxMask", "reserved");
        }
    }

    /**
     * TCircleLimitPara 结构体
     */
    public static class TCircleLimitPara extends Structure {
        public short axMask;        // 关联的轴掩码
        public short mode;      //0:触发后停止关联轴运动，1:停止并置起急停标志位
        public int centPosX;        // 圆形限位的圆心X，单位:pulse
        public int centPosY;        //圆形限位的圆心Y，单位:pulse
        public int radius;      //半径，半径为0表示取消该通道的圆形区域限位检查，单位:pulse
        public float yProp;     // 系数，，Y方向的当量除以X方向的当量
        public float reserved2;     // 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("axMask", "mode", "centPosX", "centPosY", "radius", "yProp", "reserved2");
        }
    }

    /**
     * TOemScanSts 结构体
     */
    public static class TOemScanSts extends Structure {
        public int sts;     // 运行状态，按位表示，如上
        public int userSeg;     // 用户段号
        public int leftSpace;       // 剩余空间
        public int usedSpace;       // 使用空间
        public int cmdAllCnt;       // 全部指令的计数
        public short xPos;      // x方向当前位置
        public short yPos;      // y方向当前位置
        public short errCode;       // 错误码
        public short reserved[] = new short[3];     // 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("sts", "userSeg", "leftSpace", "usedSpace", "cmdAllCnt", "xPos", "yPos", "errCode", "reserved");
        }
    }

    /**
     * TEventConfig 结构体
     */
    public static class TEventConfig extends Structure {
        public short eventSrc;      //事件的源，如EVENT SRC PRFPOS
        public short eventIdx;      // 事件的序号
        public short dir;       // 方向
        public short errZone;       // 误差
        public int trigCnt;     // 触发次数
        public int eventReserved[] = new int[3];        // 保留
        public double compVal1;     //比较值

        public short actionType;        // 事件触发后的动作类型
        public short actionIdx;     // 动作序号
        public float actionParam1;      // 动作参数1
        public float actionParam2;      // 动作参数2
        public short actionReserved[] = new short[6];       // 保留

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("eventSrc", "eventIdx", "dir", "errZone", "trigCnt", "eventReserved", "compVal1", "actionType", "actionIdx", "actionParam1", "actionParam2", "actionReserved");
        }
    }

    /**
     * TEncoderCfg 结构体
     */
    public static class TEncoderCfg extends Structure {
        public short encoderIdx;        //编码器编号，取值范围[0,n],256表示辅助编码器
        public short encoderMode;       //编码器模式，请参考NMC_SetEncMode说明
        public short reserved[] = new short[6];     // 保留


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

    /**
     * TPtpBufMvUnit 结构体
     */
    public static class TPtpBufMvUnit extends Structure {
        public float acc;
        public float dec;
        public float velS;
        public float velE;
        public float velMax;
        public int tgtPos;
        public short smooth;
        public short setDelay;
        public short reserved[] = new short[4];

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("acc", "dec", "velS", "velE", "velMax", "tgtPos", "smooth", "setDelay", "reserved");
        }
    }

    /**
     * TPtpBufMvSts 结构体
     */
    public static class TPtpBufMvSts extends Structure {
        public short run;       // 0:Stop,1:running;2:error
        public short errCode;       // 错误代码
        public short curUnitIdx;        // 当前执行的单元序号
        public short reserved[] = new short[3];     // 其他

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("run", "0:Stop,1:running", "errCode", "curUnitIdx", "reserved");
        }
    }

    /**
     * TComp2DimensParamEx 结构体
     */
    public static class TComp2DimensParamEx extends Structure {
        public short outputChn;     //比较输出的通道号，取值[0,n]
        public short outputType;        //输出方式0:脉冲1:电平
        public short chnType;       //通道类型:0 GPO，1 GATE通道
        public short dir1No;        //方向1 的位置源轴号(0~11)
        public short dir2No;        //方向2 的位置源轴号(0~11)
        public short posSrc;        //轴位置类型 :0规划1:编码器
        public short stLevel;       // 电平模式下的起始电平(@或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");
        }
    }

    /**
     * TCompXDimensExParam 结构体
     */
    public static class TCompXDimensExParam extends Structure {
        public short axCnt;     // 参与的轴数量，取值[1,6]
        public short axList[] = new short[6];       // 参与的轴列表
        public short outType;       // 输出方式0:脉冲1:电平
        public short outChnType;        //通道类型:0 GPO，1 GATE通道
        public short outChnIdx;     //比较输出信号的通道号，取值[0,n]
        public short posSrc;        // 轴位置类型 :0规划1:编码器
        public short stLevel;       //电平模式下的起始电平(0或1)
        public long gateTime;       //脉冲方式脉冲时间，单位us
        public long errZone;        // 进入比较点容差半径范围(pulse)
        public long directOutZone;      // 近距离直接触发范围
        public long reserved[] = new long[7];       //保留，默认值 0(不使用)

        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList("axCnt", "axList", "outType", "outChnType", "outChnIdx", "posSrc", "stLevel", "gateTime", "errZone", "directOutZone", "reserved");
        }
    }

    /**
     * TCompXDimensExSts 结构体
     */
    public static class TCompXDimensExSts 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");
        }
    }

    /**
     * 原生库接口
     */
    private interface NativeLib extends Library {
        NativeLib INSTANCE = Native.load("nmc_lib20", NativeLib.class);

        // 设置PTP的高级参数
        // minEvenTime:最小匀速时间
        // param1:保留
        short OEM_MtSetMinEventTime(HAND axisHandle, short minEvenTime, short param1, short param2, short param3);

        // 读取PTP的高级参数
        short OEM_MtGetMinEventTime(HAND axisHandle, ShortByReference minEvenTime, ShortByReference param1, ShortByReference param2, ShortByReference param3);
        
        // 多轴同步运动
        // mask:轴掩码
        // pPosArray:位置数组
        short OEM_PtpSync(HAND devHandle, short mask, LongByReference pPosArray);

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

        // 功能：设置双头运动中的第二个头相对第一个头的参数
        // 参数：offsetX:双头回原点后，在X方向，第2个头的原点相对第1个头的原点的偏置量
        // offsetY:双头回原点后，在Y方向，第2个头的原点相对第1个头的原点的偏置量
        // pAxisNo:[0]第二个头的X轴对应的轴号 [1]第二个头的Y轴对应的轴号
        short NMC_CrdSetDoubleHeadPara(HAND crdHandle, int offsetX, int offsetY, ShortByReference pAxisNo);

        // 功能：读取双头运动中的第二个头相对第一个头的参数
        // 参数：pOffsetX:双头回原点后，在X方向，第2个头的原点相对第1个头的原点的偏置量
        // pOffsetY:双头回原点后，在Y方向，第2个头的原点相对第1个头的原点的偏置量
        // pAxisNo:[0]第二个头的X轴对应的轴号 [1]第二个头的Y轴对应的轴号
        short NMC_CrdGetDoubleHeadPara(HAND crdHandle, LongByReference pOffsetX, LongByReference pOffsetY, ShortByReference pAxisNo);

        // 功能：实现第二个点胶头的图元切换动作,在没加工完一个图元后，切换到另外一个图元需要配合调用该指令
        // 参数： rotX,rotY:下一个图元的旋转中心（一般为相机拍照的位置）
        // tgtPosX,tgtPosY:是下一个图元的起始点位置XY的坐标
        // deltaX、deltaY和theta:是下一个图元的中心相对第一个图元中心的偏移和旋转量。
        // deltaX、deltaY单位为脉冲，theta单位为度
        // vel,acc:第二个点胶头移动到起点的速度和加速度
        // 注：没有对deltaX deltaY以及theta进行判断，后续根据第二号头的XY行程增加判断。        
        short NMC_CrdBufObjectSwitch(HAND crdHandle, int segNo, int rotX, int rotY, int tgtPosX, int tgtPosY, int deltaX, int deltaY, double theta, double vel, double acc);
        
        // 功能：建立2号头的与1号头的同步运动关系
        short NMC_CrdBufSecondHeadSyncMoveOn(HAND crdHandle, int segNo);

        // 功能：结束2号头的与1号头的同步运动关系
        short NMC_CrdBufSecondHeadSyncMoveOff(HAND crdHandle, int segNo);


        short OEM_CrdBufLaserSetParamTableIdx(HAND crdHandle, int segNo, short tableIdx, short laserCh);
        short OEM_LaserSetParamTableIdx(HAND devHandle, short tableIdx, short laserCh);
        short OEM_LaserSetParamTableUnit(HAND devHandle, short tableIdx, TLaserParamTableUnit pParamUnit);
        short OEM_LaserGetParamTableUnit(HAND devHandle, short tableIdx, TLaserParamTableUnit pParamUnit);

        // 多段速：高速变低速
        short OEM_MtPvtMoveHighToLow(HAND axisHandle, TPvtMoveHighToLow pPrm);

        // 多段速：低速变高速
        short OEM_MtPvtMoveLowToHigh(HAND axisHandle, TPvtMoveHighToLow pPrm);

        // 多段速：三段速运动（高低高）
        short OEM_MtPvt3Stage(HAND axisHandle, TPvtMove3Stage pPrm);

        // 配置坐标系速度补偿表
        // pCompTable：补偿表
        // group:补偿表格的序号，取值范围[0,LASER_CRDVELCOMP_GROUP_MAX)
        short OEM_LaserSetCrdVelCompTable(HAND devHandle, TLaserCrdVelCompTable pCompTable, short group);
        short OEM_LaserGetCrdVelCompTable(HAND devHandle, TLaserCrdVelCompTable pCompTable, short group);

        // 启用或关闭速度补偿功能
        // crdNo: 坐标系编号，[0,1]
        // onOff：启用或关闭，0：关闭补偿功能，1：启用补偿功能
        // group:补偿表格的序号，取值范围[0,LASER_CRDVELCOMP_GROUP_MAX)
        // laserCh:激光通道号
        short OEM_LaserCrdVelCompOnOff(HAND devHandle, short crdNo, short onOff, short group, short laserCh);

        // 启用或关闭速度补偿功能,缓冲区指令
        // onOff：启用或关闭，0：关闭补偿功能，1：启用补偿功能
        // group:补偿表格的序号，取值范围[0,LASER_CRDVELCOMP_GROUP_MAX)
        // laserCh:激光通道号
        short OEM_CrdBufLaserCrdVelCompOnOff(HAND crdHandle, int segNo, short onOff, short group, short laserCh);

        // 读取单轴急停DI的触发状态
        // pTrigSts:是否触发，1表示已经触发。NMC_MtSetEstopDIMask/NMC_MtSetEstopDI指令会复位触发状态。
        // pTrigIndex:本次触发的di序号。NMC_MtSetEstopDIMask/NMC_MtSetEstopDI指令会复位触发状态。        
        short OEM_MtGetEstopDITrigSts(HAND axisHandle, ShortByReference pTrigSts, ShortByReference pTrigIndex);

        // 缓冲区启动单轴PTP二段速运动
        // segNo:段号
        // axisNo：轴号，取值[0,n),非坐标系内轴
        // tgtPos：目标位置
        // blockEn:0:非阻塞非同步，1：阻塞
        // 二段速的参数参考TPtpTwoStagePrm定义
        short OEM_CrdBufSetPtpTwoStage(HAND crdHandle, int segNo, short axisNo, int tgtPos, short inType, short inIndex, short inTrigLevel, short action, double prm1, double prm2, double prm3, double prm4, short blockEn);
        
        // 缓冲区单轴移动参数设置
        // segNo:段号
        // axisNo：轴号,[0,n]
        // vel:运动速度
        // acc:运动加速度
        // dec:运动减加速度
        // velS:运动启动速度
        // velE:运动终点速度
        // smoothCoef:平滑系数
        short OEM_CrdBufSetPtpMoveParaEx(HAND crdHandle, int segNo, short axisNo, double vel, double acc, double dec, double velS, double velE, short soomthCoef);
        
        // 缓冲区补偿激光偏移值
        // segNo:段号
        // compType:bias类型，0:能量 1:跟随系数 2:option值
        // bias:偏移值
        // ch:激光通道
        short OEM_CrdBufSetLaserBias(HAND crdHandle, int segNo, short biasType, double bias, short ch);
        short OEM_LaserSetBias(HAND devHandle, short biasType, double bias, short ch);

        // 配置Uart端口在自由模式下的通讯参数
        // pParam:参数
        // ch:保留，请写0
        short OEM_DevUartSetPara(HAND devHandle, TUartPara pParam, short ch);

        // 获取Uart端口的参数
        short OEM_DevUartGetPara(HAND devHandle, TUartPara pParam, short ch);

        // 打开或关闭UART
        // onOff:0：关闭，1：打开
        // ch:保留，请写0
        short OEM_DevUartOnOff(HAND devHandle, short onOff, short ch);

        // 读Uart端口
        // onOff:0：关闭，1：打开
        // pBuf:读数据接收缓存区
        // readLen:需要读取的数据长度，byte,一次最多读256字节
        // retLen:实际读到的数据长度，byte
        // ch:保留，请写0
        short OEM_DevUartRead(HAND devHandle, byte[] pBuf, short readLen, ShortByReference retLen, short ch);

        // 写Uart端口
        // onOff:0：关闭，1：打开
        // pBuf:写数据
        // writeLen:写的数据长度，byte,一次最多写256字节
        // writedLen:实际写出的数据长度，byte
        // ch:保留，请写0
        short OEM_DevUartWrite(HAND devHandle, byte[] pBuf, short writeLen, ShortByReference writedLen, short ch);

        // 清除接收缓存
        short OEM_DevUartClrRx(HAND devHandle, short ch);

        // 获取当前串口收到的数据长度
        // pOnOff:打开状态
        // pLen:缓存的数据长度
        // ch:保留，请写0
        short OEM_DevUartGetRxLen(HAND devHandle, ShortByReference pOnOff, LongByReference pLen, short ch);

        // 带减速度的单轴停止功能,
        // dec:减速度,单位：pulse/ms^2
        // 注意：1.仅对PTP及Jog运动有效，对于其他运动模式，等同于NMC_MtStop
        // 2.如果指定的减速度太小，则自动按照合适的减速度减速为0
        short OEM_MtStopEx(HAND axisHandle, double dec);

        // 周期同步
        short OEM_Sync(HAND devHandle);

        // 设置重复捕获Ex的参数
        // pParam:重复捕获cans
        // ch:通道号，保留，请填0
        short OEM_CaptRepeatSetParamEx(HAND devHandle, TRepeatCaptParamEx pParam, short ch);
        short OEM_CaptRepeatGetParamEx(HAND devHandle, TRepeatCaptParamEx pParam, short ch);

        // 启动或关闭重复捕获
        // onOff:1:开，0:关
        // ch:通道号，保留，请填0
        short OEM_CaptRepeatOnOffEx(HAND devHandle, short onOff, short ch);

        // 读取重复捕获计数
        // pOnOff:onOff状态
        // pLeftCount:剩余的捕获次数
        // pSumCnt:累计捕获次数
        // pGetCount:已经获取的次数
        // ch:通道号，保留，请填0
        short OEM_CaptRepeatGetStatusEx(HAND devHandle, ShortByReference pOnOff, LongByReference pLeftCount, LongByReference pGetCount, LongByReference pSumCnt, short ch);
        
        // 读取重复捕获位置值
        // pPosArray:返回的位置值数组
        // count:要读取的触发位置组数，取值范围[1,32]
        // 注意：捕获每触发一次，会产生n个位置数据（多轴），比如同时捕获四个轴，则count=1表示拿回四个位置值
        // pGetCount:实际返回的数目
        // ch:通道号，保留，请填0
        short OEM_CaptRepeatGetPosEx(HAND devHandle, LongByReference pPosArray, short count, ShortByReference pGetCount, short ch);

        // Modbus初始化
        // pParam:参数
        short OEM_ModbusInit(HAND devHandle, TModbusParam pParam);

        // Modbus寄存器参数读取
        // regType:寄存器类型,0:din,bit;1:coil,bit;2:input word,4:holding,word
        // pRegCnt:寄存器个数
        // pStartAddr:寄存器起始地址
        short OEM_ModbusGetRegParam(HAND devHandle, short regType, ShortByReference pRegCnt, LongByReference pStartAddr);

        // Modbus寄存器参数设置
        // regType:寄存器类型,0:din,bit;1:coil,bit;2:input word,4:holding,word
        // regCnt:寄存器个数
        // startAddr:寄存器起始地址
        short OEM_ModbusSetRegParam(HAND devHandle, short regType, short regCnt, int startAddr);

        // Modbus参数读取
        // pParam:参数
        short OEM_ModbusGetParam(HAND devHandle, TModbusParam pParam);

        // 获取当前的modbus参数
        // pSts:
        // 0:unset
        // 1:slave mode, unconnected
        // 2:slave mode, connected
        // 3:master mode, unconnected
        // 4:master mode, connected
        short OEM_ModbusGetSts(HAND devHandle, ShortByReference pSts);

        // Modbus关闭
        // flag:1表示切换回扩展模块模式，其他标志只关闭Modbus
        short OEM_ModbusClose(HAND devHandle, short flag);

        // Modebus:读取开关输入
        // offset:地址偏移
        // count:数据数量
        // pBuff:返回的数据
        // slaveAddr:对于控制器作为从站，该参数可选或无效，控制器作为主站，表示从站地址[1~127]
        short OEM_ModbusGetDin(HAND devHandle, short offset, short count, byte[] pBuff, short slaveAddr);

        // Modebus:读取线圈输入
        // offset:地址偏移
        // count:数据数量
        // pBuff:返回的数据
        // slaveAddr:对于控制器作为从站，该参数可选或无效，控制器作为主站，表示从站地址[1~127]
        short OEM_ModbusGetCoil(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr);

        // Modebus:读取保持寄存器
        // offset:地址偏移
        // count:数据数量
        // pBuff:返回的数据
        // slaveAddr:对于控制器作为从站，该参数可选或无效，控制器作为主站，表示从站地址[1~127]
        short OEM_ModbusGetHolding(HAND devHandle, short offset, short count,byte[] pBuff,short slaveAddr);

        // Modebus:读取16位输入寄存器
        // offset:地址偏移
        // count:数据数量
        // pBuff:返回的数据
        // slaveAddr:对于控制器作为从站，该参数可选或无效，控制器作为主站，表示从站地址[1~127]
        short OEM_ModbusGetInput(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr);

        // Modebus:写开关输入
        // offset:地址偏移
        // count:数据数量
        // pBuff:数据
        // slaveAddr:对于控制器作为从站，该参数可选或无效，控制器作为主站，表示从站地址[1~127]
        short OEM_ModbusSetDin(HAND devHandle, short offset, short count, byte[] pBuff, short slaveAddr);

        // Modebus:写线圈输入
        // offset:地址偏移
        // count:数据数量
        // pBuff:数据
        // slaveAddr:对于控制器作为从站，该参数可选或无效，控制器作为主站，表示从站地址[1~127]
        short OEM_ModbusSetCoil(HAND devHandle, short offset, short count, byte[] pBuff, short slaveAddr);

        // Modebus:写保持寄存器
        // offset:地址偏移
        // count:数据数量
        // pBuff:数据
        // slaveAddr:对于控制器作为从站，该参数可选或无效，控制器作为主站，表示从站地址[1~127]
        short OEM_ModbusSetHolding(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr);
        short OEM_ModbusSetInput(HAND devHandle, short offset, short count, byte[] pBuff, short slaveAddr);

        // 设置对称运动参数
        short OEM_CrdSetSymmParam(HAND crdHandle, TCrdSymmParam pParam);

        // 启动或关闭对称跟随运动
        short OEM_CrdBufSymmOnOff(HAND crdHandle, int segNo, short onOff);

        // 设置圆形限位区域 
        // pPara:参数
        // chn:通道号，可以设置多组
        short OEM_SetCircleLimit(HAND devHandle, TCircleLimitPara pPara, short chn);
        short OEM_GetCircleLimit(HAND devHandle, TCircleLimitPara pPara, short chn);

        // 振镜控制数据清除
        short OEM_ScanBufClr(HAND devHandle, short chn);

        // 振镜控制的启动及停止，0：停止，1:启动
        short OEM_ScanOnOff(HAND devHandle, short onOff, short chn);

        // 所有数据压完
        short OEM_ScanEndList(HAND devHandle, short chn);

        // 振镜控制指令，运动指令,绝对运动
        // pXPosArray:x方向的位置数据
        // pYPosArray:y方向的位置数据
        // cnt:数组包含的数据个数
        short OEM_ScanBufMoveAbs(HAND devHandle, ShortByReference pXPosArray, ShortByReference pYPosArray, short cnt, short chn);
        short OEM_ScanBufMoveRel(HAND devHandle, ShortByReference pXPosArray, ShortByReference pYPosArray, short cnt, short chn);

        // 振镜控制指令，设置位置模式
        // posMode:位置模式，0：绝对，默认，1：相对
        short OEM_ScanBufSetPosMode(HAND devHandle, short posMode, short chn);

        // 振镜控制指令，更新段号
        // segNo:段号
        short OEM_ScanBufSetSegNo(HAND devHandle, int segNo, short chn);

        // 振镜控制指令，延时指令
        // delayUs:延时时间，单位us
        short OEM_ScanBufDelay(HAND devHandle, int delayUs, short chn);

        // 振镜控制指令，激光开关指令
        // laserOnOff:开关
        short OEM_ScanBufLaserOnOff(HAND devHandle, short laserOnOff, short chn);

        // 振镜控制指令，激光开关光延时
        // onDelay:开光延时，单位us,取值范围[0,65535]
        // offDelay:关光延时，单位us,取值范围[0,65535]
        short OEM_ScanBufLaserSetOnOffDelay(HAND devHandle, double onDelay, double offDelay, short chn);

        // 振镜控制指令，激光能量PWM设置
        // pulseWid:PWM宽度，单位us,取值范围[0.25,16000]
        // onTime:on时间，单位us,,取值范围[0.25,16000]
        short OEM_ScanBufLaserSetPowerPwm(HAND devHandle, double pulseWid, double onTime, short chn);

        // 振镜控制指令，激光能量DAC设置
        // dac:电压输出值
        short OEM_ScanBufLaserSetPowerDac(HAND devHandle, short dac, short chn);

        // 获取振镜的运行状态
        short OEM_ScanGetSts(HAND devHandle, TOemScanSts pSts, short chn);

        // 手动：运动到指定点
        short OEM_ScanMoveAbs(HAND devHandle, short x, short y, short chn);

        // 手动：开光
        short OEM_ScanLaserOnOff(HAND devHandle, short onOff, short chn);

        // 手动：输出PWM
        // pulseWid:PWM宽度，单位us,取值范围[0.5,16000]
        // onTime:on时间，单位us
        short OEM_ScanLaserPowerPwm(HAND devHandle, double pulseWid, double onTime, short chn);

        // 手动：输出DAC
        short OEM_ScanLaserPowerDac(HAND devHandle, short dac, short chn);

        // 事件配置
        // pEventCfg:配置参数，参见结构体定义
        // chn:通道号，取值范围[0,EVENT_MAX_CHN)
        short OEM_DevEventSetConfig(HAND devHandle, TEventConfig pEventCfg, short chn);

        // 获取事件配置
        // pEventCfg:配置参数，参见结构体定义
        // chn:通道号，取值范围[0,EVENT_MAX_CHN)
        short OEM_DevEventGetConfig(HAND devHandle, TEventConfig pEventCfg, short chn);

        // 获取事件开关
        // onOff:开关，0:关 1:开
        // chn:通道号，取值范围[0,EVENT_MAX_CHN)
        short OEM_DevEventSetOnOff(HAND devHandle, short onOff, short chn);

        // 获取状态
        // pOnOff:开关状态，0:关 1:开
        // pTrigCnt:触发计数
        // chn:通道号，取值范围[0,EVENT_MAX_CHN)
        short OEM_DevEventGetSts(HAND devHandle, ShortByReference pTrigCnt, ShortByReference pOnOff, short chn);

        // 缓冲区配置事件及开关
        // pEventCfg:配置信息
        // onOff:是否立即开启关闭
        // chn:通道号，取值范围[0,EVENT_MAX_CHN)
        short OEM_CrdBufEventSetConfig(HAND crdHandle, int segNo, TEventConfig pEventCfg, short onOff, short chn);

        // 缓冲区事件开关
        // onOff:是否立即开启关闭
        // chn:通道号，取值范围[0,EVENT_MAX_CHN)
        short OEM_CrdBufEventSetOnOff(HAND crdHandle, int segNo, short onOff, short chn);

        // 缓冲区等待事件触发
        // trigCnt:触发的事件计数
        // timeOut:超时 单位:ms
        // chn:通道号，取值范围[0,EVENT_MAX_CHN)
        short OEM_CrdBufEventWait(HAND crdHandle, int segNo, short trigCnt, int timeOut, short chn);

        // 机构示教开始
        // startPos:起始位置，单位:脉冲
        // interval:间隔，单位:脉冲
        // sectCount:示教的段数
        // pFileNameToSaveTechData:示教数据的存储文件
        short OEM_MtLeadScrewTechRun(HAND axisHandle, int startPos, int interval, int sectCount, String pFileNameToSaveTechData);

        // 机构示教过程状态查询
        // pRun:运行状态，0：停止中，1：正在运行，其他：错误代码
        // pPercent:运行的进度百分比
        short OEM_MtLeadScrewTechSts(HAND axisHandle, ShortByReference pRun, ShortByReference pPercent);

        // 机构示教强制终止
        short OEM_MtLeadScrewTechBreak(HAND axisHandle);

        // 加载机构示教数据
        // pFileNameTechData:数据文件名
        short OEM_MtLeadScrewTechLoad(HAND axisHandle, String pFileNameTechData);

        // 两段速PTP运动
        // pPrfTime:对于规划位置触发，返回整个规划需要的时间
        short OEM_MtMovePtpAbsTwoStageEx(HAND axisHandle, TPtpTwoStagePrm[] pPrm, DoubleByReference pPrfTime);

        // 功能：2维位置比较自动连续输出
        // onOff： 0 停止,1输出 注意：NMC_Comp2DimensOnoff关闭也可以实现关闭连续输出
        // group:组号,0 或者1
        // outInteval:输出间隔，单位us
        // outCnt:输出次数
        // chn:保留,设为0
        short OEM_Comp2DimensOutPulse(HAND devHandle, short group, short onOff, int outInteval, int outCnt, short chn);

        // PT及PVT OEM
        // 查询PT数据剩余空间大小
        // pSpace:返回的剩余空间大小
        // pUsed: 已使用的空间段数
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        short OEM_MtPtGetSpaceEx(HAND axisHandle, ShortByReference pSpace, ShortByReference pUsed, short fifo);

        // 向Pt运动缓存区中压运动数据段
        // count:压入的数据段数
        // pPosArray:段运行距离
        // pTimeArray:段运行时间
        // pTypeArray:段类型,见宏定义
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        short OEM_MtPtPushEx(HAND axisHandle, short count, DoubleByReference pPosArray, LongByReference pTimeArray, ShortByReference pTypeArray, short fifo);

        // 清空PT数据
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        short OEM_MtPtBufClrEx(HAND axisHandle, short fifo);

        // 启动Pt运动
        // otherSynAxCnts： 不包括axisHandle 的其他同步启动轴数量
        // pOtherSynAxArray: 其他同步启动轴的序号：0~N
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        short OEM_MtPtStartMtnEx(HAND axisHandle, short otherSynAxCnts, ShortByReference pOtherSynAxArray, short fifo);

        // 向PVT运动缓存区中压运动数据段
        // count:压入的数据段数：1~32
        // pPosArray:段运行距离
        // pTimeArray:段运行时间
        // pVelArray:段运行速度
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        short OEM_MtPvtDataEx(HAND axisHandle, short count, DoubleByReference pPosArray, DoubleByReference pTimeArray, DoubleByReference pVelArray, short fifo);
        
        // 查询PVT数据剩余空间大小
        // pFreeSpace:返回的剩余空间大小
        // pUsedSpace: 已使用的空间段数
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        short OEM_MtPvtBufGetSpaceEx(HAND axisHandle, ShortByReference pFreeSpace, ShortByReference pUsedSpace, short fifo);

        // 清空PVT数据
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        short OEM_MtPvtBufClrEx(HAND axisHandle, short fifo);

        // 启动Pvt运动
        // otherSynAxCnts： 不包括axisHandle 的其他同步启动轴数量
        // pOtherSynAxArray: 其他同步启动轴的序号：0~N
        // fifo:在数据贮存模式下，使用的FIFO编号，取值范围[0,1]
        // 注：同步的轴必须属于同一个控制器
        short OEM_MtPvtStartMtnEx(HAND axisHandle, short otherSynAxCnts, ShortByReference pOtherSynAxArray, short fifo);

        // 获取编码器位置（补偿前）
        // pEncPosEx:补偿前的编码器位置
        short OEM_MtGetEncPosEx(HAND axisHandle, LongByReference pEncPosEx);

        //设置单轴编码器的配置
        short OEM_MtSetEncCfg(HAND axisHandle, TEncoderCfg pPara);

        //获取单轴编码器的配置
        short OEM_MtGetEncCfg(HAND axisHandle, TEncoderCfg pPara);

        // 设置多维位置比较
        // pParam:参数  group:组号，取值[0,n]
        short OEM_CompXDimensExSetParam(HAND devHandle, TCompXDimensExParam pParam, short group);
        short OEM_CompXDimensExGetParam(HAND devHandle, TCompXDimensExParam pParam, short group);

        // 压入Ptp多轴运动参数
        // axisCnt:参与的轴数量，取值范围[1,4]
        // pAxisList:参与的轴列表数组
        // unitCnt:运动的段数量，取值范围[1,4]
        // pMvUnitList:运动的段数组列表，数组长度为axisCnt*unitCnt
        // group:组号，取值范围[0,1]
        short OEM_PtpBufMvPushData(HAND devHandle, short axisCnt, ShortByReference pAxisList, short unitCnt,TPtpBufMvUnit pMvUnitList, short group);

        // 启动Ptp多轴运动
        // group:组号，取值范围[0,1]
        short OEM_PtpBufMvStart(HAND devHandle, short group);

        // 停止Ptp多轴运动
        // group:组号，取值范围[0,1]
        short OEM_PtpBufMvStop(HAND devHandle, short group);

        // 查询Ptp多轴运动状态
        // group:组号，取值范围[0,1]
        // pSts:状态
        short OEM_PtpBufMvSts(HAND devHandle, TPtpBufMvSts pSts, short group);

        // 功能：设置多维位置比较数据
        // pArrayPos:比较数据位置值
        // count:位置点数,count=0表示清除已经缓存的数据。一次性最多压入128组数据
        // group:组号,0 或者1
        short OEM_CompXDimensExSetData(HAND devHandle, LongByReference pArrayPos, short count, short group);

        // 功能：清除多维位置比较数据
        short OEM_CompXDimensExClrData(HAND devHandle, short group);

        // 功能：多维位置比较使能
        // onOff： 0 停止,1输出 
        short OEM_CompXDimensExOnoff(HAND devHandle, short onOff, short group);

        // 功能：多维位置比较手动输出
        short OEM_CompXDimensExManual(HAND devHandle, short outCnt, short group);

        // 功能：多维位置比较的输出状态
        // pStatus: 状态结构体
        // group:组号,0 或者1
        short OEM_CompXDimensExGetSts(HAND devHandle, TCompXDimensExSts pStatus, short group);

        // 多轴运动配置
        short NMC_MultiLineSetsysPara(HAND multiHandle, ShortByReference pMapNo, short mapNum);

        // 压入多轴运动数据
        short NMC_MultiLineAddMoveData(HAND multiHandle, DoubleByReference pEndPos,double vel, double acc, double dec,double blendRatio, long userID);

        // 清除多轴运动数据
        short NMC_MultiLineClrData(HAND multiHandle, LongByReference pSpace);

        // 启动多轴运动
        short NMC_MultiLineStart(HAND multiHandle);

        // 停止多轴运动
        short NMC_MultiLineStop(HAND multiHandle, short stopType);

        // 获取多轴运动状态
        short NMC_MultiLineGetSts(HAND multiHandle, ShortByReference pRunSts, ShortByReference pErr);

        // 其他相关指令
        short NMC_MultiLineOpen(HAND devHandle, PHAND pMultiLinedHandle);
        short NMC_MultiLineClose(PHAND pMultiLinedHandle);
        short NMC_MultiLineGetsysPara(HAND multiHandle, ShortByReference pMapNo,ShortByReference pMapNum, ShortByReference pIsActive);
        short NMC_MultiLineDelete(HAND multiHandle);
        short NMC_MultiLineSetOverRide(HAND multiHandle, double ratio);
        short NMC_MultiLineGetOverRide(HAND multiHandle, DoubleByReference pRatio);
        short NMC_MultiLineGetUserID(HAND multiHandle, LongByReference pUserID);
        short NMC_MultiLineGetDataSpace(HAND multiHandle, LongByReference pSpace);
        short NMC_MultiLineGetPrfVel(HAND multiHandle, DoubleByReference pVel);
        short NMC_MultiLineClrErr(HAND multiHandle);
    }

    private static final NativeLib lib = NativeLib.INSTANCE;

    public static short OEM_MtSetMinEventTime(HAND axisHandle, short minEvenTime, short param1, short param2, short param3) {
        return lib.OEM_MtSetMinEventTime(axisHandle, minEvenTime, param1, param2, param3);
    }

    public static short OEM_MtGetMinEventTime(HAND axisHandle, ShortByReference minEvenTime, ShortByReference param1, ShortByReference param2, ShortByReference param3) {
        return lib.OEM_MtGetMinEventTime(axisHandle, minEvenTime, param1, param2, param3);
    }

    public static short OEM_PtpSync(HAND devHandle, short mask, LongByReference pPosArray) {
        return lib.OEM_PtpSync(devHandle, mask, pPosArray);
    }

    public static short OEM_Comp2DimensSetDataGroup(HAND devHandle, short group, TComp2DimensDataGroup[] pArrayGroup, short count, short chn) {
        return lib.OEM_Comp2DimensSetDataGroup(devHandle, group, pArrayGroup, count, chn);
    }

    public static short NMC_CrdSetDoubleHeadPara(HAND crdHandle, int offsetX, int offsetY, ShortByReference pAxisNo) {
        return lib.NMC_CrdSetDoubleHeadPara(crdHandle, offsetX, offsetY, pAxisNo);
    }

    public static short NMC_CrdGetDoubleHeadPara(HAND crdHandle, LongByReference pOffsetX, LongByReference pOffsetY, ShortByReference pAxisNo) {
        return lib.NMC_CrdGetDoubleHeadPara(crdHandle, pOffsetX, pOffsetY, pAxisNo);
    }

    public static short NMC_CrdBufObjectSwitch(HAND crdHandle, int segNo, int rotX, int rotY, int tgtPosX, int tgtPosY, int deltaX, int deltaY, double theta, double vel, double acc) {
        return lib.NMC_CrdBufObjectSwitch(crdHandle, segNo, rotX, rotY, tgtPosX, tgtPosY, deltaX, deltaY, theta, vel, acc);
    }

    public static short NMC_CrdBufSecondHeadSyncMoveOn(HAND crdHandle, int segNo) {
        return lib.NMC_CrdBufSecondHeadSyncMoveOn(crdHandle, segNo);
    }

    public static short NMC_CrdBufSecondHeadSyncMoveOff(HAND crdHandle, int segNo) {
        return lib.NMC_CrdBufSecondHeadSyncMoveOff(crdHandle, segNo);
    }

    public static short OEM_CrdBufLaserSetParamTableIdx(HAND crdHandle, int segNo, short tableIdx, short laserCh) {
        return lib.OEM_CrdBufLaserSetParamTableIdx(crdHandle, segNo, tableIdx, laserCh);
    }

    public static short OEM_LaserSetParamTableIdx(HAND devHandle, short tableIdx, short laserCh) {
        return lib.OEM_LaserSetParamTableIdx(devHandle, tableIdx, laserCh);
    }

    public static short OEM_LaserSetParamTableUnit(HAND devHandle, short tableIdx,  TLaserParamTableUnit pParamUnit) {
        return lib.OEM_LaserSetParamTableUnit(devHandle, tableIdx, pParamUnit);
    }

    public static short OEM_LaserGetParamTableUnit(HAND devHandle, short tableIdx,  TLaserParamTableUnit pParamUnit) {
        return lib.OEM_LaserGetParamTableUnit(devHandle, tableIdx, pParamUnit);
    }

    public static short OEM_MtPvtMoveHighToLow(HAND axisHandle, TPvtMoveHighToLow pPrm) {
        return lib.OEM_MtPvtMoveHighToLow(axisHandle, pPrm);
    }

    public static short OEM_MtPvtMoveLowToHigh(HAND axisHandle, TPvtMoveHighToLow pPrm) {
        return lib.OEM_MtPvtMoveLowToHigh(axisHandle, pPrm);
    }

    public static short OEM_MtPvt3Stage(HAND axisHandle, TPvtMove3Stage pPrm) {
        return lib.OEM_MtPvt3Stage(axisHandle, pPrm);
    }

    public static short OEM_LaserSetCrdVelCompTable(HAND devHandle, TLaserCrdVelCompTable pCompTable, short group) {
        return lib.OEM_LaserSetCrdVelCompTable(devHandle, pCompTable, group);
    }

    public static short OEM_LaserGetCrdVelCompTable(HAND devHandle, TLaserCrdVelCompTable pCompTable, short group) {
        return lib.OEM_LaserGetCrdVelCompTable(devHandle, pCompTable, group);
    }

    public static short OEM_LaserCrdVelCompOnOff(HAND devHandle, short crdNo, short onOff, short group, short laserCh) {
        return lib.OEM_LaserCrdVelCompOnOff(devHandle, crdNo, onOff, group, laserCh);
    }

    public static short OEM_CrdBufLaserCrdVelCompOnOff(HAND crdHandle, int segNo, short onOff, short group, short laserCh) {
        return lib.OEM_CrdBufLaserCrdVelCompOnOff(crdHandle, segNo, onOff, group, laserCh);
    }

    public static short OEM_MtGetEstopDITrigSts(HAND axisHandle, ShortByReference pTrigSts, ShortByReference pTrigIndex) {
        return lib.OEM_MtGetEstopDITrigSts(axisHandle, pTrigSts, pTrigIndex);
    }

    public static short OEM_CrdBufSetPtpTwoStage(HAND crdHandle, int segNo, short axisNo, int tgtPos, short inType, short inIndex, short inTrigLevel, short action, double prm1, double prm2, double prm3, double prm4, short blockEn) {
        return lib.OEM_CrdBufSetPtpTwoStage(crdHandle, segNo, axisNo, tgtPos, inType, inIndex, inTrigLevel, action, prm1, prm2, prm3, prm4, blockEn);
    }

    public static short OEM_CrdBufSetPtpMoveParaEx(HAND crdHandle, int segNo, short axisNo, double vel, double acc, double dec, double velS, double velE, short soomthCoef) {
        return lib.OEM_CrdBufSetPtpMoveParaEx(crdHandle, segNo, axisNo, vel, acc, dec, velS, velE, soomthCoef);
    }

    public static short OEM_CrdBufSetLaserBias(HAND crdHandle, int segNo, short biasType, double bias, short ch) {
        return lib.OEM_CrdBufSetLaserBias(crdHandle, segNo, biasType, bias, ch);
    }

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

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

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

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

    public static short OEM_DevUartRead(HAND devHandle, byte[] pBuf, short readLen, ShortByReference retLen, short ch) {
        return lib.OEM_DevUartRead(devHandle, pBuf, readLen, retLen, ch);
    }

    public static short OEM_DevUartWrite(HAND devHandle, byte[] pBuf, short writeLen, ShortByReference writedLen, short ch) {
        return lib.OEM_DevUartWrite(devHandle, pBuf, writeLen, writedLen, ch);
    }

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

    public static short OEM_DevUartGetRxLen(HAND devHandle, ShortByReference pOnOff, LongByReference pLen, short ch) {
        return lib.OEM_DevUartGetRxLen(devHandle, pOnOff, pLen, ch);
    }

    public static short OEM_MtStopEx(HAND axisHandle, double dec) {
        return lib.OEM_MtStopEx(axisHandle, dec);
    }

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

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

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

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

    public static short OEM_CaptRepeatGetStatusEx(HAND devHandle, ShortByReference pOnOff, LongByReference pLeftCount, LongByReference pGetCount, LongByReference pSumCnt, short ch) {
        return lib.OEM_CaptRepeatGetStatusEx(devHandle, pOnOff, pLeftCount, pGetCount, pSumCnt, ch);
    }

    public static short OEM_CaptRepeatGetPosEx(HAND devHandle, LongByReference pPosArray, short count, ShortByReference pGetCount, short ch) {
        return lib.OEM_CaptRepeatGetPosEx(devHandle, pPosArray, count, pGetCount, ch);
    }

    public static short OEM_ModbusInit(HAND devHandle, TModbusParam pParam) {
        return lib.OEM_ModbusInit(devHandle, pParam);
    }

    public static short OEM_ModbusGetRegParam(HAND devHandle, short regType, ShortByReference pRegCnt, LongByReference pStartAddr) {
        return lib.OEM_ModbusGetRegParam(devHandle, regType, pRegCnt, pStartAddr);
    }

    public static short OEM_ModbusSetRegParam(HAND devHandle, short regType, short regCnt, int startAddr) {
        return lib.OEM_ModbusSetRegParam(devHandle, regType, regCnt, startAddr);
    }

    public static short OEM_ModbusGetParam(HAND devHandle, TModbusParam pParam) {
        return lib.OEM_ModbusGetParam(devHandle, pParam);
    }

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

    public static short OEM_ModbusClose(HAND devHandle, short flag) {
        return lib.OEM_ModbusClose(devHandle, flag);
    }

    public static short OEM_ModbusGetDin(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusGetDin(devHandle, offset, count,pBuff, slaveAddr);
    }

    public static short OEM_ModbusGetCoil(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusGetCoil(devHandle, offset, count, pBuff, slaveAddr);
    }

    public static short OEM_ModbusGetHolding(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusGetHolding(devHandle, offset, count, pBuff, slaveAddr);
    }

    public static short OEM_ModbusGetInput(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusGetInput(devHandle, offset, count, pBuff, slaveAddr);
    }

    public static short OEM_ModbusSetDin(HAND devHandle, short offset, short count, byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusSetDin(devHandle, offset, count, pBuff, slaveAddr);
    }

    public static short OEM_ModbusSetCoil(HAND devHandle, short offset, short count, byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusSetCoil(devHandle, offset, count, pBuff, slaveAddr);
    }

    public static short OEM_ModbusSetHolding(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusSetHolding(devHandle, offset, count, pBuff, slaveAddr);
    }

    public static short OEM_ModbusSetInput(HAND devHandle, short offset, short count,byte[] pBuff, short slaveAddr) {
        return lib.OEM_ModbusSetInput(devHandle, offset, count, pBuff, slaveAddr);
    }

    public static short OEM_CrdSetSymmParam(HAND crdHandle, TCrdSymmParam pParam) {
        return lib.OEM_CrdSetSymmParam(crdHandle, pParam);
    }

    public static short OEM_CrdBufSymmOnOff(HAND crdHandle, int segNo, short onOff) {
        return lib.OEM_CrdBufSymmOnOff(crdHandle, segNo, onOff);
    }

    public static short OEM_SetCircleLimit(HAND devHandle, TCircleLimitPara pPara, short chn) {
        return lib.OEM_SetCircleLimit(devHandle, pPara, chn);
    }

    public static short OEM_GetCircleLimit(HAND devHandle, TCircleLimitPara pPara, short chn) {
        return lib.OEM_GetCircleLimit(devHandle, pPara, chn);
    }

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

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

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

    public static short OEM_ScanBufMoveAbs(HAND devHandle, ShortByReference pXPosArray, ShortByReference pYPosArray, short cnt, short chn) {
        return lib.OEM_ScanBufMoveAbs(devHandle, pXPosArray, pYPosArray, cnt, chn);
    }

    public static short OEM_ScanBufMoveRel(HAND devHandle, ShortByReference pXPosArray, ShortByReference pYPosArray, short cnt, short chn) {
        return lib.OEM_ScanBufMoveRel(devHandle, pXPosArray, pYPosArray, cnt, chn);
    }

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

    public static short OEM_ScanBufSetSegNo(HAND devHandle, int segNo, short chn) {
        return lib.OEM_ScanBufSetSegNo(devHandle, segNo, chn);
    }

    public static short OEM_ScanBufDelay(HAND devHandle, int delayUs, short chn) {
        return lib.OEM_ScanBufDelay(devHandle, delayUs, chn);
    }

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

    public static short OEM_ScanBufLaserSetOnOffDelay(HAND devHandle, double onDelay, double offDelay, short chn) {
        return lib.OEM_ScanBufLaserSetOnOffDelay(devHandle, onDelay, offDelay, chn);
    }

    public static short OEM_ScanBufLaserSetPowerPwm(HAND devHandle, double pulseWid, double onTime, short chn) {
        return lib.OEM_ScanBufLaserSetPowerPwm(devHandle, pulseWid, onTime, chn);
    }

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

    public static short OEM_ScanGetSts(HAND devHandle, TOemScanSts pSts, short chn) {
        return lib.OEM_ScanGetSts(devHandle, pSts, chn);
    }

    public static short OEM_ScanMoveAbs(HAND devHandle, short x, short y, short chn) {
        return lib.OEM_ScanMoveAbs(devHandle, x, y, chn);
    }

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

    public static short OEM_ScanLaserPowerPwm(HAND devHandle, double pulseWid, double onTime, short chn) {
        return lib.OEM_ScanLaserPowerPwm(devHandle, pulseWid, onTime, chn);
    }

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

    public static short OEM_DevEventSetConfig(HAND devHandle, TEventConfig pEventCfg, short chn) {
        return lib.OEM_DevEventSetConfig(devHandle, pEventCfg, chn);
    }

    public static short OEM_DevEventGetConfig(HAND devHandle, TEventConfig pEventCfg, short chn) {
        return lib.OEM_DevEventGetConfig(devHandle, pEventCfg, chn);
    }

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

    public static short OEM_DevEventGetSts(HAND devHandle, ShortByReference pTrigCnt, ShortByReference pOnOff, short chn) {
        return lib.OEM_DevEventGetSts(devHandle, pTrigCnt, pOnOff, chn);
    }

    public static short OEM_CrdBufEventSetConfig(HAND crdHandle, int segNo, TEventConfig pEventCfg, short onOff, short chn) {
        return lib.OEM_CrdBufEventSetConfig(crdHandle, segNo, pEventCfg, onOff, chn);
    }

    public static short OEM_CrdBufEventSetOnOff(HAND crdHandle, int segNo, short onOff, short chn) {
        return lib.OEM_CrdBufEventSetOnOff(crdHandle, segNo, onOff, chn);
    }

    public static short OEM_CrdBufEventWait(HAND crdHandle, int segNo, short trigCnt, int timeOut, short chn) {
        return lib.OEM_CrdBufEventWait(crdHandle, segNo, trigCnt, timeOut, chn);
    }

    public static short OEM_MtLeadScrewTechRun(HAND axisHandle, int startPos, int interval, int sectCount, String pFileNameToSaveTechData) {
        return lib.OEM_MtLeadScrewTechRun(axisHandle, startPos, interval, sectCount, pFileNameToSaveTechData);
    }

    public static short OEM_MtLeadScrewTechSts(HAND axisHandle, ShortByReference pRun, ShortByReference pPercent) {
        return lib.OEM_MtLeadScrewTechSts(axisHandle, pRun, pPercent);
    }

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

    public static short OEM_MtLeadScrewTechLoad(HAND axisHandle, String pFileNameTechData) {
        return lib.OEM_MtLeadScrewTechLoad(axisHandle, pFileNameTechData);
    }

    public static short OEM_MtMovePtpAbsTwoStageEx(HAND axisHandle, TPtpTwoStagePrm[] pPrm, DoubleByReference pPrfTime) {
        return lib.OEM_MtMovePtpAbsTwoStageEx(axisHandle, pPrm, pPrfTime);
    }

    public static short OEM_Comp2DimensOutPulse(HAND devHandle, short group, short onOff, int outInteval, int outCnt, short chn) {
        return lib.OEM_Comp2DimensOutPulse(devHandle, group, onOff, outInteval, outCnt, chn);
    }

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

    public static short OEM_MtPtPushEx(HAND axisHandle, short count, DoubleByReference pPosArray, LongByReference pTimeArray, ShortByReference pTypeArray, short fifo) {
        return lib.OEM_MtPtPushEx(axisHandle, count, pPosArray, pTimeArray, pTypeArray, fifo);
    }

    public static short OEM_MtPtBufClrEx(HAND axisHandle, short fifo) {
        return lib.OEM_MtPtBufClrEx(axisHandle, fifo);
    }

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

    public static short OEM_MtPvtDataEx(HAND axisHandle, short count, DoubleByReference pPosArray, DoubleByReference pTimeArray, DoubleByReference pVelArray, short fifo) {
        return lib.OEM_MtPvtDataEx(axisHandle, count, pPosArray, pTimeArray, pVelArray, fifo);
    }

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

    public static short OEM_MtPvtBufClrEx(HAND axisHandle, short fifo) {
        return lib.OEM_MtPvtBufClrEx(axisHandle, fifo);
    }

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

    public static short OEM_MtGetEncPosEx(HAND axisHandle, LongByReference pEncPosEx) {
        return lib.OEM_MtGetEncPosEx(axisHandle, pEncPosEx);
    }

    public static short OEM_MtSetEncCfg(HAND axisHandle, TEncoderCfg pPara) {
        return lib.OEM_MtSetEncCfg(axisHandle, pPara);
    }

    public static short OEM_MtGetEncCfg(HAND axisHandle, TEncoderCfg pPara) {
        return lib.OEM_MtGetEncCfg(axisHandle, pPara);
    }

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

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

    public static short OEM_PtpBufMvPushData(HAND devHandle, short axisCnt, ShortByReference pAxisList, short unitCnt, TPtpBufMvUnit pMvUnitList, short group) {
        return lib.OEM_PtpBufMvPushData(devHandle, axisCnt, pAxisList, unitCnt, pMvUnitList, group);
    }

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

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

    public static short OEM_PtpBufMvSts(HAND devHandle, TPtpBufMvSts pSts, short group) {
        return lib.OEM_PtpBufMvSts(devHandle, pSts, group);
    }

    public static short OEM_CompXDimensExSetData(HAND devHandle, LongByReference pArrayPos, short count, short group) {
        return lib.OEM_CompXDimensExSetData(devHandle, pArrayPos, count, group);
    }

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

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

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

    public static short OEM_CompXDimensExGetSts(HAND devHandle, TCompXDimensExSts pStatus, short group) {
        return lib.OEM_CompXDimensExGetSts(devHandle, pStatus, group);
    }

    public static short NMC_MultiLineSetsysPara(HAND multiHandle, ShortByReference pMapNo, short mapNum) {
        return lib.NMC_MultiLineSetsysPara(multiHandle, pMapNo, mapNum);
    }

    public static short NMC_MultiLineAddMoveData(HAND multiHandle, DoubleByReference pEndPos,double vel, double acc, double dec,double blendRatio, long userID) {
        return lib.NMC_MultiLineAddMoveData(multiHandle, pEndPos, vel, acc, dec, blendRatio, userID);
    }

    public static short NMC_MultiLineClrData(HAND multiHandle, LongByReference pSpace) {
        return lib.NMC_MultiLineClrData(multiHandle, pSpace);
    }

    public static short NMC_MultiLineStart(HAND multiHandle) {
        return lib.NMC_MultiLineStart(multiHandle);
    }

    public static short NMC_MultiLineGetSts(HAND multiHandle, ShortByReference pRunSts, ShortByReference pErr) {
        return lib.NMC_MultiLineGetSts(multiHandle, pRunSts,pErr);
    }

    public static short NMC_MultiLineOpen(HAND devHandle, PHAND pMultiLinedHandle) {
        return lib.NMC_MultiLineOpen(devHandle, pMultiLinedHandle);
    }

    public static short NMC_MultiLineClose(PHAND pMultiLinedHandle) {
        return lib.NMC_MultiLineClose(pMultiLinedHandle);
    }

    public static short NMC_MultiLineGetsysPara(HAND multiHandle, ShortByReference pMapNo, ShortByReference pMapNum,
            ShortByReference pIsActive) {
        return lib.NMC_MultiLineGetsysPara(multiHandle, pMapNo, pMapNum, pIsActive);
    }

    public static short NMC_MultiLineDelete(HAND multiHandle) {
        return lib.NMC_MultiLineDelete(multiHandle);
    }

    public static short NMC_MultiLineSetOverRide(HAND multiHandle, double ratio) {
        return lib.NMC_MultiLineSetOverRide(multiHandle, ratio);
    }

    public static short NMC_MultiLineGetOverRide(HAND multiHandle, DoubleByReference pRatio) {
        return lib.NMC_MultiLineGetOverRide(multiHandle, pRatio);
    }

    public static short NMC_MultiLineGetUserID(HAND multiHandle, LongByReference pUserID) {
        return lib.NMC_MultiLineGetUserID(multiHandle, pUserID);
    }

    public static short NMC_MultiLineGetDataSpace(HAND multiHandle, LongByReference pSpace) {
        return lib.NMC_MultiLineGetDataSpace(multiHandle, pSpace);
    }

    public static short NMC_MultiLineGetPrfVel(HAND multiHandle, DoubleByReference pVel) {
        return lib.NMC_MultiLineGetPrfVel(multiHandle, pVel);
    }

    public static short NMC_MultiLineClrErr(HAND multiHandle) {
        return lib.NMC_MultiLineClrErr(multiHandle);
    }

}


