Commit ec655f8a 几米阳光

出料逻辑修改。

1 个父辈 e1ba4c05
...@@ -14,7 +14,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -14,7 +14,7 @@ namespace OnlineStore.AutoInOutStore
{ {
public class ResourceCulture public class ResourceCulture
{ {
public static bool ShowLog = true ; public static bool ShowLog = false ;
public static string China = "zh-CN"; public static string China = "zh-CN";
public static string English = "en-US"; public static string English = "en-US";
public static string German = "ge-DE"; public static string German = "ge-DE";
......
...@@ -198,10 +198,11 @@ IO模块读取时间改为可配置。 ...@@ -198,10 +198,11 @@ IO模块读取时间改为可配置。
BUG需要修改:
吸盘吸料过程中需要一直检测吸盘气压信号
门锁未关闭时不能点关闭门锁。
......
...@@ -16,7 +16,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,7 +16,8 @@ namespace OnlineStore.DeviceLibrary
private static bool IsStop = false; private static bool IsStop = false;
private static System.Timers.Timer checkTimer = null; private static System.Timers.Timer checkTimer = null;
private static string TargetIoType = IO_Type.TrayCheck_LoadMaterial; private static string TargetIoType = IO_Type.TrayCheck_LoadMaterial;
public static bool StartCheck(string targetIo) private static IO_VALUE TargetIoValue = IO_VALUE.HIGH;
public static bool StartCheck(string targetIo, IO_VALUE value = IO_VALUE.HIGH)
{ {
if (checkTimer == null) if (checkTimer == null)
{ {
...@@ -26,6 +27,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -26,6 +27,7 @@ namespace OnlineStore.DeviceLibrary
checkTimer.Elapsed += CheckTimer_Elapsed; checkTimer.Elapsed += CheckTimer_Elapsed;
checkTimer.Enabled = false; checkTimer.Enabled = false;
} }
TargetIoValue = value;
TargetIoType = targetIo; TargetIoType = targetIo;
checkTimer.Start(); checkTimer.Start();
return true; return true;
...@@ -46,9 +48,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -46,9 +48,9 @@ namespace OnlineStore.DeviceLibrary
if (IsInProcess) { return; } if (IsInProcess) { return; }
IsInProcess = true; IsInProcess = true;
bool result = false; bool result = false;
if (IOManager.IOValue(TargetIoType).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(TargetIoType).Equals(TargetIoValue))
{ {
LogUtil.info("批量上料轴,检测到【" + TargetIoType + "】信号,可以停止运动"); LogUtil.info("批量上料轴,检测到 " + TargetIoType + "="+TargetIoValue+",可以停止运动");
result = true; result = true;
} }
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH)) else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
......
...@@ -384,6 +384,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -384,6 +384,8 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I07_BatchAxisUp)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I07_BatchAxisUp))
{ {
if (IOManager.IOValue(IO_Type.SuckingDisc_Air).Equals(IO_VALUE.HIGH))
{
TimeSpan span = DateTime.Now - StoreMove.LastSetpTime; TimeSpan span = DateTime.Now - StoreMove.LastSetpTime;
//需要判断入库超时 //需要判断入库超时
...@@ -430,6 +432,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -430,6 +432,13 @@ namespace OnlineStore.DeviceLibrary
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType); StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType);
} }
} }
else
{
WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore);
LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败", 105);
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I08_GetPosId)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I08_GetPosId))
{ {
//判断是否开始入库 //判断是否开始入库
...@@ -641,27 +650,44 @@ namespace OnlineStore.DeviceLibrary ...@@ -641,27 +650,44 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
//取料盘时,先检测X12,若X12不亮,直接打开门。
//若X12亮,先匀速下降到X12不亮,再开门。
if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O00_Wait)) if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O00_Wait))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O01_WaitDoorOpen);
BatchDoorOpen(true);
if (IOManager.IOValue(IO_Type.OutCheck).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.OutCheck).Equals(IO_VALUE.LOW))
{ {
LogUtil.info(Name + "出料: 等待门锁打开, OutCheck=LOW批量轴不需要到P2 "); LogUtil.info(Name + "出料: OutCheck=LOW ,直接打开门锁 ");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O02_WaitDoorOpen);
BatchDoorOpen(true);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
} }
else else
{ {
LogUtil.info(Name + "出料: 等待门锁打开,批量轴回到P2点 "); StoreMove.NextMoveStep(StoreMoveStep.AUTO_O01_BatchAxisDown);
LogUtil.info(Name + "出料: OutCheck=HIGH,批量轴先匀速下降到P2 ");
//批量轴直接走到P2 //批量轴直接走到P2
ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed); AUTO_SA_Config Config = StoreManager.Config;
//ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.OutCheck);
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(Config.Batch_Axis, Config.BatchAxis_P2, IO_Type.OutCheck, IO_VALUE.LOW));
BatchAxisController.StartCheck(IO_Type.OutCheck, IO_VALUE.LOW);
StoreManager.Config.Batch_Axis.TargetPosition = Config.BatchAxis_P2;
int speed = Config.BatchAxis_SlowSpeed;
ACServerManager.AbsMove(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue(), Config.BatchAxis_OutMaxValue, speed);
// ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
} }
}else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O01_BatchAxisDown))
{
LogUtil.info(Name + "出料: 批量轴已下降到OutCheck=LOW ,打开门锁 ");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O02_WaitDoorOpen);
BatchDoorOpen(true);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O01_WaitDoorOpen)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O02_WaitDoorOpen))
{ {
if (IOManager.IOValue(IO_Type.OutCheck).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.OutCheck).Equals(IO_VALUE.HIGH))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O02_WaitOutSingleLow); StoreMove.NextMoveStep(StoreMoveStep.AUTO_O03_WaitOutSingleLow);
LogUtil.info(Name + " 出料 ,等待出料检测信号关闭"); LogUtil.info(Name + " 出料 ,等待出料检测信号关闭");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutCheck, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutCheck, IO_VALUE.LOW));
} }
...@@ -670,12 +696,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -670,12 +696,12 @@ namespace OnlineStore.DeviceLibrary
StartSpeedOut(); StartSpeedOut();
} }
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O02_WaitOutSingleLow)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O03_WaitOutSingleLow))
{ {
StartSpeedOut(); StartSpeedOut();
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O03_SpeedMove)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O04_SpeedMove))
{ {
//先判断极限是否亮 //先判断极限是否亮
//int value = ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis); //int value = ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis);
...@@ -690,7 +716,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -690,7 +716,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//等待出料信号亮 //等待出料信号亮
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O02_WaitOutSingleLow); StoreMove.NextMoveStep(StoreMoveStep.AUTO_O03_WaitOutSingleLow);
LogUtil.info(Name + " 出料 ,等待出料检测信号关闭"); LogUtil.info(Name + " 出料 ,等待出料检测信号关闭");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutCheck, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutCheck, IO_VALUE.LOW));
} }
...@@ -709,7 +735,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -709,7 +735,7 @@ namespace OnlineStore.DeviceLibrary
} }
private static void StartSpeedOut() private static void StartSpeedOut()
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O03_SpeedMove); StoreMove.NextMoveStep(StoreMoveStep.AUTO_O04_SpeedMove);
AUTO_SA_Config Config = StoreManager.Config; AUTO_SA_Config Config = StoreManager.Config;
LogUtil.info(Name + " 出料 ,轴上升到检测到出料信号,速度【" + Config.BatchAxis_SlowSpeed + "】,最大上升高度【" + Config.BatchAxis_OutMaxValue + "】"); LogUtil.info(Name + " 出料 ,轴上升到检测到出料信号,速度【" + Config.BatchAxis_SlowSpeed + "】,最大上升高度【" + Config.BatchAxis_OutMaxValue + "】");
//ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.OutCheck); //ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.OutCheck);
...@@ -789,8 +815,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -789,8 +815,12 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public static void BatchDoorClose(bool isWait) public static bool BatchDoorClose(bool isWait)
{
if (!IOManager.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
return false;
}
ClearInStoreInfo(); ClearInStoreInfo();
ClearOutStoreInfo(); ClearOutStoreInfo();
DoorStatus = 2; DoorStatus = 2;
...@@ -803,6 +833,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -803,6 +833,7 @@ namespace OnlineStore.DeviceLibrary
} }
IOManager.IOMove(IO_Type.BatchDoor_Open, IO_VALUE.LOW); IOManager.IOMove(IO_Type.BatchDoor_Open, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.BatchDoor_Close, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.BatchDoor_Close, IO_VALUE.HIGH);
return true;
} }
} }
......
...@@ -262,9 +262,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -262,9 +262,9 @@ namespace OnlineStore.DeviceLibrary
public static bool BatchAxisIsEnd(WaitResultInfo wait,TimeSpan startSpan) public static bool BatchAxisIsEnd(WaitResultInfo wait,TimeSpan startSpan)
{ {
bool result = false; bool result = false;
if (IOManager.IOValue(wait.IoType).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(wait.IoType).Equals(wait.IoValue))
{ {
LogUtil.debug(wait.ToStr() + " 检测到【" + wait.IoType + "】信号,可以停止运动"); LogUtil.debug(wait.ToStr() + " 检测到 " + wait.IoType + "="+wait.IoValue+",可以停止运动");
result = true; result = true;
} }
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH)) else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
...@@ -569,15 +569,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -569,15 +569,15 @@ namespace OnlineStore.DeviceLibrary
} }
if ( IsWaitTragGo && ( IsGetTrayGo.Equals(false))) if (IsWaitTragGo && (IsGetTrayGo.Equals(false)))
{ {
map[ParamDefine.confirmReelOut] = ParamDefine.enable; map[ParamDefine.confirmReelOut] = ParamDefine.enable;
} }
else if ( CanOpenBatchDoor()) else if (CanOpenBatchDoor())
{ {
if ( DoorStatus.Equals(2)) if (DoorStatus.Equals(2))
{ {
if ( BatchOutStoreCount > 0) if (BatchOutStoreCount > 0)
{ {
map[ParamDefine.takeOutReel] = ParamDefine.enable; map[ParamDefine.takeOutReel] = ParamDefine.enable;
} }
...@@ -587,12 +587,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -587,12 +587,17 @@ namespace OnlineStore.DeviceLibrary
map[ParamDefine.singleReelIn] = ParamDefine.enable; map[ParamDefine.singleReelIn] = ParamDefine.enable;
} }
} }
else else if(IOManager.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
map[ParamDefine.closeLock] = ParamDefine.enable; map[ParamDefine.closeLock] = ParamDefine.enable;
map[ParamDefine.startBatchIn] = ParamDefine.enable; map[ParamDefine.startBatchIn] = ParamDefine.enable;
} }
} }
else if (DoorStatus.Equals(1) && StoreMove.MoveType.Equals(StoreMoveType.OutStore) && IOManager.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
{
//出库过程中 可以关门
map[ParamDefine.closeLock] = ParamDefine.enable;
}
return map; return map;
} }
...@@ -611,18 +616,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -611,18 +616,18 @@ namespace OnlineStore.DeviceLibrary
} }
public static string doStartBatchIn() public static string doStartBatchIn()
{ {
if (! DoorIsClose()) if (!DoorIsClose())
{ {
return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device"); return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device");
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
return ResourceControl.GetString(ResourceControl.batchInError2, "Batch storing Error: gripper full, check before restoring"); return ResourceControl.GetString(ResourceControl.batchInError2, "Batch storing Error: gripper full, check before restoring");
} }
StopOutProcess(); StopOutProcess();
BatchDoorClose(false); BatchDoorClose(false);
Reset(false,true); Reset(false, true);
return ""; return "";
} }
public static string doTakeReel() public static string doTakeReel()
...@@ -631,7 +636,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -631,7 +636,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (BatchOutStoreCount > 0 && BatchOutStoreHeight > 0) if (BatchOutStoreCount > 0 && BatchOutStoreHeight > 0)
{ {
BatchDoorOpen(false); // BatchDoorOpen(false);
return StartOut(); return StartOut();
//return ""; //return "";
} }
......
...@@ -556,22 +556,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -556,22 +556,26 @@ namespace OnlineStore.DeviceLibrary
AUTO_O00_Wait=1300, AUTO_O00_Wait=1300,
/// <summary> /// <summary>
/// 等待门锁打开 /// 批量轴先匀速下降到X12不亮
/// </summary> /// </summary>
AUTO_O01_WaitDoorOpen =1301, AUTO_O01_BatchAxisDown=1301,
/// <summary>
/// 打开门锁
/// </summary>
AUTO_O02_WaitDoorOpen =1302,
/// <summary> /// <summary>
/// 等待出料检测信号关闭 /// 等待出料检测信号关闭
/// </summary> /// </summary>
AUTO_O02_WaitOutSingleLow=1302, AUTO_O03_WaitOutSingleLow=1303,
/// <summary> /// <summary>
/// 向上运动,等待DI12亮或者极限亮停止 /// 向上运动,等待DI12亮或者极限亮停止
/// </summary> /// </summary>
AUTO_O03_SpeedMove=1303, AUTO_O04_SpeedMove=1304,
/// <summary> /// <summary>
/// 极限亮,返回P2点 /// 极限亮,返回P2点
/// </summary> /// </summary>
AUTO_O05_BackToP2=1304, AUTO_O05_BackToP2=1305,
#endregion #endregion
......
...@@ -277,7 +277,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -277,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
/// 10=等待批量上下料轴运动 停止 /// 10=等待批量上下料轴运动 停止
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis,int targetPosition,string targetIoType) public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis,int targetPosition,string targetIoType,IO_VALUE value=IO_VALUE.HIGH)
{ {
WaitResultInfo wait = new WaitResultInfo(); WaitResultInfo wait = new WaitResultInfo();
wait.TargetPosition = targetPosition; wait.TargetPosition = targetPosition;
...@@ -287,6 +287,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -287,6 +287,7 @@ namespace OnlineStore.DeviceLibrary
wait.IsHomeMove = true; wait.IsHomeMove = true;
wait.IsEnd = false; wait.IsEnd = false;
wait.IoType = targetIoType; wait.IoType = targetIoType;
wait.IoValue = value;
return wait; return wait;
} }
/// <summary> /// <summary>
...@@ -350,11 +351,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -350,11 +351,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (WaitType == (int)Wait_Type.WaitHeight_7) else if (WaitType == (int)Wait_Type.WaitHeight_7)
{ {
return ResourceControl.GetString(ResourceControl.trayHeight,"料盘高度")+"【" + HeightValue + "】 "; return ResourceControl.GetString(ResourceControl.trayHeight, "料盘高度") + "【" + HeightValue + "】 ";
} }
else if (WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8) else if (WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
{ {
return "【" + AxisInfo.DisplayStr + "】"+ ResourceControl.GetString(ResourceControl.FuLimit, "负限位")+"【" + IoValue + "】 "; return "【" + AxisInfo.DisplayStr + "】" + ResourceControl.GetString(ResourceControl.FuLimit, "负限位") + "【" + IoValue + "】 ";
} }
else if (WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9) else if (WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
{ {
...@@ -362,15 +363,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -362,15 +363,23 @@ namespace OnlineStore.DeviceLibrary
} }
else if (WaitType == (int)Wait_Type.BatchAxisMove_10) else if (WaitType == (int)Wait_Type.BatchAxisMove_10)
{ {
return ResourceControl.GetString(ResourceControl.BatchStop,"上料轴运动停止 "); return ResourceControl.GetString(ResourceControl.BatchStop, "上料轴运动停止 ");
}else if (WaitType == (int)Wait_Type.ScanCode_11) }
else if (WaitType == (int)Wait_Type.ScanCode_11)
{ {
return ResourceControl.GetString(ResourceControl.ScanOk, "扫码结束"); return ResourceControl.GetString(ResourceControl.ScanOk, "扫码结束");
} }
else if(WaitType == (int)Wait_Type.TakeTrayGo_12) else if (WaitType == (int)Wait_Type.TakeTrayGo_12)
{
if (AutomaticBaiting.WaitIoValue.Equals(IO_VALUE.HIGH))
{
return ResourceControl.GetString("操作人员放入料盘", "操作人员放入料盘");
}
else
{ {
return ResourceControl.GetString(ResourceControl.TakeTrayGo, "操作人员拿走料盘"); return ResourceControl.GetString(ResourceControl.TakeTrayGo, "操作人员拿走料盘");
} }
}
else if (WaitType == (int)Wait_Type.StoreRuning_13) else if (WaitType == (int)Wait_Type.StoreRuning_13)
{ {
return ResourceControl.GetString(ResourceControl.WaitEnd, "等待送料结束"); return ResourceControl.GetString(ResourceControl.WaitEnd, "等待送料结束");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!