Commit e096c46d 刘韬

1

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