Commit 52a58a0b 张东亮

光栅暂停功能添加

1 个父辈 ffd8084d
......@@ -37,7 +37,6 @@ namespace OnlineStore.CarriageClient
}
private void FrmStoreIOStatus_Load(object sender, EventArgs e)
{
chbMoveStop.Checked = robotEquip.MoveStop;
lblStoreStatus.Text = DeviceBase.GetRunStr(robotEquip.runStatus);
lblThisSta.Text = robotEquip.WarnMsg;
......@@ -203,10 +202,6 @@ namespace OnlineStore.CarriageClient
{
try
{
if (!this.Visible)
{
return;
}
ReadIOList();
//ReadBtnDO();
// clampJawControl1.UpdateSta();
......@@ -217,6 +212,16 @@ namespace OnlineStore.CarriageClient
{
FormStatus(true);
}
if (robotEquip.MoveStop)
{
btnMoveStop.Text = "恢复运动";
btnMoveStop.BackColor = Color.Green;
}
else
{
btnMoveStop.Text = "暂停运动";
btnMoveStop.BackColor = Color.Yellow;
}
}
else
{
......@@ -240,7 +245,7 @@ namespace OnlineStore.CarriageClient
{
lblInoutInfo.Text = "";
}
lblrobotTaskInfo.Text =$"{SServerManager.RobotTaskInfo}\r\n{SServerManager.BoxDoorStatus}" ;
lblrobotTaskInfo.Text = $"{SServerManager.RobotTaskInfo}\r\n{SServerManager.BoxDoorStatus}";
lblMoveInfo.Text = robotEquip.GetMoveStr();//+ "料仓类型:" + (boxBean.Config.IsBigTray.Equals(1) ? "大料盘" : "小料盘");
//string canOut = boxBean.CanOutStore(boxBean.DeviceID) ? "可出库" : "不可出库";
lblStoreStatus.Text = DeviceBase.GetRunStr(robotEquip.runStatus);// + "(" + canOut + ")";
......@@ -492,17 +497,6 @@ namespace OnlineStore.CarriageClient
tabcon.Controls.Add(lineTabPage);
}
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
robotEquip.MoveStop = chbMoveStop.Checked;
LogUtil.info(robotEquip.Name + "用户切换是否暂停: " + robotEquip.MoveStop);
}
private void btnCloseAll_Click(object sender, EventArgs e)
{
......@@ -577,9 +571,28 @@ namespace OnlineStore.CarriageClient
ucRobot1.Update(jAKABean.RobotData);
}
}
catch(Exception ex)
catch (Exception ex)
{
LogUtil.error("chkManualRobot_CheckedChanged", ex);
}
}
private void btnMoveStop_Click(object sender, EventArgs e)
{
if (robotEquip.runStatus <= RunStatus.Wait)
{
MessageBox.Show(robotEquip.Name + "请先启动设备", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
if (robotEquip.MoveStop)
{
robotEquip.Resume();
LogUtil.info($"用户点击恢复运动按钮");
}
else
{
LogUtil.error("chkManualRobot_CheckedChanged",ex);
robotEquip.Pause();
LogUtil.info($"用户点击暂停运动按钮");
}
}
......
......@@ -63,6 +63,7 @@ DI,1,13寸料盘顶升下降端,Inlet_13InchJackDownSig,9,HC,X09,,,,,,,,,,,,
DI,3,NG料暂存区料盘检测,NGBox_TrayCheck,10,HC,X10,,,,,,,,,,,,
DI,3,机械臂料盘检测,RobotArm_TrayCheck,11,HC,X11,,,,,,,,,,,,
DI,3,机械臂夹紧检测,RobotArm_ClampingSig,12,HC,X12,,,,,,,,,,,,
DI,3,安全光栅,SafetyLightGrids,18,HC,X18,,,,,,,,,,,,
DI,2,出料线体顶升上升端,Outlet_JackUpSig,13,HC,X13,,,,,,,,,,,,
DI,2,出料线体顶升下降端,Outlet_JackDownSig,14,HC,X14,,,,,,,,,,,,
DI,2,出料线体料盘检测1,Outlet_TrayCheck1,15,HC,X15,,,,,,,,,,,,
......
......@@ -75,7 +75,6 @@ namespace OnlineStore.DeviceLibrary
return;
}
if (MoveInfo.MoveType.Equals(MoveType.RHome))
{
ResetProcess();
......
......@@ -470,54 +470,21 @@ namespace OnlineStore.DeviceLibrary
}
}
#endregion
#region 门禁
//门禁状态:0正常。1=安全门禁打开,已停止运动
private int CurrSecurityAccess = 0;
#region 门禁光栅
protected void SecurityAccessProcess()
{
try
{
//if (!baseConfig.DIList.ContainsKey(IO_Type.LeftDoor_Limit))
//{
// return;
//}
//if (!baseConfig.DIList.ContainsKey(IO_Type.RightDoor_Limit))
//{
// return;
//}
//if (!baseConfig.DIList.ContainsKey(IO_Type.BackDoor_Limit))
//{
// return;
//}
if (CurrSecurityAccess.Equals(0))
if(!MoveStop)
{
//if (StoreManager.DisBoxSecurityAccess)
//{
//}
//else if (IOValue(IO_Type.LeftDoor_Limit).Equals(IO_VALUE.LOW))
//{
// SecurityAccessStop("左前门门禁");
//}
//else if (IOValue(IO_Type.RightDoor_Limit).Equals(IO_VALUE.LOW))
//{
// SecurityAccessStop("右前门门禁");
//}
//else if (IOValue(IO_Type.BackDoor_Limit).Equals(IO_VALUE.LOW))
//{
// SecurityAccessStop("后门门禁");
//}
}
else if (CurrSecurityAccess.Equals(1))
{
//if (IOValue(IO_Type.LeftDoor_Limit).Equals(IO_VALUE.HIGH) &&
// IOValue(IO_Type.RightDoor_Limit).Equals(IO_VALUE.HIGH) &&
// IOValue(IO_Type.BackDoor_Limit).Equals(IO_VALUE.HIGH))
//{
// SecurityAccessReset();
//}
if (IOValue(IO_Type.SafetyLightGrids).Equals(IO_VALUE.LOW))
{
Pause();
LogUtil.info("安全光栅触发,停止行走机构和机器人运动");
}
}
}
catch (Exception ex)
{
......@@ -525,56 +492,19 @@ namespace OnlineStore.DeviceLibrary
}
}
//private void SecurityAccessStop(string doorname)
//{
// if (!baseConfig.DIList.ContainsKey(IO_Type.LeftDoor_Limit))
// {
// return;
// }
// if (!baseConfig.DIList.ContainsKey(IO_Type.RightDoor_Limit))
// {
// return;
// }
// if (!baseConfig.DIList.ContainsKey(IO_Type.BackDoor_Limit))
// {
// return;
// }
// CurrSecurityAccess = 1;
// if (alarmType > (AlarmType.IoSingleTimeOut))
// {
// return;
// }
// LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停");
// SetWarnMsg($"{doorname}被打开,报警急停");
// Alarm(AlarmType.SuddenStop);
//}
//private void SecurityAccessReset()
//{
// if (!baseConfig.DIList.ContainsKey(IO_Type.LeftDoor_Limit))
// {
// return;
// }
// if (!baseConfig.DIList.ContainsKey(IO_Type.RightDoor_Limit))
// {
// return;
// }
// if (!baseConfig.DIList.ContainsKey(IO_Type.BackDoor_Limit))
// {
// return;
// }
// CurrSecurityAccess = 0;
// MoveStop = false;
// if (alarmType > (AlarmType.IoSingleTimeOut))
// {
// return;
// }
// //光栅恢复处理
//}
public void Pause()
{
MoveStop = true;
CompressAxis.SuddenStop();
MoveAxis.SuddenStop();
RobotPause();
MoveInfo.CanWhileCount = 5;
}
public void Resume()
{
MoveStop = false;
RobotResume();
}
#endregion
......
using CodeLibrary;
using log4net.Util;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
......@@ -343,6 +344,23 @@ namespace OnlineStore.DeviceLibrary
bean.MotionAbort();
}
}
public bool RobotPause()
{
if (GetRobotInfo(out JAKA.JAKABean bean))
{
return bean.Pause();
}
return false;
}
public bool RobotResume()
{
if (GetRobotInfo(out JAKA.JAKABean bean))
{
return bean.Resume();
}
return false;
}
#endregion
#region 行走机构
......
......@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
......@@ -26,7 +26,7 @@ namespace OnlineStore.LoadCSVLibrary
}
return TypeList;
}
/// <summary>
......@@ -101,7 +101,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DI,2,出料线体允许送料,Outlet_AllowFeedSig,17,HC,X17,,,,,,,,,,,,
/// </summary>
public static string Outlet_AllowFeedSig = "Outlet_AllowFeedSig";
/// <summary>
/// DI,3,安全光栅,SafetyLightGrids,18,HC,X18,,,,,,,,,,,,
/// </summary>
public static string SafetyLightGrids = "SafetyLightGrids";
/// <summary>
/// DO,1,自动绿色指示灯,RunSign_HddLed,0,HC,Y00,,,,,,,,,,,,
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!