Commit 9156bbe9 几米阳光

增加夹具夹紧处理

1 个父辈 19509c36
...@@ -40,6 +40,11 @@ namespace URSoldering.DeviceLibrary ...@@ -40,6 +40,11 @@ namespace URSoldering.DeviceLibrary
WarnMsg = "急停未开"; WarnMsg = "急停未开";
return false; return false;
} }
if (!IsFixtureClamp())
{
WarnMsg = "夹具未夹紧";
return false;
}
//焊接机器人复位 //焊接机器人复位
string solderingStr = ""; string solderingStr = "";
if (Status > RobotStatus.Wait) if (Status > RobotStatus.Wait)
...@@ -65,9 +70,6 @@ namespace URSoldering.DeviceLibrary ...@@ -65,9 +70,6 @@ namespace URSoldering.DeviceLibrary
return true; return true;
} }
/// <summary>
/// 急停 处理
/// </summary>
private void SuddendownProcess() private void SuddendownProcess()
{ {
WarnMsg = "收到急停信号,设备急停"; WarnMsg = "收到急停信号,设备急停";
...@@ -75,7 +77,13 @@ namespace URSoldering.DeviceLibrary ...@@ -75,7 +77,13 @@ namespace URSoldering.DeviceLibrary
IsInSuddendown = true; IsInSuddendown = true;
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
} }
private void FixtureRelaxProcess()
{
WarnMsg = "夹具未夹紧,设备急停";
LogUtil.error(RobotName + WarnMsg);
IsInSuddendown = true;
Alarm(AlarmType.SuddenStop);
}
public string StartWeld() public string StartWeld()
{ {
...@@ -111,9 +119,16 @@ namespace URSoldering.DeviceLibrary ...@@ -111,9 +119,16 @@ namespace URSoldering.DeviceLibrary
{ {
SuddendownProcess(); SuddendownProcess();
} }
} }
else if (IsInSuddendown) else if (IsInSuddendown)
{ {
}else if (IsFixtureClamp().Equals(false))
{
if (alarmType.Equals(AlarmType.None))
{
FixtureRelaxProcess();
}
} }
else else
{ {
......
...@@ -125,11 +125,26 @@ namespace URSoldering.DeviceLibrary ...@@ -125,11 +125,26 @@ namespace URSoldering.DeviceLibrary
System.Threading.Thread.Sleep(100); System.Threading.Thread.Sleep(100);
} }
} }
FixtureClamp();
}
public static void FixtureClamp()
{
//连接上IO模块后,夹具夹紧 //连接上IO模块后,夹具夹紧
//KNDIOMove(IO_Type.Fixture_Clamp, IO_VALUE.HIGH); KNDIOMove(IO_Type.Fixture_Clamp, IO_VALUE.HIGH);
//KNDIOMove(IO_Type.Fixture_Relax, IO_VALUE.LOW); KNDIOMove(IO_Type.Fixture_Relax, IO_VALUE.LOW);
}
public static bool IsFixtureClamp()
{
if (KNDIOValue(IO_Type.Fixture_Clamp).Equals(IO_VALUE.HIGH) && KNDIOValue(IO_Type.Fixture_Relax).Equals(IO_VALUE.LOW))
{
return true;
}
else
{
LogUtil.error("夹具夹紧信号不到位");
return false;
}
} }
public static bool ShuddenOK() public static bool ShuddenOK()
{ {
if (!baseConfig.RobotDIList.ContainsKey(IO_Type.SuddenStop_Single)) if (!baseConfig.RobotDIList.ContainsKey(IO_Type.SuddenStop_Single))
......
...@@ -264,15 +264,18 @@ namespace URSoldering.Client ...@@ -264,15 +264,18 @@ namespace URSoldering.Client
{ {
lblMsg.Text = "急停未开"; lblMsg.Text = "急停未开";
} }
else if (RobotBean.IsFixtureClamp().Equals(false))
{
lblMsg.Text = "夹具未夹紧";
}
else else
{ {
lblMsg.Text = ""; lblMsg.Text = "";
if (this.btnWUp.Enabled == false) if (this.btnWUp.Enabled == false)
{ {
//this.btnWDown.Enabled = true;
this.btnWUp.Enabled = true; this.btnWUp.Enabled = true;
} }
if (!URRobotControl.IsRun&&isRun.Equals(false)) if (!URRobotControl.IsRun && isRun.Equals(false))
{ {
isRun = true; isRun = true;
Task.Factory.StartNew(delegate () Task.Factory.StartNew(delegate ()
...@@ -289,13 +292,14 @@ namespace URSoldering.Client ...@@ -289,13 +292,14 @@ namespace URSoldering.Client
}); });
} }
else
}
if (URRobotControl.IsRun)
{ {
RobotStatus(true); RobotStatus(true);
UpdateRobotPosition(); UpdateRobotPosition();
} }
} }
}
private void FrmBoardInfo_FormClosing(object sender, FormClosingEventArgs e) private void FrmBoardInfo_FormClosing(object sender, FormClosingEventArgs e)
{ {
......
...@@ -180,7 +180,15 @@ namespace URSoldering.Client ...@@ -180,7 +180,15 @@ namespace URSoldering.Client
if (this.btnSendWireStop.Enabled) if (this.btnSendWireStop.Enabled)
{ {
FormStatus(false); FormStatus(false);
}
}
else if (RobotBean.IsFixtureClamp().Equals(false))
{
lblMsg.Text = "夹具未夹紧";
if (this.btnSendWireStop.Enabled)
{
FormStatus(false);
} }
} }
else else
...@@ -290,13 +298,20 @@ namespace URSoldering.Client ...@@ -290,13 +298,20 @@ namespace URSoldering.Client
private void btnFixtureReleax_Click(object sender, EventArgs e) private void btnFixtureReleax_Click(object sender, EventArgs e)
{ {
DialogResult result = MessageBox.Show("确定执行夹具放松操作?","提示",MessageBoxButtons.OKCancel);
if (result.Equals(DialogResult.OK))
{
FixtureCylinderMove(IO_VALUE.LOW, IO_VALUE.HIGH); FixtureCylinderMove(IO_VALUE.LOW, IO_VALUE.HIGH);
} }
}
private void btnFixtureStop_Click(object sender, EventArgs e) private void btnFixtureStop_Click(object sender, EventArgs e)
{ DialogResult result = MessageBox.Show("确定执行夹具停止输出操作?", "提示", MessageBoxButtons.OKCancel);
if (result.Equals(DialogResult.OK))
{ {
FixtureCylinderMove(IO_VALUE.LOW, IO_VALUE.LOW); FixtureCylinderMove(IO_VALUE.LOW, IO_VALUE.LOW);
} }
}
private void btnWireWork_Click(object sender, EventArgs e) private void btnWireWork_Click(object sender, EventArgs e)
{ {
......
...@@ -107,6 +107,10 @@ namespace URSoldering.Client ...@@ -107,6 +107,10 @@ namespace URSoldering.Client
{ {
lblMsg.Text = "急停未开"; lblMsg.Text = "急停未开";
}else if (RobotBean.IsFixtureClamp().Equals(false))
{
lblMsg.Text = "夹具未夹紧";
} }
else else
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!