Commit 16921313 LN

出入库时需要检测叉子是否有料

1 个父辈 a547da51
......@@ -28,7 +28,7 @@
<add key="CameraName" value="GigE:acA3800-10gc (23124327)#GigE:acA3800-10gc (23172285)" />
<!--二维码类型列表配置,用#分割-->
<add key="CodeType" value="QR Code" />
<add key="CodeType" value="Data Matrix ECC 200#QR Code" />
<add key="CodeType" value="Data Matrix ECC 200#QR Code#PDF417" />
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" />
<add key="InOutDefaultPosition" value="50000000" />
......
......@@ -51,7 +51,7 @@ namespace OnlineStore.AutoInOutStore
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
return str;
}
internal static string GetCodeNum(string codeName = "RC1252-AutoInOutStore")
internal static string GetCodeNum(string codeName = "RC1252-AutoInOutStore-N")
{
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = "";
......
......@@ -11,20 +11,20 @@ using System.Reflection;
using System.Resources;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks;
namespace OnlineStore.AutoInOutStore
{
public class ResourceCulture
{
public static bool ShowLog = false ;
public static bool ShowLog = false;
public static string China = "zh-CN";
public static string English = "en-US";
public static string German = "ge-DE";
public static string Japanese = "ja-JP";
public static string Japanese = "ja-JP";
private static ResourceManager rm = null;
public static string CurrLanguage = "zh-CN";
public static Dictionary<string, string> defaultMap = new Dictionary<string, string>();
/// <summary>
/// Set current culture by name
......@@ -45,8 +45,10 @@ namespace OnlineStore.AutoInOutStore
}
CurrLanguage = name;
Thread.CurrentThread.CurrentCulture = new CultureInfo(name);
LoadAllRes();
}
public static void LoaAllRes()
public static void LoadAllRes()
{
if (rm == null)
{
......@@ -55,22 +57,24 @@ namespace OnlineStore.AutoInOutStore
//CultureInfo ci = Thread.CurrentThread.CurrentCulture;
Dictionary<string, string> chinaMap = GetRMap(China);
Dictionary<string, string> englishMap = GetRMap(English);
List<string> keyList = new List<string>(chinaMap.Keys);
keyList = (from m in keyList orderby m select m).ToList<string>();
List<string> resulList = new List<string>();
foreach(string key in chinaMap.Keys)
foreach (string key in keyList)
{
string china = chinaMap[key];
string english = "";
string english = "";
englishMap.TryGetValue(key, out english);
if (String.IsNullOrEmpty(english))
{
english = "";
}
resulList.Add(key + "," + china.Replace(',', '&') + "," + english.Replace(',', '&'));
resulList.Add(key + "," + china.Replace(',', '&') + "," + english.Replace(',', '&'));
}
File.WriteAllLines("D:\\storeResource.csv", resulList.ToArray());
}
private static Dictionary<string ,string > GetRMap(string lan)
private static Dictionary<string, string> GetRMap(string lan)
{
Dictionary<string, string> chinaMap = new Dictionary<string, string>();
CultureInfo ci = new CultureInfo(lan);
......@@ -98,7 +102,7 @@ namespace OnlineStore.AutoInOutStore
return CurrLanguage;
}
private static Assembly assembly = Assembly.GetExecutingAssembly();
private static Assembly assembly = Assembly.GetExecutingAssembly();
public static string GetString(string id)
{
return GetString(id, id);
......@@ -115,13 +119,13 @@ namespace OnlineStore.AutoInOutStore
}
//CultureInfo ci = Thread.CurrentThread.CurrentCulture;
CultureInfo ci = new CultureInfo(CurrLanguage);
strCurLanguage = rm.GetString(id, ci).Trim();
strCurLanguage = rm.GetString(id, ci).Trim();
if (strCurLanguage.Equals("") && (!defaultStr.Equals("")))
{
strCurLanguage = defaultStr;
NoIdLog(id, defaultStr);
}
}
catch (Exception ex)
{
......@@ -175,7 +179,7 @@ namespace OnlineStore.AutoInOutStore
{
return GetStringByLan(CurrLanguage, id, defaultStr, param);
}
private static void NoIdLog(string id, string defaultStr)
{
......@@ -195,10 +199,10 @@ namespace OnlineStore.AutoInOutStore
{
string value = defaultMap[key];
LogUtil.info(" 缺少文字配置[" + key + "] 默认值[" + value + "]");
}
}
LogUtil.info("结束打印缺少的文字配置");
}
private static string spiltStr = "_";
private static string spiltStr = "_";
private static string Text = "Text";
public static string GetIdStr(string className, string controlName, string propertyName)
{
......@@ -208,11 +212,11 @@ namespace OnlineStore.AutoInOutStore
{
return className + spiltStr + propertyName;
}
public static string GetTextIdStr(string className, string controlName )
public static string GetTextIdStr(string className, string controlName)
{
return className + spiltStr + controlName + spiltStr + Text;
}
public static string GetTextIdStr(string className )
public static string GetTextIdStr(string className)
{
return className + spiltStr + Text;
}
......@@ -229,7 +233,7 @@ namespace OnlineStore.AutoInOutStore
/// </summary>
public static string OpenComFail = "OpenComFail";
/// <summary>
/// 请先启动料仓
/// </summary>
......@@ -271,7 +275,7 @@ namespace OnlineStore.AutoInOutStore
/// </summary>
public static string AutoEnd = "AutoEnd";
/// <summary>
/// 前门未关
/// </summary>
......@@ -300,90 +304,90 @@ namespace OnlineStore.AutoInOutStore
/// <summary>
/// 此设备不支持单个入库
/// </summary>
public static string CanotSingleInStore = "CanotSingleInStore";
public static string CanotSingleInStore = "CanotSingleInStore";
/// <summary>
///叉子不在待机位,请先将叉子退回待机位
/// </summary>
public static string InoutNotOk = "InoutNotOk";
public static string InoutNotOk = "InoutNotOk";
/// <summary>
///警告(叉子在待机位时,才能移动升降轴和旋转轴)
/// </summary>
public static string InoutWarn = "InoutWarn";
public static string InoutWarn = "InoutWarn";
/// <summary>
///无报警,无出入库或者重置操作时,才可以回待机点
/// </summary>
public static string CanotBack = "CanotBack";
public static string CanotBack = "CanotBack";
/// <summary>
///请先关闭批量上下料门
/// </summary>
public static string PCloseDoor = "PCloseDoor";
public static string PCloseDoor = "PCloseDoor";
/// <summary>
///请输入正确的密码
/// </summary>
public static string PWPwd = "PWPwd";
public static string PWPwd = "PWPwd";
/// <summary>
///忙碌中,无法打开门锁
/// </summary>
public static string CnotOpen = "CnotOpen";
public static string CnotOpen = "CnotOpen";
/// <summary>
///批量入库失败:请先关闭上料机构
/// </summary>
public static string batchInError = "batchInError";
public static string batchInError = "batchInError";
/// <summary>
///批量入库失败:叉子料盘检测有料,请检查后再入库
/// </summary>
public static string batchInError2 = "batchInError2";
public static string batchInError2 = "batchInError2";
/// <summary>
///取出料盘失败:无料盘可取
/// </summary>
public static string GetError = "GetError";
public static string GetError = "GetError";
/// <summary>
///取出料盘失败:忙碌中,无法打开门锁
/// </summary>
public static string GetError2 = "GetError2";
public static string GetError2 = "GetError2";
/// <summary>
///锁门失败:请先关闭上料机构
/// </summary>
public static string CloseError = "CloseError";
public static string CloseError = "CloseError";
/// <summary>
///已确认料盘已手动拿出
/// </summary>
public static string TakeTrayOut = "TakeTrayOut";
public static string TakeTrayOut = "TakeTrayOut";
/// <summary>
///未检测到气压信号
/// </summary>
public static string NoAIr = "NoAIr";
public static string NoAIr = "NoAIr";
/// <summary>
///料盘高度
/// </summary>
public static string trayHeight = "trayHeight";
public static string trayHeight = "trayHeight";
/// <summary>
///负限位
/// </summary>
public static string FuLimit = "FuLimit";
public static string FuLimit = "FuLimit";
/// <summary>
///正限位
/// </summary>
public static string ZhLimit = "ZhLimit";
public static string ZhLimit = "ZhLimit";
/// <summary>
///上料轴运动停止
/// </summary>
public static string BatchStop = "BatchStop";
public static string BatchStop = "BatchStop";
/// <summary>
///扫码结束
/// </summary> public static string ScanOk = "ScanOk";
/// <summary>
///操作人员拿走料盘
/// </summary>
public static string TakeTrayGo = "TakeTrayGo";
public static string TakeTrayGo = "TakeTrayGo";
/// <summary>
///等待送料结束
/// </summary>
public static string WaitEnd = "WaitEnd";
public static string WaitEnd = "WaitEnd";
/// <summary>
///吸盘吸料失败
/// </summary>
public static string XiLiaoError = "XiLiaoError";
public static string XiLiaoError = "XiLiaoError";
/// <summary>
///伺服OFF
......
......@@ -31,14 +31,14 @@ namespace OnlineStore.DeviceLibrary
public string autoMsg = "";
//private static StoreMoveType lastMoveType = StoreMoveType.None;
#endregion
#region 出入库参数
private int CurrInOutCount = 0;
private int CurrInOutACount = 0;
private bool LoadParamPosition(InOutStoreParam param )
private bool LoadParamPosition(InOutStoreParam param)
{
if (param == null)
{
......@@ -96,7 +96,7 @@ namespace OnlineStore.DeviceLibrary
#region 出入库结果验证
private bool InOutBackToP1(int InOut_P1)
private bool InOutBackToP1(int InOut_P1)
{
//判断是否在P1,如果是,不需要运行
int outCount = ACServerManager.GetActualtPosition(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
......@@ -259,13 +259,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(WarnObj.WarnMsg, 15);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnObj.WarnMsg, StoreMove.MoveType);
}
}
}
#endregion
#region 入库
private Stopwatch InOutWatch = new Stopwatch();
/// <summary>
/// 开始入库移动移动
/// </summary>
......@@ -273,14 +273,14 @@ namespace OnlineStore.DeviceLibrary
/// <param name="IsBatchWork">是否批量出库</param>
/// <param name="isNeedInStore">是否需要入库,不需要入库时直接等待拿走料盘</param>
/// <returns></returns>
public bool StartInStoreMove(InOutStoreParam param, bool IsBatchWork=true, bool isNeedInStore=true)
public bool StartInStoreMove(InOutStoreParam param, bool IsBatchWork = true, bool isNeedInStore = true)
{
InOutWatch.Restart();
string posId = param != null ? param.PositionNum : "";
string logMsg = IsBatchWork ? " 启动批量入库【" + posId + "】" : " 启动入库【" + posId + "】";
if (!AutomaticBaiting.DoorCloseOK())
{
UpdateInOutMsg(logMsg + "失败,门锁未关闭");
UpdateInOutMsg(logMsg + "失败,门锁未关闭");
return false;
}
if (IsBatchWork && (!SupportBatch(posId)))
......@@ -292,12 +292,12 @@ namespace OnlineStore.DeviceLibrary
{
if (!LoadParamPosition(param))
{
UpdateInOutMsg(logMsg + "失败,找不到库位信息");
UpdateInOutMsg(logMsg + "失败,找不到库位信息");
return false;
}
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料");
UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料");
return false;
}
LogUtil.info(LOGGER, StoreName + logMsg);
......@@ -308,7 +308,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.IsBatchInOutStore = IsBatchWork;
StoreMove.IsNeedInStore = isNeedInStore;
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
{
StoreMove.NextMoveStep(StoreMoveStep.SI_01_LocationCylinderDown);
}
else
......@@ -321,7 +321,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
UpdateInOutMsg(logMsg + "失败,当前状态:" + storeRunStatus);
UpdateInOutMsg(logMsg + "失败,当前状态:" + storeRunStatus);
return false;
}
}
......@@ -333,7 +333,7 @@ namespace OnlineStore.DeviceLibrary
if (!ACServerManager.isInPosition(Config.Comp_Axis, moveP.ComPress_P3))
{
needMove = true;
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
}
if (!ACServerManager.isInPosition(Config.UpDown_Axis, moveP.UpDown_P1))
{
......@@ -367,7 +367,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_04 叉子进入入料口,进出轴至P2 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_04_DeviceToDoor);
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P2, Config.InOutAxis_P2_Speed);
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P2, Config.InOutAxis_P2_Speed);
}
protected override void InStoreProcess()
{
......@@ -393,10 +393,11 @@ namespace OnlineStore.DeviceLibrary
if (StoreMove.IsBatchInOutStore)
{
SI_03_AxisToP1(moveP);
}else
}
else
{
int updownPosition = moveP.UpDown_Door_P7 - Config.UpdownAxis_UpPosition;
InStoreLog("入库:SIS_31 单盘入库:旋转轴待机点P1,升降轴走到仓门位置P7下方位置 "+ updownPosition);
InStoreLog("入库:SIS_31 单盘入库:旋转轴待机点P1,升降轴走到仓门位置P7下方位置 " + updownPosition);
StoreMove.NextMoveStep(StoreMoveStep.SIS_31_ToDoor);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, updownPosition, Config.UpDownAxis_P7_Speed);
......@@ -410,9 +411,9 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_05 等待吸盘放下物品");
StoreMove.NextMoveStep(StoreMoveStep.SI_05_DoorWarToDevice);
// IOManager.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Air, IO_VALUE.LOW));
// IOManager.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Air, IO_VALUE.LOW));
AutomaticBaiting.CylinderMove(IO_Type.Clamping_Work, IO_Type.Clamping_Relax, StoreMove);
}
......@@ -437,20 +438,44 @@ namespace OnlineStore.DeviceLibrary
else
{
InStoreLog("入库:SI_07 叉子返回,进出轴至P1,检测料仓料盘检测信号 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor);
StoreMove.NextMoveStep(StoreMoveStep.SI_07_InoutToP1);
InOutBackToP1(moveP.InOut_P1);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
}
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_06_CompressWork)
{
InStoreLog("入库:SI_07 叉子返回,进出轴至P1 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor);
StoreMove.NextMoveStep(StoreMoveStep.SI_07_InoutToP1);
InOutBackToP1(moveP.InOut_P1);
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_07_DeviceBackFromDoor)
else if (StoreMove.MoveStep == StoreMoveStep.SI_07_InoutToP1)
{
if (Config.IsUse_Tray_Check.Equals(1))
{
StoreMove.NextMoveStep(StoreMoveStep.SI_071_CheckFixture);
InStoreLog("入库:SI_071_CheckFixture 进出轴到P1后,判断是否拿到物料 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
}
else
{
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
}
else
{
InStoreLog("入库:SI_08 定位气缸伸出 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_08_LocationCylinder_Up);
LocationUpAndWait();
}
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_071_CheckFixture)
{
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
......@@ -551,7 +576,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("送出料盘:SI_22 ,压紧轴到压紧前点 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_23_ComToP3);
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
//if (IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
//{
// InStoreLog("送出料盘:SI_22 ,打开仓门 ");
......@@ -584,7 +609,7 @@ namespace OnlineStore.DeviceLibrary
if (IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
InStoreLog("送出料盘:SI_13 叉子从库位返回,进出轴到P1(待机点) ");
CodeOrInoutMsg = "";
CodeOrInoutMsg = "";
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = "";
......@@ -623,14 +648,14 @@ namespace OnlineStore.DeviceLibrary
AutomaticBaiting.IsWaitTragGo = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
AutomaticBaiting.WaitIoValue = IO_VALUE.HIGH;
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_33_WaitTray))
{
//判断是否放入料盘
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
InStoreLog("入库:SI_13 单盘入库未放入料盘,关闭仓门,进出轴至P1(待机点) ");
InStoreLog("入库:SI_13 单盘入库未放入料盘,关闭仓门,进出轴至P1(待机点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_13_InoutBack);
CloseDoorAndWait();
InOutBackToP1(moveP.InOut_P1);
......@@ -641,7 +666,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SIS_34_GetTray);
CloseDoorAndWait();
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P4_Speed);
ComMoveToPosition(moveP.ComPress_P2,Config.CompAxis_P2_Speed);
ComMoveToPosition(moveP.ComPress_P2, Config.CompAxis_P2_Speed);
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_34_GetTray))
......@@ -676,7 +701,7 @@ namespace OnlineStore.DeviceLibrary
{
if (AutomaticBaiting.LastCode.Equals(""))
{
SingleSendOut("未扫到二维码");
SingleSendOut("未扫到二维码");
}
else
{
......@@ -686,15 +711,15 @@ namespace OnlineStore.DeviceLibrary
InOutStoreParam param = AutomaticBaiting.GetInStoreParam("单盘入库", AutomaticBaiting.ProcessMsg());
if (param == null)
{
SingleSendOut("从服务器获取入库信息失败");
SingleSendOut("从服务器获取入库信息失败");
}
else if (!LoadParamPosition(param))
{
SingleSendOut("加载入库" + param.PositionNum + "参数失败");
SingleSendOut("加载入库" + param.PositionNum + "参数失败");
}
else
{
LogUtil.info("单盘入库获取库位号成功:"+param.PositionNum+",叉子后退,开始入库");
LogUtil.info("单盘入库获取库位号成功:" + param.PositionNum + ",叉子后退,开始入库");
//更改当前入库参数
storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
......@@ -702,8 +727,8 @@ namespace OnlineStore.DeviceLibrary
//lastMoveType = StoreMoveType.InStore;
StoreMove.IsBatchInOutStore = true;
StoreMove.IsNeedInStore = true;
StoreMove.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor);
StoreMove.NextMoveStep(StoreMoveStep.SI_07_InoutToP1);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Position);
}
}
......@@ -724,19 +749,19 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("送出料盘:SI_21 ,升降轴到门口位置P7 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_21_DeviceToDoor);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_Door_P7, Config.UpDownAxis_P7_Speed);
}
}
}
private void SingleSendOut(string msg)
{
StoreMove.IsBatchInOutStore = true;
StoreMove.IsNeedInStore = false ;
InStoreLog( msg+",将料盘送出,叉子后退");
StoreMove.IsNeedInStore = false;
InStoreLog(msg + ",将料盘送出,叉子后退");
StoreMove.NextMoveStep(StoreMoveStep.SIS_41_StartSendTrayOut);
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Position);
}
#endregion
......@@ -764,35 +789,35 @@ namespace OnlineStore.DeviceLibrary
{
if (!LoadParamPosition(param))
{
UpdateInOutMsg(logMsg + "失败,找不到库位信息");
UpdateInOutMsg(logMsg + "失败,找不到库位信息");
return false;
}
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料");
UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料");
return false;
}
//若自动上料机构正在入库中,不可以出库
if (!AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing))
{
UpdateInOutMsg(logMsg + "失败,批量上下料机构不在空闲中");
UpdateInOutMsg(logMsg + "失败,批量上下料机构不在空闲中");
return false;
}
//判断批量上下料机构是否已经满
if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)&& IsBatchWork)
if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH) && IsBatchWork)
{
int currBatchValue = ACServerManager.GetActualtPosition(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue());
if (currBatchValue - param.MoveP.BatchAxis_DownValue < 1000)
{
UpdateInOutMsg(logMsg + "失败,批量上下料机构已满,请先拿出料盘");
UpdateInOutMsg(logMsg + "失败,批量上下料机构已满,请先拿出料盘");
return false;
}
}
int height = param.GetPosition().BagHeight;
if (AutomaticBaiting.BatchOutStoreHeight >= Config.BatchAxis_MaxHeight)
if (AutomaticBaiting.BatchOutStoreHeight >= Config.BatchAxis_MaxHeight)
{
LogUtil.error(LOGGER, StoreName + logMsg + " 出错,当前高【"+ AutomaticBaiting.BatchOutStoreHeight + "】出库料盘高【"+ height + "】,最大高【"+ Config.BatchAxis_MaxHeight + "】");
UpdateInOutMsg(logMsg + "失败,批量上下料机构已满,请先拿出料盘");
LogUtil.error(LOGGER, StoreName + logMsg + " 出错,当前高【" + AutomaticBaiting.BatchOutStoreHeight + "】出库料盘高【" + height + "】,最大高【" + Config.BatchAxis_MaxHeight + "】");
UpdateInOutMsg(logMsg + "失败,批量上下料机构已满,请先拿出料盘");
return false;
}
......@@ -818,7 +843,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
UpdateInOutMsg(logMsg + "失败,当前状态:"+storeRunStatus);
UpdateInOutMsg(logMsg + "失败,当前状态:" + storeRunStatus);
//LogUtil.error(LOGGER, StoreName + logMsg+ "出错,当前storeStatus=" + storeRunStatus);
return false;
}
......@@ -946,28 +971,50 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_08_ToDoorPosition)
{
if (Config.IsUse_Tray_Check.Equals(1))
{
StoreMove.NextMoveStep(StoreMoveStep.SO_09_CheckFixture);
OutStoreLog("出库:SO_09_CheckFixture 等待叉子料盘检测信号");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
}
else
{
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
SO_11_DeviceToDoorPro();
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_10_LocationCylinder_Down);
OutStoreLog("出库:SO_10 定位气缸退回 ");
LocationDownAndWait();
}
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_09_CheckFixture)
{
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
SO_10_DeviceToDoorPro();
SO_11_DeviceToDoorPro();
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_09_LocationCylinder_Down);
OutStoreLog("出库:SO_09 定位气缸退回 ");
StoreMove.NextMoveStep(StoreMoveStep.SO_10_LocationCylinder_Down);
OutStoreLog("出库:SO_10 定位气缸退回 ");
LocationDownAndWait();
}
}
//此处需要等待移栽没有工作,才能把盘放入出料口
else if (StoreMove.MoveStep == StoreMoveStep.SO_09_LocationCylinder_Down)
else if (StoreMove.MoveStep == StoreMoveStep.SO_10_LocationCylinder_Down)
{
SO_10_DeviceToDoorPro();
SO_11_DeviceToDoorPro();
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_10_DeviceToDoor)
else if (StoreMove.MoveStep == StoreMoveStep.SO_11_DeviceToDoor)
{
if (StoreMove.IsBatchInOutStore)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_11_PutTray);
OutStoreLog("出库:SO_11_PutTray 放下料盘,升降轴到P8(出库低点),压紧轴至P3(压紧前点)");
StoreMove.NextMoveStep(StoreMoveStep.SO_12_PutTray);
OutStoreLog("出库:SO_12_PutTray 放下料盘,升降轴到P8(出库低点),压紧轴至P3(压紧前点)");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_OutLow_P8, Config.UpDownAxis_P8_Speed);
AutomaticBaiting.BatchOutStoreHeight += StoreMove.MoveParam.PlateH;
......@@ -1003,7 +1050,7 @@ namespace OnlineStore.DeviceLibrary
CloseDoorAndWait();
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_11_PutTray)
else if (StoreMove.MoveStep == StoreMoveStep.SO_12_PutTray)
{
SO_13_InoutBack();
}
......@@ -1052,12 +1099,12 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog("出库:SO_02 批量上下料轴到P1点【" + Config.BatchAxis_P1 + "】速度【" + speed + "】 ");
}
//第一盘料先上升盘高,若检测信号不亮,则可以出库
//拿盘的同时 批量轴上升到检测信号亮,计算可用盘高=(位置-待机位)/系数
//批量轴下降指定的高度,开始放盘
//第一盘料先上升盘高,若检测信号不亮,则可以出库
//拿盘的同时 批量轴上升到检测信号亮,计算可用盘高=(位置-待机位)/系数
//批量轴下降指定的高度,开始放盘
//第二盘以后的料,若信号亮,先下降到信号不亮
//信号不亮,批量轴下降指定的位置
//第二盘以后的料,若信号亮,先下降到信号不亮
//信号不亮,批量轴下降指定的位置
}
......@@ -1118,7 +1165,7 @@ namespace OnlineStore.DeviceLibrary
{
OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点),等待吸盘处于上升端 ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_Door_P7, Config.UpDownAxis_P7_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
//此处需要等待吸盘在上升位置
IOManager.IOMove(IO_Type.ClampingDisc_Up, IO_VALUE.HIGH);
......@@ -1126,30 +1173,31 @@ namespace OnlineStore.DeviceLibrary
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Down, IO_VALUE.LOW));
}
private void SO_10_DeviceToDoorPro()
private void SO_11_DeviceToDoorPro()
{
LineMoveP moveP = StoreMove.MoveParam.MoveP;
StoreMove.NextMoveStep(StoreMoveStep.SO_10_DeviceToDoor);
StoreMove.NextMoveStep(StoreMoveStep.SO_11_DeviceToDoor);
if (StoreMove.IsBatchInOutStore)
{
OutStoreLog("出库:SO_10 叉子进出料口,进出轴至P2(进料口吸盘取料点) ");
OutStoreLog("出库:SO_11 叉子进出料口,进出轴至P2(进料口吸盘取料点) ");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
}
else
{
OutStoreLog("出库:SO_10 叉子进出料口,进出轴至P4(仓门出料点) ");
OutStoreLog("出库:SO_11 叉子进出料口,进出轴至P4(仓门出料点) ");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P4, Config.InOutAxis_P2_Speed);
}
}
}
#endregion
public bool SupportBatch(string posId)
public bool SupportBatch(string posId)
{
AutoStorePosition position= CSVPositionReader<AutoStorePosition>.GetPositon(posId);
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
if (position != null && position.SupportBatch.Equals(1))
{
return true;
}else
}
else
{
return false;
}
......@@ -1228,7 +1276,7 @@ namespace OnlineStore.DeviceLibrary
if (PositionNumList.Count > autoPositionIndex)
{
posid = PositionNumList[autoPositionIndex];
autoMsg = ResourceControl.GetString("自动入库", "自动入库") + ":" +posid;
autoMsg = ResourceControl.GetString("自动入库", "自动入库") + ":" + posid;
//到下一个库位
if (isNext)
{
......@@ -1249,8 +1297,8 @@ namespace OnlineStore.DeviceLibrary
{
CurrInOutCount++;
CurrInOutACount++;
if (CycleOut&& storeMoveType.Equals(StoreMoveType.OutStore))
if (CycleOut && storeMoveType.Equals(StoreMoveType.OutStore))
{
AutomaticBaiting.ClearOutStoreInfo();
FixtureCodeInfo currInOutFixture = new FixtureCodeInfo(0, "", CyclePosId);
......@@ -1281,7 +1329,7 @@ namespace OnlineStore.DeviceLibrary
#region 循环出入库功能
public bool CycleOut = false;
public string CyclePosId = "";
public string CyclePosId = "";
#endregion
}
}
using log4net;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
......@@ -9,11 +9,11 @@ using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
{
/// <summary>
/// 等待启动/已经停止,初始化完成, 正常运行中,可以进行新的处理,忙碌,重置
/// </summary>
......@@ -31,7 +31,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 设备正在重置中,请稍后
/// </summary>
Reset = 2,
Reset = 2,
/// <summary>
/// 正常运行中,可以进行新的处理
/// </summary>
......@@ -61,7 +61,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
///2=急停中
/// </summary>
SuddenStop = 2,
SuddenStop = 2,
/// <summary>
/// 3=故障中
/// </summary>
......@@ -73,15 +73,15 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 5=设备调试中
/// </summary>
Debugging = 5,
Debugging = 5,
/// <summary>
/// 6=入库执行中
/// </summary>
InStoreExecute = 6,
InStoreExecute = 6,
/// <summary>
/// 7= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
/// </summary>
InStoreEnd = 7,
InStoreEnd = 7,
/// <summary>
/// 8=入库失败
/// </summary>
......@@ -105,20 +105,20 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 13=重置中(原点返回和重置都发此状态)
/// </summary>
ResetMove=13,
ResetMove = 13,
/// <summary>
/// 14=批量上料中
/// </summary>
BatchInStore=14,
BatchInStore = 14,
/// <summary>
///15= 扫码失败或无库位料盘送出
/// </summary>
SendTrayOut=15,
SendTrayOut = 15,
/// <summary>
/// 16=批量上料模块复位中
/// </summary>
BatchReset=16,
BatchReset = 16,
}
/// <summary>
......@@ -134,17 +134,17 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料仓原点返回和重置步骤,,定位气缸下降
/// </summary>
BOX_H_LocationCylinderBack=010,
BOX_H_LocationCylinderBack = 010,
/// <summary>
/// 料仓原点返回和重置步骤,轴三先相对走3000
/// </summary>
BOX_H_InOutMove=011,
BOX_H_InOutMove = 011,
/// <summary>
/// 料仓原点返回和重置步骤,,轴三进出轴先返回原点
/// </summary>
BOX_H_InOutBack = 012,
/// <summary>
/// 料仓原点返回和重置步骤,,轴三返回P1点
/// </summary>
......@@ -160,12 +160,12 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 旋转轴返回P1
/// </summary>
BOX_H_MiddleAxisToP1=016,
BOX_H_MiddleAxisToP1 = 016,
/// <summary>
/// 叉子先退回P1
/// </summary>
BOX_M_H_InOutToP1=018,
BOX_M_H_InOutToP1 = 018,
/// <summary>
/// 旋转轴回原点
/// </summary>
......@@ -204,7 +204,7 @@ namespace OnlineStore.DeviceLibrary
/// 复位时清料:叉子后退,关闭舱门
/// </summary>
BOX_R44_GoBack = 044,
#endregion
......@@ -213,7 +213,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
///料仓出库,,定位气缸下降
/// </summary>
SO_01_LocationCylinderDown =101,
SO_01_LocationCylinderDown = 101,
/// <summary>
///料仓出库:叉子先运动到P1
/// </summary>
......@@ -249,14 +249,19 @@ namespace OnlineStore.DeviceLibrary
SO_08_ToDoorPosition = 108,
/// <summary>
/// 到达门口后,判断叉子料盘检测信号
/// </summary>
SO_09_CheckFixture,
/// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary>
SO_09_LocationCylinder_Down = 109,
SO_10_LocationCylinder_Down,
/// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
SO_10_DeviceToDoor = 110,
SO_11_DeviceToDoor,
///// <summary>
///// 料仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
///// </summary>
......@@ -269,23 +274,23 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料仓出库,升降轴下降,压紧轴放松
/// </summary>
SO_11_PutTray = 111,
SO_12_PutTray,
/// <summary>
/// 叉子返回待机位
/// </summary>
SO_13_InoutBack=112,
SO_13_InoutBack,
/// <summary>
/// 等待拿走物品
/// </summary>
SO_14_WaitTake=114,
SO_14_WaitTake,
/// <summary>
/// 升降轴走到门口位置
/// </summary>
SO_21_OpenDoor=121,
SO_21_OpenDoor = 121,
/// <summary>
/// 等待操作人员拿走料盘
/// </summary>
SO_22_WaitTrayGo=122,
SO_22_WaitTrayGo = 122,
///// <summary>
......@@ -321,11 +326,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 入库检测
/// </summary>
SI_00_TrayCheck =200,
SI_00_TrayCheck = 200,
/// <summary>
/// 入库,。定位气缸下降
/// </summary>
SI_01_LocationCylinderDown=201,
SI_01_LocationCylinderDown = 201,
/// <summary>
/// 入库。。进出轴(叉子)先返回P1
/// </summary>
......@@ -334,7 +339,7 @@ namespace OnlineStore.DeviceLibrary
/// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
/// </summary>
SI_03_ReturnHome = 203,
/// <summary>
/// 入库。。叉子进入入料口,轴3( 叉子) 至P2( 进料口取料点)
/// </summary>
......@@ -351,12 +356,16 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 压紧轴压紧后,升降轴稍微下降之后叉子再后退
/// </summary>
SI_061_UpdownAxisDown=215,
SI_061_UpdownAxisDown = 215,
/// <summary>
/// 入库。。叉子 从入料口抽出,轴3( 叉子) 至P1( 待机点)
/// </summary>
SI_07_DeviceBackFromDoor = 207,
SI_07_InoutToP1 = 207,
/// <summary>
/// 拿到料盘后判断叉子料盘检测信号
/// </summary>
SI_071_CheckFixture = 216,
/// <summary>
/// 入库。。,定位气缸伸出 (有压紧轴的不需要此步骤)
/// </summary>
......@@ -387,11 +396,11 @@ namespace OnlineStore.DeviceLibrary
SI_14_GoBack = 214,
/// <summary>
/// 入库未取到PosID,,升降轴到门口, 打开仓门
/// </summary>
SI_21_DeviceToDoor= 221,
SI_21_DeviceToDoor = 221,
/// <summary>
/// 入库未取到PosID,叉子走到门口位置, 打开仓门
/// </summary>
......@@ -400,7 +409,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 压紧轴走到压紧前点
/// </summary>
SI_23_ComToP3=223,
SI_23_ComToP3 = 223,
/// <summary>
///入库未取到PosID,, 打开仓门
/// </summary>
......@@ -423,11 +432,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 单盘入库:等待操作人员放入料盘
/// </summary>
SIS_33_WaitTray= 303,
SIS_33_WaitTray = 303,
/// <summary>
/// 单盘入库:确认放入料盘,关闭仓门,升降轴走 到P7,压紧轴压紧
/// </summary>
SIS_34_GetTray= 304,
SIS_34_GetTray = 304,
/// <summary>
/// 单盘入库:确认放入料盘,关闭仓门,进出轴后退到P1
/// </summary>
......@@ -446,7 +455,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 单盘入库:扫码
/// </summary>
SIS_38_ScanCode =308,
SIS_38_ScanCode = 308,
/// <summary>
/// 单盘入库:获取入库库位号
......@@ -456,12 +465,12 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 单盘入库:启动新的入库
/// </summary>
SIS_40_StartInStore= 340,
SIS_40_StartInStore = 340,
/// <summary>
/// 单盘入库:开始送出料盘
/// </summary>
SIS_41_StartSendTrayOut= 341,
SIS_41_StartSendTrayOut = 341,
#endregion
......@@ -470,7 +479,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 开始复位
/// </summary>
AUTO_R00_Start =1100,
AUTO_R00_Start = 1100,
/// <summary>
/// 关闭门锁
/// </summary>
......@@ -487,11 +496,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 上料轴返回0点
/// </summary>
AUTO_R04_AutoBack=1104,
AUTO_R04_AutoBack = 1104,
/// <summary>
/// 上料轴移动到待机点
/// </summary>
AUTO_R05_ToP2=1105,
AUTO_R05_ToP2 = 1105,
#endregion
......@@ -500,52 +509,52 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 开始自动上料
/// </summary>
AUTO_I01_Wait=1201,
AUTO_I01_Wait = 1201,
/// <summary>
/// 先上升到料盘检测1(上料机构)信号亮
/// </summary>
AUTO_I02_MoveToUp=1202,
AUTO_I02_MoveToUp = 1202,
/// <summary>
/// 扫码
/// </summary>
AUTO_I03_ScanCode=1203,
AUTO_I03_ScanCode = 1203,
/// <summary>
/// 吸盘下降
/// </summary>
AUTO_I04_SuckingDisc_Down=1204,
AUTO_I04_SuckingDisc_Down = 1204,
/// <summary>
/// 吸盘吸料盘
/// </summary>
AUTO_I05_SuckingDisc_Work=1205,
AUTO_I05_SuckingDisc_Work = 1205,
/// <summary>
/// 吸盘上升 ,
/// </summary>
AUTO_I06_SuckingDisc_Up=1206,
AUTO_I06_SuckingDisc_Up = 1206,
/// <summary>
/// 批量上下料料轴上升
/// </summary>
AUTO_I07_BatchAxisUp=1207,
AUTO_I07_BatchAxisUp = 1207,
/// <summary>
/// 从服务器获取PosID
/// </summary>
AUTO_I08_GetPosId=1208,
AUTO_I08_GetPosId = 1208,
/// <summary>
/// 等待料盘被叉子拿走
/// </summary>
AUTO_I09_WaitTrayLeave=1209,
AUTO_I09_WaitTrayLeave = 1209,
/// <summary>
/// 未扫到码:等待操作人员拿走料盘
/// </summary>
AUTO_I10_WaitTrayGo=1210,
AUTO_I10_WaitTrayGo = 1210,
/// <summary>
/// 批量上下轴开始回原点
/// </summary>
AUTO_I11_BatchAxisHome=1211,
AUTO_I11_BatchAxisHome = 1211,
......@@ -554,38 +563,38 @@ namespace OnlineStore.DeviceLibrary
#region 自动上下料出料功能
AUTO_O00_Wait=1300,
AUTO_O00_Wait = 1300,
/// <summary>
/// 批量轴先匀速下降到X12不亮
/// </summary>
AUTO_O01_BatchAxisDown=1301,
AUTO_O01_BatchAxisDown = 1301,
/// <summary>
/// 打开门锁
/// </summary>
AUTO_O02_WaitDoorOpen =1302,
AUTO_O02_WaitDoorOpen = 1302,
/// <summary>
/// 等待出料检测信号关闭
/// </summary>
AUTO_O03_WaitOutSingleLow=1303,
AUTO_O03_WaitOutSingleLow = 1303,
/// <summary>
/// 向上运动,等待DI12亮或者极限亮停止
/// </summary>
AUTO_O04_SpeedMove=1304,
AUTO_O04_SpeedMove = 1304,
/// <summary>
/// 极限亮,返回P2点
/// </summary>
AUTO_O08_BackToP2=1308,
AUTO_O08_BackToP2 = 1308,
/// <summary>
/// 等待X12灭
/// </summary>
AUTO_O06_WaitDI12Low=1306,
AUTO_O06_WaitDI12Low = 1306,
/// <summary>
/// 等待1秒钟后在下降
/// </summary>
AUTO_O07_WaitDown=1307,
AUTO_O07_WaitDown = 1307,
#endregion
}
......@@ -599,7 +608,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 轴报警
/// </summary>
AxisAlarm = 1,
AxisAlarm = 1,
/// <summary>
/// 收到急停
/// </summary>
......@@ -624,11 +633,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 批量上下料模块报警
/// </summary>
BatchAlarm =110,
BatchAlarm = 110,
/// <summary>
/// 批量上下轴报警
/// </summary>
BatchAxisAlarm=120,
BatchAxisAlarm = 120,
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!