Commit e7c7b2c1 LN

夹爪修改

1 个父辈 3493e779
...@@ -30,6 +30,13 @@ namespace OnlineStore.AssemblyLine.useControl ...@@ -30,6 +30,13 @@ namespace OnlineStore.AssemblyLine.useControl
{ {
JName = clampJaw.config.Explain + "_" + clampJaw.config.PortName + "_" + clampJaw.config.AxisNo; JName = clampJaw.config.Explain + "_" + clampJaw.config.PortName + "_" + clampJaw.config.AxisNo;
groupClamp.Text = JName; groupClamp.Text = JName;
lblReached.Text = "";
lblIsMoving.Text = "";
lblErrorCode.Text = "";
lblEmpty.Text = "";
lblForce.Text = "";
lblPosition.Text = "";
lblSensor.Text = "";
} }
} }
...@@ -42,11 +49,19 @@ namespace OnlineStore.AssemblyLine.useControl ...@@ -42,11 +49,19 @@ namespace OnlineStore.AssemblyLine.useControl
{ {
if (clampJaw.IsReached()) if (clampJaw.IsReached())
{ {
lblMoveOk.Text = "运动到位 ✔"; lblReached.Text = "到达目标 ✔";
} }
else else
{ {
lblMoveOk.Text = " "; lblReached.Text = " ";
}
if (clampJaw.IsMoving())
{
lblIsMoving.Text = "运动中 ✔";
}
else
{
lblIsMoving.Text = " ";
} }
if (clampJaw.HasReel()) if (clampJaw.HasReel())
{ {
...@@ -58,6 +73,7 @@ namespace OnlineStore.AssemblyLine.useControl ...@@ -58,6 +73,7 @@ namespace OnlineStore.AssemblyLine.useControl
} }
lblPosition.Text = "实时位置:" + clampJaw.GetPosition(); lblPosition.Text = "实时位置:" + clampJaw.GetPosition();
lblForce.Text = "实时出力:" + clampJaw.GetTorque(); lblForce.Text = "实时出力:" + clampJaw.GetTorque();
lblSensor.Text = "传感器读数:" + clampJaw.GetForceSensor();
int code = clampJaw.GetErrorCode(); int code = clampJaw.GetErrorCode();
if (code > 0) if (code > 0)
{ {
......
...@@ -514,14 +514,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -514,14 +514,14 @@ namespace OnlineStore.DeviceLibrary
ConfigIO io = baseConfig.getWaitIO(wait.IoType); ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒"; WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
LogUtil.error( WarnMsg, DeviceID * 1000 + 13); LogUtil.error(WarnMsg, DeviceID * 1000 + 13);
if (NoAlarm()) if (NoAlarm())
{ {
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
CheckAlarmProcess(moveInfo, LineAlarmType.IoSingleTimeOut); CheckAlarmProcess(moveInfo, LineAlarmType.IoSingleTimeOut);
} }
} }
if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2) if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
string msg = moveInfo.Name + " [" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds, 1) + "秒,重写DO:"; string msg = moveInfo.Name + " [" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds, 1) + "秒,重写DO:";
...@@ -554,20 +554,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -554,20 +554,20 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType.Equals(WaitEnum.W003_Time)) else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{ {
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds); wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}else if (wait.WaitType.Equals(WaitEnum.W004_ClampReached)) } else if (wait.WaitType.Equals(WaitEnum.W004_ClampReached))
{ {
if (ClampJwa != null) if (ClampJwa != null)
{ {
if (ClampJwa.IsReached()) if (ClampJwa.IsReached())
{ {
float currp = ClampJwa.GetPosition() -(float) wait.TargetPosition; float currp = ClampJwa.GetPosition() - (float)wait.TargetPosition;
if (currp < 1) if (currp < 1)
{ {
wait.IsEnd = true; wait.IsEnd = true;
} }
} }
} }
}else if (wait.WaitType.Equals(WaitEnum.W005_WaitHasReel)) } else if (wait.WaitType.Equals(WaitEnum.W005_WaitHasReel))
{ {
if (ClampJwa != null) if (ClampJwa != null)
{ {
...@@ -578,13 +578,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -578,13 +578,19 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + " 用户点击了:忽略夹爪有料信号,继续出入库动作"); LogUtil.info(Name + " 用户点击了:忽略夹爪有料信号,继续出入库动作");
wait.IsEnd = true; wait.IsEnd = true;
} }
//如果出力>=0.3,且已等待5秒 //如果是运动中,且到达目标,认为有料
float torque = ClampJwa.GetTorque(); if ((!wait.IsEnd) && ClampJwa.IsMoving() && ClampJwa.IsReached() && span.TotalSeconds > 3)
if ((!wait.IsEnd) && torque > 0.25 && span.TotalSeconds > 5)
{ {
LogUtil.info(Name + " 无料,但力度为[" + torque + "]>=0.25认为有料"); LogUtil.info(Name + " 无料,但在运动中,且运动到位,认为有料");
wait.IsEnd = true; wait.IsEnd = true;
} }
////如果出力>=0.3,且已等待5秒
//float torque = ClampJwa.GetTorque();
//if ((!wait.IsEnd) && torque > 0.25 && span.TotalSeconds > 5)
//{
// LogUtil.info(Name + " 无料,但力度为[" + torque + "]>=0.25认为有料");
// wait.IsEnd = true;
//}
} }
} }
else if (wait.WaitType.Equals(WaitEnum.W008_InStoreCheckOK)) else if (wait.WaitType.Equals(WaitEnum.W008_InStoreCheckOK))
...@@ -600,7 +606,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -600,7 +606,7 @@ namespace OnlineStore.DeviceLibrary
{ {
storeId = 7; storeId = 7;
} }
wait.IsEnd = LineServer.BoxCanReviceTray(storeId,out NotOkMsg); wait.IsEnd = LineServer.BoxCanReviceTray(storeId, out NotOkMsg);
} }
else else
{ {
......
...@@ -82,6 +82,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,6 +82,21 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
public bool IsMoving()
{
try
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
return rmaxis.IsMoving;
}
}
catch (Exception ex)
{
LogUtil.error(Name + " IsMoving error :" + ex.ToString());
}
return false;
}
public bool HasReel() public bool HasReel()
{ {
try try
...@@ -121,7 +136,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -121,7 +136,30 @@ namespace OnlineStore.DeviceLibrary
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached(0)); moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached(0));
} }
} }
public float GetForceSensor()
{
try
{
return rmaxis.GetForceSensor();
}
catch (Exception ex)
{
LogUtil.error(Name + " GetForceSensor error :" + ex.ToString());
}
return -1;
}
public float GetVelocity()
{
try
{
return rmaxis.GetVelocity();
}
catch (Exception ex)
{
LogUtil.error(Name + " GetVelocity error :" + ex.ToString());
}
return -1;
}
public float GetPosition() public float GetPosition()
{ {
try try
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!