/// <summary> /// 卡初始化 /// </summary> /// <param name="card"></param> /// <param name="axisCount"></param> /// <param name="configFileName"></param> /// <returns></returns> public short _SR_InitCard() { ushort _num = 0; short returnValue = 0; if (tag_isInit == 0) { returnValue = (short)Dmc1000.d1000_board_init(); //获取卡数量 tag_isInit = 1; if (returnValue <= 0 || returnValue > 8) { string str = "DMC100B控制卡初始化失败!"; if (returnValue == 0) { str = str + "\r\n没有安装雷晒卡"; } if (returnValue == -1) { str = str + "没有安装端口驱动程序!"; } if (returnValue == -2) { str = str + "PCI桥故障!"; } MessageBoxLog.Show(str); return(-1); } } return(returnValue); }
/// <summary> /// 卡初始化 /// </summary> /// <param name="card"></param> /// <param name="axisCount"></param> /// <param name="configFileName"></param> /// <returns></returns> public short _SR_InitCard() { short returnValue = 0; if (tag_isInit == 0) { returnValue = (short)Dmc1000.d1000_board_init(); //获取卡数量 tag_CardCount = returnValue; tag_isInit = 1; if (returnValue <= 0 || returnValue > 8) { string str = "DMC100B控制卡初始化失败!"; if (returnValue == 0) { str = str + "\r\n没有安装雷赛卡"; } if (returnValue == -1) { str = str + "没有安装端口驱动程序!"; } if (returnValue == -2) { str = str + "PCI桥故障!"; } MessageBoxLog.Show(str); return(-1); } short i = 0; short j = 0; while (i < returnValue) { while (j < 4) { _SR_AxisStop(i, j); _SR_SetEncPos(i, j, 0); j++; } i++; } } return(returnValue); }