|
|
@ -12,6 +12,7 @@ using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Net.NetworkInformation;
|
|
|
|
using System.Net.NetworkInformation;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Rs.Motion.GugaoPulse
|
|
|
|
namespace Rs.Motion.GugaoPulse
|
|
|
@ -110,7 +111,7 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
//card.Init();
|
|
|
|
//card.Init();
|
|
|
|
//cardDic.Add(ushort.Parse(row["cardid"].ToString()), card);
|
|
|
|
//cardDic.Add(ushort.Parse(row["cardid"].ToString()), card);
|
|
|
|
//打开运动控制卡
|
|
|
|
//打开运动控制卡
|
|
|
|
apiResult = mc_pulse.GT_Open(short.Parse(row["cardid"].ToString()), 0, 1);
|
|
|
|
apiResult = mc_pulse.GT_Open(short.Parse(row["cardid"].ToString()), 0, 0);
|
|
|
|
if (apiResult != 0)
|
|
|
|
if (apiResult != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MessageQueue.Instance.Warn($"mc_pulse.GT_Open({short.Parse(row["cardid"].ToString())}, 0, 1);ret={apiResult}");
|
|
|
|
MessageQueue.Instance.Warn($"mc_pulse.GT_Open({short.Parse(row["cardid"].ToString())}, 0, 1);ret={apiResult}");
|
|
|
@ -118,6 +119,7 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
//加载配置文件
|
|
|
|
//加载配置文件
|
|
|
|
short cardid = short.Parse(row["cardid"].ToString());
|
|
|
|
short cardid = short.Parse(row["cardid"].ToString());
|
|
|
|
if (File.Exists($"gugao{cardid}.cfg"))
|
|
|
|
if (File.Exists($"gugao{cardid}.cfg"))
|
|
|
@ -128,13 +130,17 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
MessageQueue.Instance.Insert($"mc_pulse.GT_Open({short.Parse(row["cardid"].ToString())}, 0, 1);ret={apiResult}");
|
|
|
|
MessageQueue.Instance.Insert($"mc_pulse.GT_Open({short.Parse(row["cardid"].ToString())}, 0, 1);ret={apiResult}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//清楚报警和限位
|
|
|
|
//清楚报警和限位
|
|
|
|
apiResult = mc_pulse.GT_ClrSts(0, 1, 8);
|
|
|
|
apiResult = mc_pulse.GT_ClrSts(short.Parse(row["cardid"].ToString()), 1, 8);
|
|
|
|
if (apiResult != 0)
|
|
|
|
if (apiResult != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ErrorCode.Fail;
|
|
|
|
return ErrorCode.Fail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LogHelper.Debug($"{apiResult} = mc_pulse.GT_ClrSts({short.Parse(row["cardid"].ToString())}, 1, 8);");
|
|
|
|
|
|
|
|
}
|
|
|
|
short value = 32767 * 5 / 10;
|
|
|
|
short value = 32767 * 5 / 10;
|
|
|
|
apiResult = mc_pulse.GT_SetDac(0, 11, ref value, 1);
|
|
|
|
apiResult = mc_pulse.GT_SetDac(short.Parse(row["cardid"].ToString()), 11, ref value, 1);
|
|
|
|
MessageQueue.Instance.Insert($"GT_SetDac ret={apiResult}");
|
|
|
|
MessageQueue.Instance.Insert($"GT_SetDac ret={apiResult}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|