Commit 9156bbe9 几米阳光

增加夹具夹紧处理

1 个父辈 19509c36
......@@ -39,7 +39,12 @@ namespace URSoldering.DeviceLibrary
{
WarnMsg = "急停未开";
return false;
}
}
if (!IsFixtureClamp())
{
WarnMsg = "夹具未夹紧";
return false;
}
//焊接机器人复位
string solderingStr = "";
if (Status > RobotStatus.Wait)
......@@ -64,10 +69,7 @@ namespace URSoldering.DeviceLibrary
mainTimer.Enabled = true;
return true;
}
/// <summary>
/// 急停 处理
/// </summary>
private void SuddendownProcess()
{
WarnMsg = "收到急停信号,设备急停";
......@@ -75,8 +77,14 @@ namespace URSoldering.DeviceLibrary
IsInSuddendown = true;
Alarm(AlarmType.SuddenStop);
}
public string StartWeld()
private void FixtureRelaxProcess()
{
WarnMsg = "夹具未夹紧,设备急停";
LogUtil.error(RobotName + WarnMsg);
IsInSuddendown = true;
Alarm(AlarmType.SuddenStop);
}
public string StartWeld()
{
string msg = "";
......@@ -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))
......
......@@ -262,38 +262,42 @@ namespace URSoldering.Client
//判断是否开急停
if (RobotBean.ShuddenOK().Equals(false))
{
lblMsg.Text = "急停未开";
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;
{
this.btnWUp.Enabled = true;
}
if (!URRobotControl.IsRun&&isRun.Equals(false))
if (!URRobotControl.IsRun && isRun.Equals(false))
{
isRun = true;
Task.Factory.StartNew(delegate ()
{
bool result = URRobotControl.StartRobot();
if (!result)
{
{
LogUtil.info("连接失败:" + result);
}
else
{
URRobotControl.FreeAxis();
URRobotControl.FreeAxis();
}
});
}
else
{
RobotStatus(true);
UpdateRobotPosition();
}
}
if (URRobotControl.IsRun)
{
RobotStatus(true);
UpdateRobotPosition();
}
}
......
......@@ -179,8 +179,16 @@ namespace URSoldering.Client
lblMsg.Text = "急停未开";
if (this.btnSendWireStop.Enabled)
{
FormStatus(false);
}
}
else if (RobotBean.IsFixtureClamp().Equals(false))
{
lblMsg.Text = "夹具未夹紧";
if (this.btnSendWireStop.Enabled)
{
FormStatus(false);
}
}
else
......@@ -290,12 +298,19 @@ namespace URSoldering.Client
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)
{
FixtureCylinderMove(IO_VALUE.LOW, IO_VALUE.LOW);
{ 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!