Commit e096c46d 刘韬

1

1 个父辈 96809aed
...@@ -408,7 +408,7 @@ namespace DeviceLibrary ...@@ -408,7 +408,7 @@ namespace DeviceLibrary
foreach (AxisBean axis in axisArray) foreach (AxisBean axis in axisArray)
{ {
bool result = axis.Open(false, out msg); bool result = axis.Open(false, out msg);
if (!result || (!String.IsNullOrEmpty(msg))) if (!result)
{ {
//SetWarnMsg(Name + msg); //SetWarnMsg(Name + msg);
//Alarm(AlarmType.AxisAlarm); //Alarm(AlarmType.AxisAlarm);
......
...@@ -18,6 +18,7 @@ namespace DeviceLibrary ...@@ -18,6 +18,7 @@ namespace DeviceLibrary
public int UpOverTimeMS = 0; public int UpOverTimeMS = 0;
string up; string up;
string down; string down;
string saftylight;
string axisbreak; string axisbreak;
AxisBean axisBean; AxisBean axisBean;
int upspeed; int upspeed;
...@@ -25,9 +26,10 @@ namespace DeviceLibrary ...@@ -25,9 +26,10 @@ namespace DeviceLibrary
int StrokeLength = 270000; int StrokeLength = 270000;
MoveInfo moveInfo1 = new MoveInfo("升降机构", false); MoveInfo moveInfo1 = new MoveInfo("升降机构", false);
bool paused = false; bool paused = false;
public LiftMonitor(string _up, string _down,string _break, AxisBean _axisBean,int _StrokeLength,int _upspeed, int _downspeed= 0) { public LiftMonitor(string _up, string _down,string _saftylight,string _break, AxisBean _axisBean,int _StrokeLength,int _upspeed, int _downspeed= 0) {
up = _up; up = _up;
down = _down; down = _down;
saftylight = _saftylight;
axisBean = _axisBean; axisBean = _axisBean;
upspeed = _upspeed; upspeed = _upspeed;
axisbreak = _break; axisbreak = _break;
...@@ -86,7 +88,12 @@ namespace DeviceLibrary ...@@ -86,7 +88,12 @@ namespace DeviceLibrary
return; return;
} }
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) { if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) {
LogUtil.info("设备急停"); moveInfo.log("设备急停");
Pause();
return;
}
if (!string.IsNullOrEmpty(saftylight) && IOManager.IOValue(saftylight).Equals(IO_VALUE.LOW)) {
moveInfo.log("安全光栅触发停止");
Pause(); Pause();
return; return;
} }
...@@ -171,6 +178,12 @@ namespace DeviceLibrary ...@@ -171,6 +178,12 @@ namespace DeviceLibrary
Pause(); Pause();
return; return;
} }
if (!string.IsNullOrEmpty(saftylight) && IOManager.IOValue(saftylight).Equals(IO_VALUE.LOW))
{
moveInfo.log("安全光栅触发停止");
Pause();
return;
}
} }
moveInfo.WaitList.Remove(wr); moveInfo.WaitList.Remove(wr);
......
...@@ -122,8 +122,8 @@ namespace DeviceLibrary ...@@ -122,8 +122,8 @@ namespace DeviceLibrary
{ {
RobotManage.Config.DOList.Remove(IO_Type.ReelFlipDoor_Work); RobotManage.Config.DOList.Remove(IO_Type.ReelFlipDoor_Work);
RobotManage.Config.DOList.Remove(IO_Type.ReelFlipDoor_Home); RobotManage.Config.DOList.Remove(IO_Type.ReelFlipDoor_Home);
MotorFlipDoorB = new LiftMonitor(IO_Type.ReelFlipDoor_L_Home, IO_Type.ReelFlipDoor_L_Work, null, new AxisBean(Config.FlipDoor_L_Axis, Name), Config.FlipDoorLength, Config.FlipDoorLength_speed); MotorFlipDoorB = new LiftMonitor(IO_Type.ReelFlipDoor_L_Home, IO_Type.ReelFlipDoor_L_Work,IO_Type.SafetyLightCurtains, null, new AxisBean(Config.FlipDoor_L_Axis, Name), Config.FlipDoorLength, Config.FlipDoorLength_speed);
MotorFlipDoorA = new LiftMonitor(IO_Type.ReelFlipDoor_R_Home, IO_Type.ReelFlipDoor_R_Work, null, new AxisBean(Config.FlipDoor_R_Axis, Name), Config.FlipDoorLength, Config.FlipDoorLength_speed); MotorFlipDoorA = new LiftMonitor(IO_Type.ReelFlipDoor_R_Home, IO_Type.ReelFlipDoor_R_Work, IO_Type.SafetyLightCurtains, null, new AxisBean(Config.FlipDoor_R_Axis, Name), Config.FlipDoorLength, Config.FlipDoorLength_speed);
LogUtil.info("加载翻板门类型为:步进"); LogUtil.info("加载翻板门类型为:步进");
} }
else { else {
...@@ -131,18 +131,19 @@ namespace DeviceLibrary ...@@ -131,18 +131,19 @@ namespace DeviceLibrary
} }
//检测料串门是否为鸣志电机控制 //检测料串门是否为鸣志电机控制
if (Config.StringDoor_Axis != null) { if (Config.StringDoor_Axis != null)
{
RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Open); RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Open);
RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Close); RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Close);
StringDoor = new LiftMonitor(IO_Type.StringDoor_Open, IO_Type.StringDoor_Close, IO_Type.StringDoor_Axis_Break, new AxisBean(Config.StringDoor_Axis, Name), Config.StringDoorLength, Config.StringDoorLength_speed); var sf = "";
if (ConfigHelper.Config.Get("Device_IO_X08IsStringDoor_SafetyLightCurtains", false))
sf = IO_Type.AGV_OnPosition;
StringDoor = new LiftMonitor(IO_Type.StringDoor_Open, IO_Type.StringDoor_Close, sf, IO_Type.StringDoor_Axis_Break, new AxisBean(Config.StringDoor_Axis, Name), Config.StringDoorLength, Config.StringDoorLength_speed);
StringDoor.DownOverTimeMS = ConfigHelper.Config.Get("Device_StringDoor_DownOverTimeMS", 0); StringDoor.DownOverTimeMS = ConfigHelper.Config.Get("Device_StringDoor_DownOverTimeMS", 0);
StringDoor.UpOverTimeMS = ConfigHelper.Config.Get("Device_StringDoor_UpOverTimeMS", 0); StringDoor.UpOverTimeMS = ConfigHelper.Config.Get("Device_StringDoor_UpOverTimeMS", 0);
LogUtil.info("加载料串门类型为:步进"); LogUtil.info("加载料串门类型为:步进");
//此版本同步删除其他IO }
else
//RobotManage.Config.DOList.Remove(IO_Type.NitrogenValve);
}else
LogUtil.info("加载料串门类型为:气缸"); LogUtil.info("加载料串门类型为:气缸");
if (ConfigHelper.Config.Get("Device_Disable_DoorSafeCheck", false)) { if (ConfigHelper.Config.Get("Device_Disable_DoorSafeCheck", false)) {
...@@ -606,6 +607,11 @@ namespace DeviceLibrary ...@@ -606,6 +607,11 @@ namespace DeviceLibrary
} }
if (!lastSafeCheckStatus && ok) if (!lastSafeCheckStatus && ok)
{ {
if (!AxisBean.RunMultiAxis(true, out string msg, AxisBean.List))
{
ok = false;
Msg.add(msg, MsgLevel.warning);
}
SafetyDevice.ResumeAll(); SafetyDevice.ResumeAll();
} }
lastSafeCheckStatus = ok; lastSafeCheckStatus = ok;
...@@ -634,6 +640,13 @@ namespace DeviceLibrary ...@@ -634,6 +640,13 @@ namespace DeviceLibrary
public bool DeviceCheck() { public bool DeviceCheck() {
bool ok = true; bool ok = true;
isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW); isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW);
var SafetyLightStop = IOValue(IO_Type.DoorSafe_Disable).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW);
if (SafetyLightStop)
{
lastSafeCheckStatus = false;
Msg.add(crc.GetString(L.SafetyLight_is_block, "安全光栅被遮挡"), MsgLevel.warning);
return false;
}
if (UserPause) if (UserPause)
{ {
Msg.add(crc.GetString(L.system_pause, "系统暂停"), MsgLevel.warning); Msg.add(crc.GetString(L.system_pause, "系统暂停"), MsgLevel.warning);
......
...@@ -3,7 +3,6 @@ using System.Collections.Generic; ...@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace OnlineStore.LoadCSVLibrary namespace OnlineStore.LoadCSVLibrary
{ {
//这里利用AttributeUsage 来设置我们的自定义属性的应用范围,这里定义的可以用于类,结构和方法的声明 //这里利用AttributeUsage 来设置我们的自定义属性的应用范围,这里定义的可以用于类,结构和方法的声明
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!