Commit 9156bbe9 几米阳光

增加夹具夹紧处理

1 个父辈 19509c36
...@@ -39,7 +39,12 @@ namespace URSoldering.DeviceLibrary ...@@ -39,7 +39,12 @@ 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)
...@@ -64,10 +69,7 @@ namespace URSoldering.DeviceLibrary ...@@ -64,10 +69,7 @@ namespace URSoldering.DeviceLibrary
mainTimer.Enabled = true; mainTimer.Enabled = true;
return true; return true;
} }
/// <summary>
/// 急停 处理
/// </summary>
private void SuddendownProcess() private void SuddendownProcess()
{ {
WarnMsg = "收到急停信号,设备急停"; WarnMsg = "收到急停信号,设备急停";
...@@ -75,8 +77,14 @@ namespace URSoldering.DeviceLibrary ...@@ -75,8 +77,14 @@ namespace URSoldering.DeviceLibrary
IsInSuddendown = true; IsInSuddendown = true;
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
} }
private void FixtureRelaxProcess()
public string StartWeld() {
WarnMsg = "夹具未夹紧,设备急停";
LogUtil.error(RobotName + WarnMsg);
IsInSuddendown = true;
Alarm(AlarmType.SuddenStop);
}
public string StartWeld()
{ {
string msg = ""; string msg = "";
...@@ -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))
......
...@@ -262,38 +262,42 @@ namespace URSoldering.Client ...@@ -262,38 +262,42 @@ namespace URSoldering.Client
//判断是否开急停 //判断是否开急停
if (RobotBean.ShuddenOK().Equals(false)) if (RobotBean.ShuddenOK().Equals(false))
{ {
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 ()
{ {
bool result = URRobotControl.StartRobot(); bool result = URRobotControl.StartRobot();
if (!result) if (!result)
{ {
LogUtil.info("连接失败:" + result); LogUtil.info("连接失败:" + result);
} }
else else
{ {
URRobotControl.FreeAxis(); URRobotControl.FreeAxis();
} }
}); });
}
else
{
RobotStatus(true);
UpdateRobotPosition();
} }
}
if (URRobotControl.IsRun)
{
RobotStatus(true);
UpdateRobotPosition();
} }
} }
......
...@@ -179,8 +179,16 @@ namespace URSoldering.Client ...@@ -179,8 +179,16 @@ namespace URSoldering.Client
lblMsg.Text = "急停未开"; lblMsg.Text = "急停未开";
if (this.btnSendWireStop.Enabled) if (this.btnSendWireStop.Enabled)
{ {
FormStatus(false);
}
}
else if (RobotBean.IsFixtureClamp().Equals(false))
{
lblMsg.Text = "夹具未夹紧";
if (this.btnSendWireStop.Enabled)
{
FormStatus(false); FormStatus(false);
} }
} }
else else
...@@ -290,12 +298,19 @@ namespace URSoldering.Client ...@@ -290,12 +298,19 @@ namespace URSoldering.Client
private void btnFixtureReleax_Click(object sender, EventArgs e) private void btnFixtureReleax_Click(object sender, EventArgs e)
{ {
FixtureCylinderMove(IO_VALUE.LOW, IO_VALUE.HIGH); DialogResult result = MessageBox.Show("确定执行夹具放松操作?","提示",MessageBoxButtons.OKCancel);
if (result.Equals(DialogResult.OK))
{
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);
FixtureCylinderMove(IO_VALUE.LOW, IO_VALUE.LOW); if (result.Equals(DialogResult.OK))
{
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!