Commit 9156bbe9 几米阳光

增加夹具夹紧处理

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