Commit 1c0fb29d LN

1

1 个父辈 136299d3
<?xml version="1.0"?>
<doc>
<assembly>
<name>HuichuanLibrary</name>
</assembly>
<members>
<member name="F:HuichuanLibrary.FrmHuiChuanTest.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:HuichuanLibrary.FrmHuiChuanTest.Dispose(System.Boolean)">
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
</member>
<member name="M:HuichuanLibrary.FrmHuiChuanTest.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.InitConfig(System.String,System.String,System.String)">
<summary>
初始化配置信息,初始化板卡之前,先初始化配置
</summary>
<param name="deviceConfigPath"></param>
<param name="systemConfigPath"></param>
<param name="logName"></param>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.OpenCard(System.Int32)">
<summary>
初始化板卡
</summary>
<param name="blockFlag">是否阻塞,1=阻塞,0=不阻塞</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.CloseCard">
<summary>
关闭板卡
</summary>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.CardInitOk(System.Boolean)">
<summary>
板卡是否已经初始化OK
</summary>
<param name="isShowLog"></param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.StartHomeMove(System.Int16,System.UInt32,System.UInt32,System.UInt32,System.Int16,System.Int32,System.UInt32,System.Int16)">
<summary>
开始回零
</summary>
<param name="axisNo">轴号</param>
<param name="highVel">回零高速</param>
<param name="lowVel">回零低速</param>
<param name="acc">回零加速度</param>
<param name="homeMethod">回零方法,默认28</param>
<param name="offset">回零偏移,默认0</param>
<param name="overtime">超时时间,默认120000</param>
<param name="posSrc">端子板信号源,默认0</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.HomeingIsEnd(System.Int16)">
<summary>
判断回零是否完成
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.IsInPosition(System.Int16,System.Double,System.Double)">
<summary>
判断轴是否在指定的位置
</summary>
<param name="axisNo">轴号</param>
<param name="targetPos">目标位置</param>
<param name="maxError">最大误差脉冲值</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.SetEcatSdo(System.UInt16,System.Int32,System.Int32)">
<summary>
设置齿轮比
</summary>
<param name="axisNo">轴号</param>
<param name="Motor_Revolution">电子齿轮分子:电机分辨率</param>
<param name="Shaft_Revolution">电子齿轮分母:一圈脉冲数</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisPrfMode(System.Int16)">
<summary>
获取轴规划模式
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisSts(System.Int16)">
<summary>
获取轴状态
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisPrfPos(System.Int16)">
<summary>
获取轴规划位置
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisPrfVel(System.Int16)">
<summary>
获取轴规划速度
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisCurrPos(System.Int16)">
<summary>
获取轴反馈位置
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisCurrVel(System.Int16)">
<summary>
获取轴反馈速度
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisCurrAcc(System.Int16)">
<summary>
获取轴反馈加速度
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.ClearAxisSts(System.Int16)">
<summary>
清楚轴报警状态
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="F:HuichuanLibrary.HCBoardManager.HomeSts_Moveing">
<summary>
回原点状态:0=正在回零中
</summary>
</member>
<member name="F:HuichuanLibrary.HCBoardManager.HomeSts_NotStart">
<summary>
回原点状态:1=回零中断或者没有开始启动
</summary>
</member>
<member name="F:HuichuanLibrary.HCBoardManager.HomeSts_OK">
<summary>
回原点状态:3=回零完成
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.ALM">
<summary>
轴报警信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.WARN">
<summary>
轴警告信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.EMG">
<summary>
轴急停信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.ServoOn">
<summary>
轴伺服使能信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.BUSY">
<summary>
轴忙碌状态
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.INP">
<summary>
轴到位信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.PEL">
<summary>
正限位信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.ORG">
<summary>
原点信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.NEL">
<summary>
负限位信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.ECAT">
<summary>
总线轴标志
</summary>
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetCardsNum(System.Int32@)">
*==========================================================================*/
*---- FUNCTION DEFINE ---*/
*==========================================================================*/
*==========================================================================*/
*----1.1 板卡的操作以及资源的获取接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetEcatGrpDiInverse(System.UInt64,System.Int16,System.Int16)">
*==========================================================================*/
*----1.2.1 ECAT资源设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetBoardWorkSts(System.UInt64,System.Int16@)">
*==========================================================================*/
*----1.2.2 端子板资源设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetHwSysPara(System.UInt64,System.Int16@,System.Int16@)">
*==========================================================================*/
*----1.2.3 系统参数设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetAxActive(System.UInt64,System.Int16,System.Int16)">
*==========================================================================*/
*----1.2.4 轴参数设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetSlaveCurSts(System.UInt64,System.UInt16,System.UInt16,System.Int16[])">
*==========================================================================*/
*----2.1 ECAT硬件操作接口 ---*/
*==========================================================================*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.1.1ECAT总线 SDO操作以及状态查询 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetLocalDoBit(System.UInt64,System.Int16,System.Int16)">
*==========================================================================*/
*----2.2 端子板硬件操作接口 ---*/
*==========================================================================*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.2.1 DIO操作接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetLocalCntPos(System.UInt64,System.Int16,System.Int32[],System.Int16)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.2.2 编码器操作接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_CompareSrcConfig(System.UInt64,System.Int16,System.Int16,System.Int16[],System.Int16[])">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.2.4 位置比较输出操作接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_StartHoming(System.UInt64,System.Int16,HuichuanLibrary.ImcApi.THomingPara@)">
*==========================================================================*/
*----3 回零操作接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetAxPrfMode(System.UInt64,System.Int16,System.Int16[],System.Int16)">
*==========================================================================*/
*----4 状态管理接口 ---*/
*==========================================================================*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----4.2 轴状态管理接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetAxCaptMode(System.UInt64,System.Int16,System.Int16,System.Int16,System.Int16)">
*==========================================================================*/
*----5 数据采集接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetSingleAxMvPara(System.UInt64,System.Int16,System.Double,System.Double,System.Double)">
*==========================================================================*/
*----7 运动模式接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_StartPtpMove(System.UInt64,System.Int16,System.Double,System.Int16)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----7.1 PTP点位模式接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_StartJogMove(System.UInt64,System.Int16,System.Double)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----7.2 Jog运动模式接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_EnterHandWheelMode(System.UInt64,System.Int16,System.Int16,System.Int16,System.Double,System.Double,System.Double)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----7.3 手轮跟随运动模式接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
</members>
</doc>
...@@ -23,9 +23,9 @@ namespace HuichuanLibrary ...@@ -23,9 +23,9 @@ namespace HuichuanLibrary
/// <summary> /// <summary>
/// 初始化配置信息,初始化板卡之前,先初始化配置 /// 初始化配置信息,初始化板卡之前,先初始化配置
/// </summary> /// </summary>
/// <param name="deviceConfigPath"></param> /// <param name="deviceConfigPath">设备配置文件</param>
/// <param name="systemConfigPath"></param> /// <param name="systemConfigPath">系统配置文件</param>
/// <param name="logName"></param> /// <param name="logName">日志名称</param>
public static void InitConfig(string deviceConfigPath="",string systemConfigPath="", string logName = "RollingLogFileAppender") public static void InitConfig(string deviceConfigPath="",string systemConfigPath="", string logName = "RollingLogFileAppender")
{ {
if (deviceConfigPath.Equals("")) if (deviceConfigPath.Equals(""))
...@@ -64,7 +64,7 @@ namespace HuichuanLibrary ...@@ -64,7 +64,7 @@ namespace HuichuanLibrary
/// 初始化板卡 /// 初始化板卡
/// </summary> /// </summary>
/// <param name="blockFlag">是否阻塞,1=阻塞,0=不阻塞</param> /// <param name="blockFlag">是否阻塞,1=阻塞,0=不阻塞</param>
/// <returns></returns> /// <returns>true=成功</returns>
public static bool OpenCard(int blockFlag=0) public static bool OpenCard(int blockFlag=0)
{ {
try try
...@@ -289,146 +289,6 @@ namespace HuichuanLibrary ...@@ -289,146 +289,6 @@ namespace HuichuanLibrary
} }
//public static bool OpenCard()
//{
// try
// {
// if (CardIsOk)
// {
// return true;
// }
// if (IsInScanECAT)
// {
// return false ;
// }
// DateTime startTime = DateTime.Now;
// if (!File.Exists(DeviceConfigPath))
// {
// HCLogUtil.error("InitCard FAIL, 【" + DeviceConfigPath + "】not exists");
// return false;
// }
// if (!File.Exists(SystemConfigPath))
// {
// HCLogUtil.error("InitCard FAIL, 【" + SystemConfigPath + "】not exists");
// return false;
// }
// //【1】获取卡
// Int32 nCardNum = 0;
// UInt32 ret = ImcApi.IMC_GetCardsNum(ref nCardNum);
// if (ret != 0)
// {
// ShowErrorLog(" GetCardsNum FAIL, ErrorCode=0x" + ret.ToString("x8"));
// return false;
// }
// else
// {
// if (nCardNum <= 0)
// {
// ShowErrorLog(" Not Find Card");
// return false;
// }
// else
// {
// ShowLog("GetCardsNum = " + nCardNum + ", 将默认打开第0号卡");
// }
// }
// //【2】打开卡句柄
// ret = ImcApi.IMC_OpenCardHandle(nCardNo, ref nCardHandle);
// if (ret != 0)
// {
// ShowErrorLog(" OpenCardHandle FAIL, ErrorCode=0x" + ret.ToString("x8"));
// return false;
// }
// else
// {
// ShowLog("OpenCardHandle OK");
// }
// //【3】下载设备参数
// ret = ImcApi.IMC_DownLoadDeviceConfig(nCardHandle, DeviceConfigPath);
// if (ret != 0)
// {
// ShowErrorLog(" DownLoadDeviceConfig FAIL, ErrorCode=0x" + ret.ToString("x8") + ",请检查是否有" + DeviceConfigPath + "文件");
// return false;
// }
// else
// {
// ShowLog("DownLoadDeviceConfig OK");
// }
// //【4】启动主站
// ShowLog("Begin ScanCardECAT... ...");
// uint masterStatus = 0;
// ret = ImcApi.IMC_GetECATMasterSts(nCardHandle, ref masterStatus);
// if (ret != 0)
// {
// ShowErrorLog(" GetECATMasterSts FAIL, ErrorCode=0x" + ret.ToString("x8"));
// return false;
// }
// else
// {
// if (masterStatus != ImcApi.EC_MASTER_OP)
// {
// ret = ImcApi.IMC_ScanCardECAT(nCardHandle, 1); //默认阻塞式启动EtherCAT
// if (ret != 0)
// {
// ShowErrorLog(" ScanCardECAT FAIL, ErrorCode=0x" + ret.ToString("x8"));
// return false;
// }
// }
// }
// ShowLog("ScanCardECAT OK");
// //【5】下载系统参数
// ret = ImcApi.IMC_DownLoadSystemConfig(nCardHandle, SystemConfigPath);
// if (ret != 0)
// {
// ShowErrorLog(" DownLoadSystemConfig FAIL, ErrorCode=0x" + ret.ToString("x8") + ",请检查是否有" + SystemConfigPath + "文件");
// return false;
// }
// else
// {
// ShowLog("DownLoadSystemConfig OK");
// }
// tResource = new ImcApi.TRsouresNum();//实例化板卡外设硬件资源
// //【6】扫描卡内资源,初始化ComboBox
// ret = ImcApi.IMC_GetCardResource(nCardHandle, ref tResource);
// if (ret != 0)
// {
// ShowErrorLog(" GetCardResource FAIL, ErrorCode=0x" + ret.ToString("x8"));
// return false;
// }
// else
// {
// ShowLog("Axis [" + tResource.axNum + "],DI [" + tResource.diNum + "],DO [" + tResource.doNum + "]");
// //轴
// AxisList = new List<int>();
// if (tResource.axNum > 0)
// {
// for (int i = 0; i < tResource.axNum; i++)
// {
// AxisList.Add(i);
// }
// }
// CardIsOk = true;
// TimeSpan span = DateTime.Now - startTime;
// ShowLog("OpenCard end ," + Convert.ToDateTime(span.ToString()).ToString("HH:mm:ss"));
// return true;
// //IO
// }
// }
// catch (Exception ex)
// {
// ShowErrorLog(ex.ToString());
// }
// return false;
//}
...@@ -466,8 +326,8 @@ namespace HuichuanLibrary ...@@ -466,8 +326,8 @@ namespace HuichuanLibrary
/// <summary> /// <summary>
/// 板卡是否已经初始化OK /// 板卡是否已经初始化OK
/// </summary> /// </summary>
/// <param name="isShowLog"></param> /// <param name="isShowLog">未初始化完成时是否打印日志</param>
/// <returns></returns> /// <returns>true=OK</returns>
public static bool CardInitOk(bool isShowLog = false) public static bool CardInitOk(bool isShowLog = false)
{ {
if (CardIsOk) if (CardIsOk)
...@@ -484,7 +344,10 @@ namespace HuichuanLibrary ...@@ -484,7 +344,10 @@ namespace HuichuanLibrary
} }
} }
/// <summary>
/// 紧急停止
/// </summary>
/// <returns></returns>
public static bool EmgStop() public static bool EmgStop()
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -504,7 +367,10 @@ namespace HuichuanLibrary ...@@ -504,7 +367,10 @@ namespace HuichuanLibrary
return true; return true;
} }
} }
/// <summary>
/// 取消急停
/// </summary>
/// <returns></returns>
public static bool CancelEmg() public static bool CancelEmg()
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -529,7 +395,12 @@ namespace HuichuanLibrary ...@@ -529,7 +395,12 @@ namespace HuichuanLibrary
#region IO控制 #region IO控制
/// <summary>
/// 按位设置DO的值
/// </summary>
/// <param name="bitNo">DO索引,从0开始</param>
/// <param name="bitValue">DO值</param>
/// <returns></returns>
public static bool SetBitDO(short bitNo, short bitValue) public static bool SetBitDO(short bitNo, short bitValue)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -545,7 +416,11 @@ namespace HuichuanLibrary ...@@ -545,7 +416,11 @@ namespace HuichuanLibrary
} }
return true; return true;
} }
/// <summary>
/// 按位获取DO的值
/// </summary>
/// <param name="bitNo">DO索引,从0开始</param>
/// <returns></returns>
public static short GetBitDO(short bitNo) public static short GetBitDO(short bitNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -563,7 +438,11 @@ namespace HuichuanLibrary ...@@ -563,7 +438,11 @@ namespace HuichuanLibrary
return bitValue; return bitValue;
} }
/// <summary>
/// 按位获取DI的值
/// </summary>
/// <param name="bitNo">DI索引,从0开始</param>
/// <returns></returns>
public static short GetBitDI(short bitNo) public static short GetBitDI(short bitNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
......
...@@ -9,7 +9,11 @@ namespace HuichuanLibrary ...@@ -9,7 +9,11 @@ namespace HuichuanLibrary
partial class HCBoardManager partial class HCBoardManager
{ {
#region 单轴控制 #region 单轴控制
/// <summary>
/// 打开轴
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static bool ServoOn(short axisNo) public static bool ServoOn(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -30,7 +34,11 @@ namespace HuichuanLibrary ...@@ -30,7 +34,11 @@ namespace HuichuanLibrary
return true; return true;
} }
} }
/// <summary>
/// 关闭轴
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static bool ServoOff(short axisNo) public static bool ServoOff(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -65,7 +73,7 @@ namespace HuichuanLibrary ...@@ -65,7 +73,7 @@ namespace HuichuanLibrary
/// <param name="overtime">超时时间,默认120000</param> /// <param name="overtime">超时时间,默认120000</param>
/// <param name="posSrc">端子板信号源,默认0</param> /// <param name="posSrc">端子板信号源,默认0</param>
/// <returns></returns> /// <returns></returns>
public static bool StartHomeMove(short axisNo,uint highVel, uint lowVel, uint acc,short homeMethod=28, int offset=0, uint overtime=120000, short posSrc=0) public static bool StartHomeMove(short axisNo, uint highVel, uint lowVel, uint acc, short homeMethod = 28, int offset = 0, uint overtime = 120000, short posSrc = 0)
{ {
if (!CardInitOk()) if (!CardInitOk())
{ {
...@@ -81,7 +89,7 @@ namespace HuichuanLibrary ...@@ -81,7 +89,7 @@ namespace HuichuanLibrary
tHomingPara.acc = acc; tHomingPara.acc = acc;
tHomingPara.overtime = overtime; tHomingPara.overtime = overtime;
tHomingPara.posSrc = posSrc; tHomingPara.posSrc = posSrc;
HCLogUtil.info("Axis[" + axisNo + "] StartHoming highVel["+highVel+ "],lowVel[" + lowVel + "],acc[" + acc + "],homeMethod[" + homeMethod + "],offset[" + offset + "],overtime[" + overtime + "],posSrc["+ posSrc + "]"); HCLogUtil.info("Axis[" + axisNo + "] StartHoming highVel[" + highVel + "],lowVel[" + lowVel + "],acc[" + acc + "],homeMethod[" + homeMethod + "],offset[" + offset + "],overtime[" + overtime + "],posSrc[" + posSrc + "]");
//【3】开始回原 //【3】开始回原
UInt32 ret = ImcApi.IMC_StartHoming(nCardHandle, axisNo, ref tHomingPara); UInt32 ret = ImcApi.IMC_StartHoming(nCardHandle, axisNo, ref tHomingPara);
if (ret != 0) if (ret != 0)
...@@ -95,7 +103,11 @@ namespace HuichuanLibrary ...@@ -95,7 +103,11 @@ namespace HuichuanLibrary
return true; return true;
} }
} }
/// <summary>
/// 停止原点返回
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static bool StopHomeMove(short axisNo) public static bool StopHomeMove(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -115,6 +127,11 @@ namespace HuichuanLibrary ...@@ -115,6 +127,11 @@ namespace HuichuanLibrary
return true; return true;
} }
} }
/// <summary>
/// 获取回原状态
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static short GetHomeStatus(short axisNo) public static short GetHomeStatus(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -194,12 +211,16 @@ namespace HuichuanLibrary ...@@ -194,12 +211,16 @@ namespace HuichuanLibrary
double chazhi = Math.Abs(currP - targetPos); double chazhi = Math.Abs(currP - targetPos);
if (chazhi < maxError) if (chazhi < maxError)
{ {
return true ; return true;
} }
return false; return false;
} }
/// <summary>
public static bool MoveIsEnd(short axisNo ) /// 判断轴是否运动结束,忙碌=0且到位信号=1
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static bool MoveIsEnd(short axisNo)
{ {
AxisSts sts = GetAxisSts(axisNo); AxisSts sts = GetAxisSts(axisNo);
if (sts.BUSY.Equals(0) && sts.INP.Equals(1)) if (sts.BUSY.Equals(0) && sts.INP.Equals(1))
...@@ -209,8 +230,16 @@ namespace HuichuanLibrary ...@@ -209,8 +230,16 @@ namespace HuichuanLibrary
return false; return false;
} }
/// <summary>
public static bool AbsMove(short axisNo, double ptpPos, double ptpVel , double ptpAcc , double ptpDec ) /// 轴绝对运动
/// </summary>
/// <param name="axisNo">轴号</param>
/// <param name="ptpPos">绝对位置</param>
/// <param name="ptpVel">速度</param>
/// <param name="ptpAcc">加速度</param>
/// <param name="ptpDec">减速度</param>
/// <returns></returns>
public static bool AbsMove(short axisNo, double ptpPos, double ptpVel, double ptpAcc, double ptpDec)
{ {
if (!CardInitOk()) if (!CardInitOk())
{ {
...@@ -227,7 +256,16 @@ namespace HuichuanLibrary ...@@ -227,7 +256,16 @@ namespace HuichuanLibrary
short ptpType = 0; short ptpType = 0;
return StartPtpMove(axisNo, ptpType, ptpPos); return StartPtpMove(axisNo, ptpType, ptpPos);
} }
public static bool RelMove(short axisNo, double ptpPos, double ptpVel , double ptpAcc , double ptpDec ) /// <summary>
/// 轴相对运动
/// </summary>
/// <param name="axisNo">轴号</param>
/// <param name="ptpPos">相对位置</param>
/// <param name="ptpVel">速度</param>
/// <param name="ptpAcc">加速度</param>
/// <param name="ptpDec">减速度</param>
/// <returns></returns>
public static bool RelMove(short axisNo, double ptpPos, double ptpVel, double ptpAcc, double ptpDec)
{ {
if (!CardInitOk()) if (!CardInitOk())
{ {
...@@ -259,7 +297,14 @@ namespace HuichuanLibrary ...@@ -259,7 +297,14 @@ namespace HuichuanLibrary
return true; return true;
} }
} }
/// <summary>
/// 设置点到点速度
/// </summary>
/// <param name="axisNo">轴号</param>
/// <param name="ptpVel">目标速速</param>
/// <param name="ptpAcc">加速度</param>
/// <param name="ptpDec">减速度</param>
/// <returns></returns>
public static bool SetPTPSpeed(short axisNo, double ptpVel, double ptpAcc, double ptpDec) public static bool SetPTPSpeed(short axisNo, double ptpVel, double ptpAcc, double ptpDec)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -269,7 +314,7 @@ namespace HuichuanLibrary ...@@ -269,7 +314,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_SetSingleAxMvPara(nCardHandle, axisNo, ptpVel, ptpAcc, ptpDec); UInt32 ret = ImcApi.IMC_SetSingleAxMvPara(nCardHandle, axisNo, ptpVel, ptpAcc, ptpDec);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] SetSingleAxMvPara ptpVel ["+ ptpVel + "] ptpAcc ["+ ptpAcc + "] ptpDec ["+ptpDec+"] FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] SetSingleAxMvPara ptpVel [" + ptpVel + "] ptpAcc [" + ptpAcc + "] ptpDec [" + ptpDec + "] FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false; return false;
} }
else else
...@@ -280,7 +325,11 @@ namespace HuichuanLibrary ...@@ -280,7 +325,11 @@ namespace HuichuanLibrary
} }
/// <summary>
/// 轴停止运动
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static bool AxisStop(short axisNo) public static bool AxisStop(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -357,6 +406,12 @@ namespace HuichuanLibrary ...@@ -357,6 +406,12 @@ namespace HuichuanLibrary
} }
return true; return true;
} }
/// <summary>
/// 轴匀速运动
/// </summary>
/// <param name="axisNo">轴号</param>
/// <param name="targetVel">目标速度</param>
/// <returns></returns>
public static bool SpeedMove(short axisNo, double targetVel) public static bool SpeedMove(short axisNo, double targetVel)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -366,7 +421,7 @@ namespace HuichuanLibrary ...@@ -366,7 +421,7 @@ namespace HuichuanLibrary
UInt32 ret = ImcApi.IMC_StartJogMove(nCardHandle, axisNo, targetVel); UInt32 ret = ImcApi.IMC_StartJogMove(nCardHandle, axisNo, targetVel);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] speed ["+targetVel+ "] StartJogMove FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] speed [" + targetVel + "] StartJogMove FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false; return false;
} }
else else
...@@ -558,7 +613,7 @@ namespace HuichuanLibrary ...@@ -558,7 +613,7 @@ namespace HuichuanLibrary
return nTimerAxEncAcc[0]; return nTimerAxEncAcc[0];
} }
/// <summary> /// <summary>
/// 清轴报警状态 /// 清轴报警状态
/// </summary> /// </summary>
///<param name="axisNo">轴号</param> ///<param name="axisNo">轴号</param>
/// <returns></returns> /// <returns></returns>
...@@ -576,7 +631,11 @@ namespace HuichuanLibrary ...@@ -576,7 +631,11 @@ namespace HuichuanLibrary
} }
return true; return true;
} }
/// <summary>
/// 获取错误码
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static short GetAxErrCode(short axisNo) public static short GetAxErrCode(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -592,8 +651,12 @@ namespace HuichuanLibrary ...@@ -592,8 +651,12 @@ namespace HuichuanLibrary
} }
return outV; return outV;
} }
/// <summary>
public static string GetAxType(short axisNo ) /// 获取轴类型
/// </summary>
/// <param name="axisNo">轴号</param>
/// <returns></returns>
public static string GetAxType(short axisNo)
{ {
string res = ""; string res = "";
if (!CardInitOk()) if (!CardInitOk())
...@@ -602,8 +665,8 @@ namespace HuichuanLibrary ...@@ -602,8 +665,8 @@ namespace HuichuanLibrary
} }
short pAxType = -1; short pAxType = -1;
short pOutChn = -1; short pOutChn = -1;
UInt32 ret = ImcApi.IMC_GetAxType(nCardHandle, axisNo, ref pAxType,ref pOutChn); UInt32 ret = ImcApi.IMC_GetAxType(nCardHandle, axisNo, ref pAxType, ref pOutChn);
res = "轴类型["+pAxType+ "],物理通道[" + pOutChn + "]"; res = "轴类型[" + pAxType + "],物理通道[" + pOutChn + "]";
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "] GetAxType FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "] GetAxType FAIL, ErrorCode=0x" + ret.ToString("x8"));
...@@ -612,7 +675,11 @@ namespace HuichuanLibrary ...@@ -612,7 +675,11 @@ namespace HuichuanLibrary
return res; return res;
} }
/// <summary>
/// 获取EtherCAT类型轴对应的正向力矩限制
/// </summary>
/// <param name="axisNo">轴号0-31</param>
/// <returns>正向力矩限制</returns>
public static short GetEcatAxPosTorqLmt(short axisNo) public static short GetEcatAxPosTorqLmt(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -628,21 +695,31 @@ namespace HuichuanLibrary ...@@ -628,21 +695,31 @@ namespace HuichuanLibrary
} }
return outV; return outV;
} }
/// <summary>
public static bool SetEcatAxPosTorqLmt(short axisNo,short value) /// 设置EtherCAT类型轴对应的正向力矩限制
/// </summary>
/// <param name="axisNo">轴号0-31</param>
/// <param name="value">正向力矩限制</param>
/// <returns></returns>
public static bool SetEcatAxPosTorqLmt(short axisNo, short value)
{ {
if (!CardInitOk()) if (!CardInitOk())
{ {
return false ; return false;
} }
UInt32 ret = ImcApi.IMC_SetEcatAxPosTorqLmt(nCardHandle, axisNo, value); UInt32 ret = ImcApi.IMC_SetEcatAxPosTorqLmt(nCardHandle, axisNo, value);
if (ret != 0) if (ret != 0)
{ {
ShowErrorLog(" Axis[" + axisNo + "]["+ value + "] SetEcatAxPosTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8")); ShowErrorLog(" Axis[" + axisNo + "][" + value + "] SetEcatAxPosTorqLmt FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false ; return false;
} }
return true ; return true;
} }
/// <summary>
/// 获取EtherCAT类型轴对应的负向力矩限制
/// </summary>
/// <param name="axisNo">轴号0-31</param>
/// <returns>负向力矩限制</returns>
public static short GetEcatAxNegTorqLmt(short axisNo) public static short GetEcatAxNegTorqLmt(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -658,7 +735,12 @@ namespace HuichuanLibrary ...@@ -658,7 +735,12 @@ namespace HuichuanLibrary
} }
return outV; return outV;
} }
/// <summary>
/// 设置EtherCAT类型轴对应的负向力矩限制
/// </summary>
/// <param name="axisNo">轴号0-31</param>
/// <param name="value">负向力矩限制</param>
/// <returns></returns>
public static bool SetEcatAxNegTorqLmt(short axisNo, short value) public static bool SetEcatAxNegTorqLmt(short axisNo, short value)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -673,6 +755,11 @@ namespace HuichuanLibrary ...@@ -673,6 +755,11 @@ namespace HuichuanLibrary
} }
return true; return true;
} }
/// <summary>
/// 获取EtherCAT类型轴对应的最大力矩限制
/// </summary>
/// <param name="axisNo">轴号0-31</param>
/// <returns>最大力矩限制</returns>
public static short GetEcatAxMaxTorqLmt(short axisNo) public static short GetEcatAxMaxTorqLmt(short axisNo)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -688,7 +775,12 @@ namespace HuichuanLibrary ...@@ -688,7 +775,12 @@ namespace HuichuanLibrary
} }
return outV; return outV;
} }
/// <summary>
/// 设置EtherCAT类型轴对应的最大力矩限制
/// </summary>
/// <param name="axisNo">轴号0-31</param>
/// <param name="value">最大力矩限制</param>
/// <returns></returns>
public static bool SetEcatAxMaxTorqLmt(short axisNo, short value) public static bool SetEcatAxMaxTorqLmt(short axisNo, short value)
{ {
if (!CardInitOk()) if (!CardInitOk())
...@@ -703,7 +795,6 @@ namespace HuichuanLibrary ...@@ -703,7 +795,6 @@ namespace HuichuanLibrary
} }
return true; return true;
} }
#endregion #endregion
#region 轴状态 #region 轴状态
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\HuichuanLibrary.xml</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!