Commit 36a8cd24 LN

1

1 个父辈 10e6ad23
...@@ -20,7 +20,8 @@ namespace OnlineStore.Common ...@@ -20,7 +20,8 @@ namespace OnlineStore.Common
public static MyConfig<string> App_Title="出库机构"; public static MyConfig<string> App_Title="出库机构";
[MyConfigComment("服务器地址")] [MyConfigComment("服务器地址")]
public static MyConfig<string> Device_Server_Address = "http://192.168.1.243/smf-core"; public static MyConfig<string> Device_Server_Address = "";
//public static MyConfig<string> Device_Server_Address = "http://192.168.1.243/smf-core";
[MyConfigComment("设备界面语言")] [MyConfigComment("设备界面语言")]
public static MyConfig<string> Device_Default_Language = "zh-CN"; public static MyConfig<string> Device_Default_Language = "zh-CN";
...@@ -66,8 +67,9 @@ namespace OnlineStore.Common ...@@ -66,8 +67,9 @@ namespace OnlineStore.Common
public static MyConfig<bool> Runtime_IsInStore; public static MyConfig<bool> Runtime_IsPutReel;
public static MyConfig<string> Runtime_PosID; public static MyConfig<string> Runtime_StartPosID;
public static MyConfig<string> Runtime_TargetPosID;
public static MyConfig<string> Runtime_WareCode; public static MyConfig<string> Runtime_WareCode;
public static MyConfig<int> Runtime_PlateW; public static MyConfig<int> Runtime_PlateW;
public static MyConfig<int> Runtime_PlateH; public static MyConfig<int> Runtime_PlateH;
......
...@@ -253,7 +253,7 @@ namespace DeviceLibrary ...@@ -253,7 +253,7 @@ namespace DeviceLibrary
} }
else else
{ {
bitmapfilename = SaveImageToFile("mimo", cameraName, bmp); bitmapfilename = SaveImageToFile("outBound", cameraName, bmp);
} }
LogUtil.info(" 【" + cameraName + "】" + " 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r); LogUtil.info(" 【" + cameraName + "】" + " 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r);
} }
...@@ -325,9 +325,16 @@ namespace DeviceLibrary ...@@ -325,9 +325,16 @@ namespace DeviceLibrary
{ {
Directory.CreateDirectory(dire); Directory.CreateDirectory(dire);
} }
bitmap.Save(dire + iamgeName, ImageFormat.Bmp); if (!canSavePic(dire))
//bitmap.Dispose(); {
LogUtil.info(deviceName + " 【" + cameraName + "】扫码完成,保存图片到【" + dire + iamgeName + "】成功"); CodeManager. DeleteOldFiles(dire,7);
}
if (canSavePic(dire))
{
bitmap.Save(dire + iamgeName, ImageFormat.Bmp);
//bitmap.Dispose();
LogUtil.info(deviceName + " 【" + cameraName + "】扫码完成,保存图片到【" + dire + iamgeName + "】成功");
}
} }
catch (Exception ex) catch (Exception ex)
...@@ -399,5 +406,78 @@ namespace DeviceLibrary ...@@ -399,5 +406,78 @@ namespace DeviceLibrary
return ""; return "";
} }
} }
//public static bool record = false;//是否保存结果图片
public static bool canSavePic(string path = "")
{
if (path == "")
{
path = "D:\\CameraDebug\\";
}
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string volume = path.Substring(0, path.IndexOf(':'));
long freespace = GetHardDiskSpace(volume);
int zhao = (int)(freespace / 1024);
if (zhao < 5)
{
LogUtil.error(volume + "盘剩余空间:" + freespace + "G, 不再保存识别图片");
return false;
}
return true;
}
private static long GetHardDiskSpace(string str_HardDiskName)
{
long totalSize = 0;
str_HardDiskName = str_HardDiskName + ":\\";
System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives();
foreach (System.IO.DriveInfo drive in drives)
{
if (drive.Name == str_HardDiskName)
{
totalSize = drive.TotalFreeSpace / (1024 * 1024);
}
}
return totalSize;
}
/// <summary>
/// 删除文件夹strDir中nDays天以前的文件
/// </summary>
/// <param name="dir"></param>
/// <param name="days"></param>
static void DeleteOldFiles(string path = "", int days = 7)
{
if (path == "")
{
path = "D:\\CameraDebug\\";
}
try
{
LogUtil.info($"DeleteOldFiles 开始删除文件夹[{path}][{days}]天前的文件");
if (!Directory.Exists(path) || days < 1) return;
var now = DateTime.Now;
foreach (var f in Directory.GetFileSystemEntries(path).Where(f => File.Exists(f)))
{
DateTime createTime = File.GetCreationTime(f);
var elapsedTicks = now.Ticks - createTime.Ticks;
var elapsedSpan = new TimeSpan(elapsedTicks);
if (elapsedSpan.TotalDays > days)
{
File.Delete(f);
LogUtil.info($"DeleteOldFiles 删除文件: {f} ");
}
}
}
catch (Exception ex)
{
LogUtil.error($"DeleteOldFiles {path} {days} error :" + ex.ToString());
}
}
} }
} }
...@@ -144,7 +144,14 @@ namespace DeviceLibrary ...@@ -144,7 +144,14 @@ namespace DeviceLibrary
} }
return -1; return -1;
} }
/// <summary>
/// 放料到料架完成通知
/// </summary>
/// <param name="rfid"></param>
/// <param name="barcode"></param>
/// <param name="rfidLoc"></param>
/// <param name="robotIndex"></param>
/// <returns></returns>
public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "", string robotIndex = "1") public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "", string robotIndex = "1")
{ {
ShelfTaskInfo task = new ShelfTaskInfo(); ShelfTaskInfo task = new ShelfTaskInfo();
...@@ -193,7 +200,13 @@ namespace DeviceLibrary ...@@ -193,7 +200,13 @@ namespace DeviceLibrary
return task; return task;
} }
/// <summary>
/// 根据条码获取位置
/// </summary>
/// <param name="barcode"></param>
/// <param name="currRFID"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static TrayInfo GetLocation(string barcode, string currRFID, out string msg) public static TrayInfo GetLocation(string barcode, string currRFID, out string msg)
{ {
//getLocation这个接口传入barcode和rfid列表会分配料架 //getLocation这个接口传入barcode和rfid列表会分配料架
......
...@@ -74,25 +74,25 @@ public class ReelParam ...@@ -74,25 +74,25 @@ public class ReelParam
/// 物料编码 /// 物料编码
/// </summary> /// </summary>
public string PN { get; set; } public string PN { get; set; }
/// <summary> ///// <summary>
/// 数量 ///// 数量
/// </summary> ///// </summary>
public int QTY { get; set; } = 0; //public int QTY { get; set; } = 0;
/// <summary> ///// <summary>
/// 厂家代码 ///// 厂家代码
/// </summary> ///// </summary>
public string FC { get; set; } //public string FC { get; set; }
/// <summary> ///// <summary>
/// 唯一序列号 ///// 唯一序列号
/// </summary> ///// </summary>
public string RI { get; set; } //public string RI { get; set; }
public string DC { get; set; } //public string DC { get; set; }
/// <summary> ///// <summary>
/// 批次号 ///// 批次号
/// </summary> ///// </summary>
public string Batch { get; set; } //public string Batch { get; set; }
public string cid { get; set; } //public string cid { get; set; }
public string SubCID { get; set; } //public string SubCID { get; set; }
...@@ -145,18 +145,14 @@ public class ReelParam ...@@ -145,18 +145,14 @@ public class ReelParam
if (!File.Exists(countfile)) if (!File.Exists(countfile))
{ {
StreamWriter sw1 = new StreamWriter(countfile, true, Encoding.GetEncoding("GB2312")); StreamWriter sw1 = new StreamWriter(countfile, true, Encoding.GetEncoding("GB2312"));
sw1.WriteLine($"WareCode,SN,PN,Date,NgMsg"); sw1.WriteLine($"WareCode,StartPos,TargetPos,TargetOutShelf,TargetLoc,Date,NgMsg");
sw1.Close(); sw1.Close();
sw1.Dispose(); sw1.Dispose();
} }
try try
{ {
var sw = new StreamWriter(countfile, true, Encoding.GetEncoding("GB2312")); var sw = new StreamWriter(countfile, true, Encoding.GetEncoding("GB2312"));
//var sw = File.Open(countfile, FileMode.Append, FileAccess.Write); sw.WriteLine($"{WareCode},{StartPos},{TargetPos},{TargetOutShelf},{TargetLoc},{datetime:yyyy/MM/dd HH:mm:ss},{NgMsg}");
// string s = $"\r\n{ReeID},{PN},{PlateW}x{PlateH},{ReelDest},{NgMsg},{QTY},{WareCode}";
//var b = Encoding.GetEncoding("gb2312").GetBytes(s);
//sw.Write(b, 0, b.Length);
sw.WriteLine($"{WareCode},{RI},{PN},{datetime:yyyy/MM/dd HH:mm:ss},{NgMsg}");
sw.Close(); sw.Close();
sw.Dispose(); sw.Dispose();
} }
......
...@@ -45,6 +45,7 @@ namespace DeviceLibrary ...@@ -45,6 +45,7 @@ namespace DeviceLibrary
} }
private void ServerConnectTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void ServerConnectTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
return;
//if (!Monitor.TryEnter(serverConnectTimer)) //if (!Monitor.TryEnter(serverConnectTimer))
//{ //{
// LogUtil.error("ServerConnectTimer_Elapsed locked"); // LogUtil.error("ServerConnectTimer_Elapsed locked");
......
...@@ -216,81 +216,81 @@ namespace DeviceLibrary ...@@ -216,81 +216,81 @@ namespace DeviceLibrary
pnreglist = File.ReadAllLines("config\\pn.list").ToList().FindAll((s) => { return !string.IsNullOrWhiteSpace(s); }).ToArray(); pnreglist = File.ReadAllLines("config\\pn.list").ToList().FindAll((s) => { return !string.IsNullOrWhiteSpace(s); }).ToArray();
qtyreglist = File.ReadAllLines("config\\qty.list").ToList().FindAll((s) => { return !string.IsNullOrWhiteSpace(s); }).ToArray(); qtyreglist = File.ReadAllLines("config\\qty.list").ToList().FindAll((s) => { return !string.IsNullOrWhiteSpace(s); }).ToArray();
} }
public static bool codeProcess(ReelParam labelParam,out string debugmsg) { //public static bool codeProcess(ReelParam labelParam,out string debugmsg) {
if (pnreglist == null) // if (pnreglist == null)
LoadMatchList(); // LoadMatchList();
debugmsg = ""; // debugmsg = "";
List<CodeInfo> newcodeInfos = new List<CodeInfo>(); // List<CodeInfo> newcodeInfos = new List<CodeInfo>();
labelParam.PN = ""; // labelParam.PN = "";
foreach (var ci in labelParam.codeInfos.ToArray()) // foreach (var ci in labelParam.codeInfos.ToArray())
{ // {
//string[] pnreglist = new string[] { // //string[] pnreglist = new string[] {
// @"^P([1-9]\d+)$", // // @"^P([1-9]\d+)$",
// @"^(\d+)$%Code 128", // // @"^(\d+)$%Code 128",
// @"^([1-9]\d{7,9})$" // // @"^([1-9]\d{7,9})$"
//}; // //};
foreach (var qtyreg in pnreglist) // foreach (var qtyreg in pnreglist)
{ // {
var partrules = qtyreg.Split('%'); // var partrules = qtyreg.Split('%');
if (partrules.Length == 2) { // if (partrules.Length == 2) {
if (ci.CodeType != partrules[1]) // if (ci.CodeType != partrules[1])
break; // break;
} // }
var m = Regex.Match(ci.CodeStr, partrules[0]); // var m = Regex.Match(ci.CodeStr, partrules[0]);
if (m.Success) // if (m.Success)
{ // {
newcodeInfos.Add(ci); // newcodeInfos.Add(ci);
//labelParam.codeInfos.Remove(ci); // //labelParam.codeInfos.Remove(ci);
labelParam.PN = m.Groups[1].Value; // labelParam.PN = m.Groups[1].Value;
debugmsg += $"匹配到PN:{labelParam.PN}\r\n命中规则:{qtyreg}\r\n"; // debugmsg += $"匹配到PN:{labelParam.PN}\r\n命中规则:{qtyreg}\r\n";
break; // break;
} // }
} // }
if (!string.IsNullOrEmpty(labelParam.PN)) // if (!string.IsNullOrEmpty(labelParam.PN))
break; // break;
} // }
labelParam.QTY = 0; // labelParam.QTY = 0;
foreach (var ci in labelParam.codeInfos.ToArray()) // foreach (var ci in labelParam.codeInfos.ToArray())
{ // {
//string[] qtyreglist = new string[] { // //string[] qtyreglist = new string[] {
// @"Q(\d{3,5})[^\d]", // // @"Q(\d{3,5})[^\d]",
// @"^Q(\d{3,5})$", // // @"^Q(\d{3,5})$",
// @"^\w+\.\d([1-9]+0+)[1-9]+\d*$", // // @"^\w+\.\d([1-9]+0+)[1-9]+\d*$",
// @"^.+?;.+?;.+?;(\d{3,5}?);.+?;.+?$", // // @"^.+?;.+?;.+?;(\d{3,5}?);.+?;.+?$",
// @"^QUANTITY:(\d*)", // // @"^QUANTITY:(\d*)",
// @"^(\d{6})\s", // // @"^(\d{6})\s",
// @"\(\w*\s+(\d+)[a-zA-Z]", // // @"\(\w*\s+(\d+)[a-zA-Z]",
//}; // //};
foreach (var qtyreg in qtyreglist) // foreach (var qtyreg in qtyreglist)
{ // {
var m = Regex.Match(ci.CodeStr, qtyreg); // var m = Regex.Match(ci.CodeStr, qtyreg);
if (m.Success) // if (m.Success)
{ // {
newcodeInfos.Add(ci); // newcodeInfos.Add(ci);
//labelParam.codeInfos.Remove(ci); // //labelParam.codeInfos.Remove(ci);
labelParam.QTY = int.Parse(m.Groups[1].Value); // labelParam.QTY = int.Parse(m.Groups[1].Value);
debugmsg += $"匹配到QTY:{labelParam.QTY}\r\n命中规则:{qtyreg}\r\n"; // debugmsg += $"匹配到QTY:{labelParam.QTY}\r\n命中规则:{qtyreg}\r\n";
break; // break;
} // }
} // }
if (labelParam.QTY > 0) // if (labelParam.QTY > 0)
break; // break;
} // }
if (string.IsNullOrEmpty(labelParam.PN) || labelParam.QTY == 0) // if (string.IsNullOrEmpty(labelParam.PN) || labelParam.QTY == 0)
return false; // return false;
//labelParam.codeInfos = newcodeInfos; // //labelParam.codeInfos = newcodeInfos;
labelParam.FC = "985022"; // labelParam.FC = "985022";
labelParam.RI = "AL"+DateTime.Now.ToString("yyMMddHHmmssf"); // labelParam.RI = "AL"+DateTime.Now.ToString("yyMMddHHmmssf");
labelParam.Batch = DateTime.Now.ToString("MMdd"); // labelParam.Batch = DateTime.Now.ToString("MMdd");
labelParam.WareCode = labelParam.RI; // labelParam.WareCode = labelParam.RI;
LogUtil.info($"匹配成功:{labelParam.PN},{labelParam.QTY},{labelParam.RI}"); // LogUtil.info($"匹配成功:{labelParam.PN},{labelParam.QTY},{labelParam.RI}");
return true; // return true;
} //}
public T DeepClone<T>(T _object) public T DeepClone<T>(T _object)
{ {
T dstobject; T dstobject;
......
...@@ -150,9 +150,22 @@ namespace DeviceLibrary ...@@ -150,9 +150,22 @@ namespace DeviceLibrary
if (Name.Contains("1")) if (Name.Contains("1"))
{ {
cameraName = Setting_Init.CameraScan_IN_1; cameraName = Setting_Init.CameraScan_IN_1;
} }
LastCode= CodeManager.CameraScan(cameraName.ToList()); //循环扫码,扫到条码才进入下一步
MoveInfo.log("扫码完成:"); while (MoveInfo.MoveStep.Equals(MoveStep.IN02_ScanCode))
{
LastCode = CodeManager.CameraScan(cameraName.ToList());
if (LastCode.Count > 0)
{
MoveInfo.log("扫码完成:"+CodeManager.ProcessCode(LastCode));
}
else
{
SetWarnMsg($"{Name}: 扫码失败");
MoveInfo.errlog("扫码失败 , 等待3秒后重新扫码");
Thread.Sleep(1000);
}
}
}); });
} }
catch (Exception ex) catch (Exception ex)
...@@ -175,7 +188,7 @@ namespace DeviceLibrary ...@@ -175,7 +188,7 @@ namespace DeviceLibrary
{ {
MoveInfo.log("获取库位号: " + codestr); MoveInfo.log("获取库位号: " + codestr);
GetPosTask = Task.Factory.StartNew(delegate GetPosTask = Task.Factory.StartNew(delegate
{ {
while (MoveInfo.MoveStep.Equals(MoveStep.IN03_GetPos)) while (MoveInfo.MoveStep.Equals(MoveStep.IN03_GetPos))
{ {
string shelfRfid = RobotManage.mainMachine.getReadyShelf(); string shelfRfid = RobotManage.mainMachine.getReadyShelf();
......
...@@ -70,7 +70,7 @@ namespace DeviceLibrary ...@@ -70,7 +70,7 @@ namespace DeviceLibrary
Reel = reel.clone(); Reel = reel.clone();
LogUtil.info($"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({BagHigh}-{70}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={ReelHeight},{JsonHelper.SerializeObject(this)}"); LogUtil.info($"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({BagHigh}-{70}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={ReelHeight},{JsonHelper.SerializeObject(this)}");
} }
public const string ngdoor = "单料口"; //public const string ngdoor = "单料口";
public static BoxStorePosition GetFixPos(Robot_Config Config, ReelParam reel) { public static BoxStorePosition GetFixPos(Robot_Config Config, ReelParam reel) {
var fixpos = "fix#" + reel.PlateW.ToString(); var fixpos = "fix#" + reel.PlateW.ToString();
......
...@@ -242,7 +242,7 @@ namespace DeviceLibrary ...@@ -242,7 +242,7 @@ namespace DeviceLibrary
case MoveStep.A07_NextPos: case MoveStep.A07_NextPos:
if (boxTransport.IsComplateOrFree) if (boxTransport.IsComplateOrFree)
{ {
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn08); AIOTMoveInfo.NextMoveStep(MoveStep.A8_WaitPosEnd);
if (CurrentPosIndex - 2 < 0 || StopAutoInOut) if (CurrentPosIndex - 2 < 0 || StopAutoInOut)
{ {
AIOTMoveInfo.log($"A已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口"); AIOTMoveInfo.log($"A已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口");
...@@ -263,7 +263,7 @@ namespace DeviceLibrary ...@@ -263,7 +263,7 @@ namespace DeviceLibrary
AIOTMoveInfo.log($"开始交替:【{ac1.PositionNum}】->【{ac2.PositionNum}】"); AIOTMoveInfo.log($"开始交替:【{ac1.PositionNum}】->【{ac2.PositionNum}】");
} }
break; break;
case MoveStep.StoreIn08: case MoveStep.A8_WaitPosEnd:
if (boxTransport.IsComplateOrFree) if (boxTransport.IsComplateOrFree)
{ {
AIOTMoveInfo.log($"料盘已到达目的地"); AIOTMoveInfo.log($"料盘已到达目的地");
...@@ -279,7 +279,7 @@ namespace DeviceLibrary ...@@ -279,7 +279,7 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.A10_LastPos: case MoveStep.A10_LastPos:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut11); AIOTMoveInfo.NextMoveStep(MoveStep.A11_R1StartBack);
CurrentPosIndex--; CurrentPosIndex--;
CurrStartPos = GetAutoStartPos(1); CurrStartPos = GetAutoStartPos(1);
ACStorePosition start1 = RobotManage.allPositionMap[CurrStartPos]; ACStorePosition start1 = RobotManage.allPositionMap[CurrStartPos];
...@@ -294,24 +294,24 @@ namespace DeviceLibrary ...@@ -294,24 +294,24 @@ namespace DeviceLibrary
} }
AIOTMoveInfo.log($"开始运送料盘【{ac.PositionNum}】->【{start1.PositionNum}】"); AIOTMoveInfo.log($"开始运送料盘【{ac.PositionNum}】->【{start1.PositionNum}】");
break; break;
case MoveStep.StoreOut11: case MoveStep.A11_R1StartBack:
if (boxTransport.IsPutOnOut) if (boxTransport.IsPutOnOut)
{ {
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut12); AIOTMoveInfo.NextMoveStep(MoveStep.A12_WR1End);
AIOTMoveInfo.log($"料盘已到达目的地"); AIOTMoveInfo.log($"料盘已到达目的地");
//AutoInOutTest = false; //AutoInOutTest = false;
} }
break; break;
case MoveStep.StoreOut12: case MoveStep.A12_WR1End:
if (boxTransport.IsComplateOrFree) if (boxTransport.IsComplateOrFree)
{ {
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut13); AIOTMoveInfo.NextMoveStep(MoveStep.A13_R1End);
AIOTMoveInfo.log($"料盘已到取走"); AIOTMoveInfo.log($"料盘已到取走");
//AutoInOutTest = false; //AutoInOutTest = false;
} }
break; break;
case MoveStep.StoreOut13: case MoveStep.A13_R1End:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut15); AIOTMoveInfo.NextMoveStep(MoveStep.A15_StartR2Back);
CurrStartPos = GetAutoStartPos(2); CurrStartPos = GetAutoStartPos(2);
ACStorePosition start2 = RobotManage.allPositionMap[CurrStartPos]; ACStorePosition start2 = RobotManage.allPositionMap[CurrStartPos];
ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex - 1]; ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex - 1];
...@@ -325,14 +325,14 @@ namespace DeviceLibrary ...@@ -325,14 +325,14 @@ namespace DeviceLibrary
} }
AIOTMoveInfo.log($"开始运送料盘【{ac.PositionNum}】->【{start2.PositionNum}】"); AIOTMoveInfo.log($"开始运送料盘【{ac.PositionNum}】->【{start2.PositionNum}】");
break; break;
case MoveStep.StoreOut15: case MoveStep.A15_StartR2Back:
if (boxTransport.IsPutOnOut) if (boxTransport.IsPutOnOut)
{ {
AIOTMoveInfo.log($"料盘已到达目的地"); AIOTMoveInfo.log($"料盘已到达目的地");
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut16); AIOTMoveInfo.NextMoveStep(MoveStep.A15_R2End);
} }
break; break;
case MoveStep.StoreOut16: case MoveStep.A15_R2End:
if (boxTransport.IsComplateOrFree) if (boxTransport.IsComplateOrFree)
{ {
AIOTMoveInfo.log($"料盘已取走"); AIOTMoveInfo.log($"料盘已取走");
......
...@@ -120,8 +120,7 @@ namespace DeviceLibrary ...@@ -120,8 +120,7 @@ namespace DeviceLibrary
RunningLed.LedState = LedState.off; RunningLed.LedState = LedState.off;
//回原 绿闪 //回原 绿闪
if (runStatus == RunStatus.HomeReset) if (runStatus == RunStatus.HomeReset)
{ {
//RunningLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.HomeReset); ProcessLefCfg(MachineLedStateE.HomeReset);
} }
//正常 绿亮 //正常 绿亮
...@@ -130,16 +129,12 @@ namespace DeviceLibrary ...@@ -130,16 +129,12 @@ namespace DeviceLibrary
ProcessLefCfg(MachineLedStateE.Running); ProcessLefCfg(MachineLedStateE.Running);
//出入库 绿闪 黄闪 //出入库 绿闪 黄闪
if ( StoreMoveInfo.MoveStep > MoveStep.Wait) if ( StoreMoveInfo.MoveStep > MoveStep.Wait)
{ {
//RunningLed.LedState = LedState.blink;
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.InOut); ProcessLefCfg(MachineLedStateE.InOut);
} }
//系统暂停,说明书未定义, 绿闪, 红闪 //系统暂停,说明书未定义, 绿闪, 红闪
if (!canRunning || UserPause) if (!canRunning || UserPause)
{ {
//RunningLed.LedState = LedState.blink;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.SystemPause); ProcessLefCfg(MachineLedStateE.SystemPause);
} }
} }
...@@ -147,24 +142,14 @@ namespace DeviceLibrary ...@@ -147,24 +142,14 @@ namespace DeviceLibrary
{ {
//系统停止时有报警, 红亮 //系统停止时有报警, 红亮
if (hasAlarm) if (hasAlarm)
{ {
//RunningLed.LedState = LedState.off;
//StandbyLed.LedState = LedState.off;
//AlarmLed.LedState = LedState.on;
ProcessLefCfg(MachineLedStateE.AlarmStop); ProcessLefCfg(MachineLedStateE.AlarmStop);
} }
} }
//系统运行时报警, 绿亮,红闪 //系统运行时报警, 绿亮,红闪
if (runStatus != RunStatus.Stop && hasAlarm) if (runStatus != RunStatus.Stop && hasAlarm)
{ {
//RunningLed.LedState = LedState.on; ProcessLefCfg(MachineLedStateE.Alarm);
//StandbyLed.LedState = LedState.off;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.Alarm);
//if (UserPause) {
// RunningLed.LedState = LedState.blink;
// StandbyLed.LedState = LedState.blink;
//}
} }
Led.LedGroup.ForEach((x) => { x.run(); }); Led.LedGroup.ForEach((x) => { x.run(); });
} }
......
...@@ -338,7 +338,7 @@ namespace DeviceLibrary ...@@ -338,7 +338,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
ResetMoveInfo.log("旋转轴,升降轴,回原,料叉P1待机点"); ResetMoveInfo.log($"旋转轴,升降轴,回原,进出轴到P1{Config.InOut_P1}待机点");
InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
Middle_Axis.HomeMove(ResetMoveInfo, forceHome); Middle_Axis.HomeMove(ResetMoveInfo, forceHome);
UpDown_Axis.HomeMove(ResetMoveInfo, forceHome); UpDown_Axis.HomeMove(ResetMoveInfo, forceHome);
...@@ -348,7 +348,7 @@ namespace DeviceLibrary ...@@ -348,7 +348,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.H05_HomeReset: case MoveStep.H05_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
ResetMoveInfo.log("旋转轴,升降轴,到P1待机点"); ResetMoveInfo.log($"旋转轴到P1{Config.Middle_P1},升降轴到P1{Config.UpDown_P1}");
Middle_Axis.AbsMove(ResetMoveInfo, Config.Middle_P1, Config.Middle_P1_speed); Middle_Axis.AbsMove(ResetMoveInfo, Config.Middle_P1, Config.Middle_P1_speed);
UpDown_Axis.AbsMove(ResetMoveInfo, Config.UpDown_P1, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(ResetMoveInfo, Config.UpDown_P1, Config.UpDown_P1_speed);
break; break;
...@@ -359,7 +359,7 @@ namespace DeviceLibrary ...@@ -359,7 +359,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.H07_HomeReset: case MoveStep.H07_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset);
ResetMoveInfo.log("旋转轴,升降轴,到P2,压紧轴p1"); ResetMoveInfo.log($" 压紧轴P1{Config.Comp_P1}");
Comp_Axis.AbsMove(ResetMoveInfo, Config.Comp_P1, Config.Comp_P1_speed); Comp_Axis.AbsMove(ResetMoveInfo, Config.Comp_P1, Config.Comp_P1_speed);
break; break;
case MoveStep.H08_HomeReset: case MoveStep.H08_HomeReset:
...@@ -514,7 +514,7 @@ namespace DeviceLibrary ...@@ -514,7 +514,7 @@ namespace DeviceLibrary
} }
else if (isInSuddenDown) else if (isInSuddenDown)
{ {
//Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
Msg.add(crc.GetString(L.in_suddenstop, "急停中"), MsgLevel.alarm, ErrInfo.SuddenStop); Msg.add(crc.GetString(L.in_suddenstop, "急停中"), MsgLevel.alarm, ErrInfo.SuddenStop);
ButtenEvent?.Invoke(null, ErrInfo.SuddenStop); ButtenEvent?.Invoke(null, ErrInfo.SuddenStop);
lastSafeCheckStatus = false; lastSafeCheckStatus = false;
...@@ -602,6 +602,13 @@ namespace DeviceLibrary ...@@ -602,6 +602,13 @@ namespace DeviceLibrary
private string getNextNgPos(int size = 7) private string getNextNgPos(int size = 7)
{ {
if (size == 0)
{
//默认返回7寸库位
size = 7;
}
string ngType = "NG_" + size; string ngType = "NG_" + size;
List<string> allPosList = CSVPositionReader<ACStorePosition>.getPositionKeyList(); List<string> allPosList = CSVPositionReader<ACStorePosition>.getPositionKeyList();
List<string> leftNgPos = (from m in allPosList where m.StartsWith(ngType) select m).ToList(); List<string> leftNgPos = (from m in allPosList where m.StartsWith(ngType) select m).ToList();
...@@ -701,19 +708,27 @@ namespace DeviceLibrary ...@@ -701,19 +708,27 @@ namespace DeviceLibrary
foreach (OutShelfBean obj in outShelfBeans.Values) foreach (OutShelfBean obj in outShelfBeans.Values)
{ {
if (obj.IsRightShelf(tray, out targetPosName)) if (obj.IsRightShelf(tray, out targetPosName))
{ {
//判断库位号是否存在
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(targetPosName); //料架对应位置存在的话使用料架对应位置
string pName = targetPosName + "_" + tray.realRFID;
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(pName);
if (position == null) if (position == null)
{ {
LogUtil.error(Name + " " + tray.ToStr() + " 找到匹配料架,但未找到库位号:" + position) ; //判断库位号是否存在
WarnMsg = tray.barcode+"未找到库位号:"+position; position = CSVPositionReader<ACStorePosition>.GetPositon(targetPosName);
targetPosName = ""; if (position == null)
break; {
} LogUtil.error(Name + " " + tray.ToStr() + " 找到匹配料架,但未找到库位号:" + position);
WarnMsg = tray.barcode + "未找到库位号:" + position;
targetPosName = "";
break;
}
obj.StartPutReel(); }
targetPosName = position.PositionNum;
LogUtil.info(Name + " " + tray.ToStr() + " 使用料架:" + targetPosName + ",更改料架为忙碌状态,开始放料"); LogUtil.info(Name + " " + tray.ToStr() + " 使用料架:" + targetPosName + ",更改料架为忙碌状态,开始放料");
obj.StartPutReel();
break; break;
} }
} }
......
...@@ -43,7 +43,7 @@ namespace DeviceLibrary ...@@ -43,7 +43,7 @@ namespace DeviceLibrary
//NG门关上再放料 //NG门关上再放料
if (IOManager.IOValue(IO_Type.Left_NGDoor_Close_Check).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.Right_NGDoor_Close_Check).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.Left_NGDoor_Close_Check).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.Right_NGDoor_Close_Check).Equals(IO_VALUE.HIGH))
{ {
string ngPos = getNextNgPos(); string ngPos = getNextNgPos(tray.plateW);
if (ngPos == "") if (ngPos == "")
{ {
//暂无NG空位 //暂无NG空位
...@@ -75,7 +75,7 @@ namespace DeviceLibrary ...@@ -75,7 +75,7 @@ namespace DeviceLibrary
else else
{ {
//暂无NG空位 //暂无NG空位
Msg.add("[" + inReel.Name + "]获取库位号失败", MsgLevel.warning, ErrInfo.Empty); Msg.add("[" + inReel.Name + "]未找到匹配库位", MsgLevel.warning, ErrInfo.Empty);
ProcessMsgEvent?.Invoke(Msg.get()); ProcessMsgEvent?.Invoke(Msg.get());
} }
} }
......
...@@ -32,86 +32,86 @@ namespace DeviceLibrary ...@@ -32,86 +32,86 @@ namespace DeviceLibrary
HEND_HomeReset, HEND_HomeReset,
StringLoad_01, //StringLoad_01,
StringLoad_01a, //StringLoad_01a,
StringLoad_02, //StringLoad_02,
StringLoad_02a, //StringLoad_02a,
StringLoad_02b, //StringLoad_02b,
StringLoad_03, //StringLoad_03,
StringLoad_04, //StringLoad_04,
StringLoad_05, //StringLoad_05,
StringLoad_06, //StringLoad_06,
StringLoad_07, //StringLoad_07,
StringReadyGet, //StringReadyGet,
StringReelGet, //StringReelGet,
StringReelGetFail, //StringReelGetFail,
StringReelGetFail_02, //StringReelGetFail_02,
StringReadyPut, //StringReadyPut,
StringReelPut, //StringReelPut,
StringReelPut_01, //StringReelPut_01,
StringReelPut_02, //StringReelPut_02,
StringReelPut_03, //StringReelPut_03,
StringReelPut_04, //StringReelPut_04,
StringOut_01, //StringOut_01,
StringOut_02, //StringOut_02,
StringOut_03, //StringOut_03,
StringOut_Released, //StringOut_Released,
StringOut_05, //StringOut_05,
StringOut_06, //StringOut_06,
StringOut_07, //StringOut_07,
ReelClamp_01, //ReelClamp_01,
ReelClamp_02, //ReelClamp_02,
ReelClamp_03, //ReelClamp_03,
ReelClamp_04, //ReelClamp_04,
ReelClamp_05, //ReelClamp_05,
ReelClamp_WaitGaugeHeight, //ReelClamp_WaitGaugeHeight,
ReelClamp_GetHeight, //ReelClamp_GetHeight,
ReelClamp_06, //ReelClamp_06,
ReelClamp_07, //ReelClamp_07,
ReelClamp_08, //ReelClamp_08,
ReelClamp_09, //ReelClamp_09,
ReelClamp_10, //ReelClamp_10,
ReelClamp_11, //ReelClamp_11,
InWaitServerCallback, //InWaitServerCallback,
WaitInStore, //WaitInStore,
ReelTaked, //ReelTaked,
NGOUT_00, //NGOUT_00,
NGOUT_01, //NGOUT_01,
NGOUT_02, //NGOUT_02,
NGOUT_03, //NGOUT_03,
NGOUT_04, //NGOUT_04,
NGOUT_05, //NGOUT_05,
NGOUT_06, //NGOUT_06,
NGOUT_07, //NGOUT_07,
NGOUT_08, //NGOUT_08,
NGOUT_09, //NGOUT_09,
NGOUT_10, //NGOUT_10,
NGOUT_11, //NGOUT_11,
SingleIn, //SingleIn,
SingleIn_01, //SingleIn_01,
SingleIn_02, //SingleIn_02,
SingleInReady, //SingleInReady,
SingleInRun, //SingleInRun,
SingleInRun_01, //SingleInRun_01,
SingleInRun_02, //SingleInRun_02,
SingleInRun_03, //SingleInRun_03,
SingleInRun_04, //SingleInRun_04,
SingleInRun_05, //SingleInRun_05,
OutBoxPutOn, //OutBoxPutOn,
Out01, //Out01,
Out02, //Out02,
Out03, //Out03,
Out04, //Out04,
Out05, //Out05,
Out06, //Out06,
Out07, //Out07,
Out08, //Out08,
Out09, //Out09,
Out10, //Out10,
Out11, //Out11,
OutReset, //OutReset,
//放料,准备放料 //放料,准备放料
PutReel01_Ready, PutReel01_Ready,
...@@ -124,56 +124,97 @@ namespace DeviceLibrary ...@@ -124,56 +124,97 @@ namespace DeviceLibrary
//放料:放料全部结束 //放料:放料全部结束
PutReel05_End, PutReel05_End,
/// <summary>
/// 自动测试:等待放入料盘
/// </summary>
A01_WaitReel, A01_WaitReel,
A01_Ready, //入库 /// <summary>
/// 自动测试: 料盘已放入
/// </summary>
A01_Ready,
/// <summary>
/// 自动测试: 开始放第一盘料
/// </summary>
A02_StartPutOne, A02_StartPutOne,
/// <summary>
/// 自动测试: 等待第二盘料放入入口
/// </summary>
A03_WaitRee2, A03_WaitRee2,
/// <summary>
/// 自动测试: 等待第一盘料放料完成
/// </summary>
A04_WaitOneComplate, A04_WaitOneComplate,
/// <summary>
/// 自动测试: 开始放第二盘料
/// </summary>
A05_StartPutTwo, A05_StartPutTwo,
/// <summary>
/// 自动测试: 等待第二盘料完成
/// </summary>
A06_WaitTwoEnd, A06_WaitTwoEnd,
/// <summary>
/// 自动测试: 开始下一盘物料放料
/// </summary>
A07_NextPos, A07_NextPos,
StoreIn08, /// <summary>
StoreIn09, /// 自动测试: 等待放料完成
A10_LastPos, //出库 /// </summary>
StoreOut_NGPre, A8_WaitPosEnd,
StoreOut11, /// <summary>
StoreOut12, /// 自动测试: 到达最后一盘物料
StoreOut13, /// </summary>
StoreOut14, A10_LastPos,
StoreOut15,
StoreOut16, /// <summary>
/// 自动测试: 开始将料盘放回入口
/// </summary>
A11_R1StartBack,
/// <summary>
/// 自动测试: 等待料盘1返回入口
/// </summary>
A12_WR1End,
/// <summary>
/// 自动测试:料盘1返回入口完成
/// </summary>
A13_R1End,
/// <summary>
/// 自动测试:开始第二盘料返回入口
/// </summary>
A15_StartR2Back,
/// <summary>
/// 自动测试:第二盘料放回入口完成
/// </summary>
A15_R2End,
StoreOut17, StoreOut17,
StoreOut18, StoreOut18,
StoreOut_WaitMT, StoreOut_WaitMT,
StoreTS01,
StoreTS02,
StoreTS03, TS01,
StoreTS04, TS02_Check,
StoreTS05, TS03_InoutTP1,
StoreTS06, TS04_TSPos,
StoreTS07, TS06_InoutTP2,
StoreTS08, TS08_GetReel,
StoreTS09, TS09_InoutTP1,
StoreFIX01, TS10_IOCheck,
StoreFIX02,
StoreFIX03,
StoreFIX04, TS11_ToTPos,
StoreFIX05, TS13_InoutTP2,
StoreTS10, TS14_PutReel,
StoreTS11, TS15_InoutTP1,
StoreTS12, TS16_Check,
StoreTS13, TS17_AxisBack,
StoreTS14, TS_WaitOutProcess,
StoreTS15, TS_Continue,
StoreTS16,
StoreTS17,
StoreTS_WaitOutProcess,
StoreTS_Continue,
//复位:定位气缸下降 //复位:定位气缸下降
SR01_LocationDown, SR01_LocationDown,
//出料口:AGV检测到小车 //出料口:AGV检测到小车
S01_AgvDetect, S01_AgvDetect,
//电机正传 //电机正传
...@@ -209,20 +250,25 @@ namespace DeviceLibrary ...@@ -209,20 +250,25 @@ namespace DeviceLibrary
S28_WaitTime, S28_WaitTime,
//料盘:等待信号检测 /// <summary>
/// 料盘:等待信号检测
/// </summary>
IN01_WaitCheck, IN01_WaitCheck,
/// <summary>
//料盘:扫码 /// 料盘:扫码
/// </summary>
IN02_ScanCode, IN02_ScanCode,
/// <summary>
//料盘:获取库位号 /// 料盘:获取库位号
/// </summary>
IN03_GetPos, IN03_GetPos,
/// <summary>
/// 料盘:料盘已准备好,等待取料
//料盘:料盘已准备好,等待取料 /// </summary>
IN05_ReelReady, IN05_ReelReady,
/// <summary>
//料盘:料盘已拿走 /// 料盘:料盘已拿走
/// </summary>
IN06_ReelLeave, IN06_ReelLeave,
} }
......
...@@ -386,19 +386,14 @@ namespace DeviceLibrary ...@@ -386,19 +386,14 @@ namespace DeviceLibrary
#region IO操作 #region IO操作
//agv小车检测 //agv小车检测
private string Agv_Detect = "Agv_Detect"; private string Agv_Detect = "Agv_Detect";
//出料口前端料格检测 //出料口前端料格检测
private string Shelf_Front_Check = "Shelf_Front_Check"; private string Shelf_Front_Check = "Shelf_Front_Check";
//出料口后端料格检测 //出料口后端料格检测
private string Shelf_Back_Check = "Shelf_Back_Check"; private string Shelf_Back_Check = "Shelf_Back_Check";
//出料口定位上升端 //出料口定位上升端
private string Location_Up = "Location_Up"; private string Location_Up = "Location_Up";
//出料口定位下降端, //出料口定位下降端,
private string Location_Down = "Location_Down"; private string Location_Down = "Location_Down";
//电机正传 //电机正传
private static string Moto_Fwd = "Moto_Fwd"; private static string Moto_Fwd = "Moto_Fwd";
//电机反转 //电机反转
......
using OnlineStore; using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
...@@ -16,8 +10,7 @@ namespace DeviceLibrary ...@@ -16,8 +10,7 @@ namespace DeviceLibrary
BoxStorePosition From; BoxStorePosition From;
public BoxStorePosition To; public BoxStorePosition To;
BoxStorePosition Fix; BoxStorePosition Fix;
MainMachine mainMachine; MainMachine mainMachine;
//using static mainMachine;
AxisBean Middle_Axis; AxisBean Middle_Axis;
AxisBean UpDown_Axis; AxisBean UpDown_Axis;
AxisBean InOut_Axis; AxisBean InOut_Axis;
...@@ -29,15 +22,15 @@ namespace DeviceLibrary ...@@ -29,15 +22,15 @@ namespace DeviceLibrary
public event Action<string, StoreMoveType, bool> InOutEndProcessEvent; public event Action<string, StoreMoveType, bool> InOutEndProcessEvent;
public bool IsComplateOrFree { get => MoveInfo.MoveStep == MoveStep.Wait && !movelock; } public bool IsComplateOrFree { get => MoveInfo.MoveStep == MoveStep.Wait && !movelock; }
public bool IsTakedReel { get => MoveInfo.MoveStep >= MoveStep.StoreTS10; } public bool IsTakedReel { get => MoveInfo.MoveStep >= MoveStep.TS10_IOCheck; }
public bool IsPutOnOut { get => MoveInfo.MoveStep >= MoveStep.StoreTS16; } public bool IsPutOnOut { get => MoveInfo.MoveStep >= MoveStep.TS16_Check; }
public ReelTransport(Robot_Config _Config, MainMachine _mainMachine) public ReelTransport(Robot_Config _Config, MainMachine _mainMachine)
{ {
Config = _Config; Config = _Config;
mainMachine = _mainMachine; mainMachine = _mainMachine;
MoveInfo = new MoveInfo(crc.GetString("Res0123", "出入库轴"), false); MoveInfo = new MoveInfo(crc.GetString("Res0123", "取放料机构"), false);
To = null; To = null;
From = null; From = null;
#region 初始化伺服轴 #region 初始化伺服轴
...@@ -74,7 +67,7 @@ namespace DeviceLibrary ...@@ -74,7 +67,7 @@ namespace DeviceLibrary
WareCode = "NG"; WareCode = "NG";
plateH = 56; plateH = 56;
To = to.clone(); To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS10); MoveInfo.NewMove(MoveStep.TS10_IOCheck);
MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}"); MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}");
MoveInfo.MoveParam.TargetPos = $"NA=>{To.posid}"; MoveInfo.MoveParam.TargetPos = $"NA=>{To.posid}";
} }
...@@ -85,29 +78,18 @@ namespace DeviceLibrary ...@@ -85,29 +78,18 @@ namespace DeviceLibrary
From = from.clone(); From = from.clone();
To = to.clone(); To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS01); MoveInfo.NewMove(MoveStep.TS01);
MoveInfo.log($"{storeMoveType}:开始运输料盘,从:{from.posid},到:{to.posid}"); MoveInfo.log($"{storeMoveType}:开始运输料盘,从:{from.posid},到:{to.posid}");
MoveInfo.MoveParam.TargetPos = $"{From.posid}=>{To.posid}"; MoveInfo.MoveParam.TargetPos = $"{From.posid}=>{To.posid}";
MoveInfo.MoveParam.ReelOnFixture = From.Reel.ReelOnFixture; MoveInfo.MoveParam.ReelOnFixture = From.Reel.ReelOnFixture;
} }
if (To.posid == BoxStorePosition.ngdoor)
{
Fix = BoxStorePosition.GetFixPos(Config, To.Reel);
}
MoveInfo.MoveParam.WareCode = WareCode; MoveInfo.MoveParam.WareCode = WareCode;
ErrMsgTxt = ""; ErrMsgTxt = "";
return true; return true;
} }
public bool ReadyToTakeBox()
{
if (MoveInfo.MoveStep != MoveStep.StoreTS05)
return false;
MoveInfo.NextMoveStep(MoveStep.StoreTS06);
return true;
}
bool pause = false; bool pause = false;
public void Pause() public void Pause()
{ {
...@@ -128,7 +110,7 @@ namespace DeviceLibrary ...@@ -128,7 +110,7 @@ namespace DeviceLibrary
{ {
case MoveStep.Wait: case MoveStep.Wait:
break; break;
case MoveStep.StoreTS01: case MoveStep.TS01:
if (!IgnoreX09 && !MoveInfo.MoveParam.ReelOnFixture && IOManager.IOValue(IO_Type.TrayCheck_Fixture, Config).Equals(IO_VALUE.HIGH)) if (!IgnoreX09 && !MoveInfo.MoveParam.ReelOnFixture && IOManager.IOValue(IO_Type.TrayCheck_Fixture, Config).Equals(IO_VALUE.HIGH))
{ {
if (!IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 5000)) if (!IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 5000))
...@@ -138,62 +120,51 @@ namespace DeviceLibrary ...@@ -138,62 +120,51 @@ namespace DeviceLibrary
{ {
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS02); MoveInfo.NextMoveStep(MoveStep.TS02_Check);
MoveInfo.log($"{storeMoveType}:检查安全状态"); MoveInfo.log($"{storeMoveType}:检查安全状态");
} }
break; break;
case MoveStep.StoreTS02: case MoveStep.TS02_Check:
if (MoveInfo.MoveParam.ReelOnFixture) if (MoveInfo.MoveParam.ReelOnFixture)
{ {
MoveInfo.NextMoveStep(MoveStep.StoreTS08); MoveInfo.NextMoveStep(MoveStep.TS08_GetReel);
MoveInfo.log($"{storeMoveType}:料盘已在料叉上,压紧轴压紧,Comp_PL:{From.Comp_PL}"); MoveInfo.log($"{storeMoveType}:料盘已在料叉上,压紧轴压紧,Comp_PL:{From.Comp_PL}");
Comp_Axis.AbsMove(MoveInfo, From.Comp_PL, Config.Comp_P2_speed); Comp_Axis.AbsMove(MoveInfo, From.Comp_PL, Config.Comp_P2_speed);
} }
else else
{ {
MoveInfo.NextMoveStep(MoveStep.StoreTS03); MoveInfo.NextMoveStep(MoveStep.TS03_InoutTP1);
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
Comp_Axis.AbsMove(MoveInfo, From.Comp_PH, Config.Comp_P2_speed); Comp_Axis.AbsMove(MoveInfo, From.Comp_PH, Config.Comp_P2_speed);
MoveInfo.log($"{storeMoveType}:进出轴返回待机点P1"); MoveInfo.log($"{storeMoveType}:进出轴返回待机点P1{Config.InOut_P1},压紧轴到高点{From.Comp_PH}");
} }
break; break;
case MoveStep.StoreTS03: case MoveStep.TS03_InoutTP1:
MoveInfo.NextMoveStep(MoveStep.StoreTS04); MoveInfo.NextMoveStep(MoveStep.TS04_TSPos);
UpDown_Axis.AbsMove(MoveInfo, From.UpDown_PL, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(MoveInfo, From.UpDown_PL, Config.UpDown_P1_speed);
MoveInfo.log($"{storeMoveType}:上下轴到达取料低点{From.UpDown_PL}");
Middle_Axis.AbsMove(MoveInfo, From.Middle_P2, Config.Middle_P1_speed); Middle_Axis.AbsMove(MoveInfo, From.Middle_P2, Config.Middle_P1_speed);
MoveInfo.log($"{storeMoveType}:行走轴到达取料点{From.Middle_P2}"); MoveInfo.log($"{storeMoveType}:升降轴到取料低点{From.UpDown_PL},旋转轴到取料点{From.Middle_P2}");
break; break;
case MoveStep.StoreTS04: case MoveStep.TS04_TSPos:
if (From.posid == BoxStorePosition.ngdoor)
{ MoveInfo.NextMoveStep(MoveStep.TS06_InoutTP2);
}
else
MoveInfo.NextMoveStep(MoveStep.StoreTS05);
break;
case MoveStep.StoreTS05:
MoveInfo.NextMoveStep(MoveStep.StoreTS06);
InOut_Axis.AbsMove(MoveInfo, From.InOut_P2, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, From.InOut_P2, Config.InOut_P1_speed);
MoveInfo.log($"{storeMoveType}:进出轴到达取料点{From.InOut_P2}"); MoveInfo.log($"{storeMoveType}:进出轴到取料点P2{From.InOut_P2}");
break; break;
case MoveStep.StoreTS06: case MoveStep.TS06_InoutTP2:
MoveInfo.NextMoveStep(MoveStep.StoreTS07);
break;
case MoveStep.StoreTS07:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromIn)); RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromIn));
MoveInfo.NextMoveStep(MoveStep.StoreTS08); MoveInfo.NextMoveStep(MoveStep.TS08_GetReel);
UpDown_Axis.AbsMove(MoveInfo, From.UpDown_PH, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(MoveInfo, From.UpDown_PH, Config.UpDown_P1_speed);
Comp_Axis.AbsMove(MoveInfo, From.Comp_PL, Config.Comp_P2_speed); Comp_Axis.AbsMove(MoveInfo, From.Comp_PL, Config.Comp_P2_speed);
MoveInfo.log($"{storeMoveType}:上下轴到达取料高点"); MoveInfo.log($"{storeMoveType}:升降轴到取料高点{From.UpDown_PH},压紧轴到低点{From.Comp_PL}");
break; break;
case MoveStep.StoreTS08: case MoveStep.TS08_GetReel:
MoveInfo.NextMoveStep(MoveStep.StoreTS09); MoveInfo.NextMoveStep(MoveStep.TS09_InoutTP1);
MoveInfo.log($"{storeMoveType}:进出轴到达待机点"); MoveInfo.log($"{storeMoveType}:进出轴到待机点P1{Config.InOut_P1}");
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
IgnoreX09 = false; IgnoreX09 = false;
break; break;
case MoveStep.StoreTS09: case MoveStep.TS09_InoutTP1:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut)); RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut));
if (!IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture, Config).Equals(IO_VALUE.LOW)) if (!IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture, Config).Equals(IO_VALUE.LOW))
{ {
...@@ -203,44 +174,36 @@ namespace DeviceLibrary ...@@ -203,44 +174,36 @@ namespace DeviceLibrary
{ {
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS10); MoveInfo.NextMoveStep(MoveStep.TS10_IOCheck) ;
MoveInfo.log($"{storeMoveType}:TrayCheck_Fixture取到料"); MoveInfo.log($"{storeMoveType}:TrayCheck_Fixture取到料");
InOutEndProcess(StoreMoveType.OutStore, From.posid); InOutEndProcess(StoreMoveType.OutStore, From.posid);
} }
break; break;
case MoveStep.StoreTS10: case MoveStep.TS10_IOCheck:
MoveInfo.NextMoveStep(MoveStep.StoreTS11); MoveInfo.NextMoveStep(MoveStep.TS11_ToTPos);
Middle_Axis.AbsMove(MoveInfo, To.Middle_P2, Config.Middle_P1_speed); Middle_Axis.AbsMove(MoveInfo, To.Middle_P2, Config.Middle_P1_speed);
MoveInfo.log($"{storeMoveType}:行走轴到达目的地:{To.Middle_P2}"); MoveInfo.log($"{storeMoveType}");
UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PH, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PH, Config.UpDown_P1_speed);
MoveInfo.log($"{storeMoveType}:上下轴到达目的地高点:{To.UpDown_PH}"); MoveInfo.log($"{storeMoveType}::旋转轴到目的地P2{To.Middle_P2}升降轴到目的地高点:{To.UpDown_PH}");
break;
case MoveStep.StoreTS11:
if (To.posid == BoxStorePosition.ngdoor)
{
}
MoveInfo.NextMoveStep(MoveStep.StoreTS12);
break; break;
case MoveStep.StoreTS12: case MoveStep.TS11_ToTPos:
MoveInfo.NextMoveStep(MoveStep.StoreTS13); MoveInfo.NextMoveStep(MoveStep.TS13_InoutTP2);
MoveInfo.log($"{storeMoveType}:进出轴到达目的地"); MoveInfo.log($"{storeMoveType}:进出轴到P2{To.InOut_P2}");
InOut_Axis.AbsMove(MoveInfo, To.InOut_P2, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, To.InOut_P2, Config.InOut_P1_speed);
break; break;
case MoveStep.StoreTS13: case MoveStep.TS13_InoutTP2:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(To.posid, WareCode, storeMoveType, FixtureState.ToIn)); RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(To.posid, WareCode, storeMoveType, FixtureState.ToIn));
MoveInfo.NextMoveStep(MoveStep.StoreTS14); MoveInfo.NextMoveStep(MoveStep.TS14_PutReel);
Comp_Axis.AbsMove(MoveInfo, To.Comp_PH, Config.Comp_P2_speed); Comp_Axis.AbsMove(MoveInfo, To.Comp_PH, Config.Comp_P2_speed);
UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PL, Config.UpDown_S1_Speed); UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PL, Config.UpDown_S1_Speed);
MoveInfo.log($"{storeMoveType}:压紧轴压紧点:{To.Comp_PH}"); MoveInfo.log($"{storeMoveType}:压紧轴到压紧前点:{To.Comp_PH},升降轴到目的地低点:{To.UpDown_PL}");
MoveInfo.log($"{storeMoveType}:上下轴到达目的地低点:{To.UpDown_PL}");
break; break;
case MoveStep.StoreTS14: case MoveStep.TS14_PutReel:
MoveInfo.NextMoveStep(MoveStep.StoreTS15); MoveInfo.NextMoveStep(MoveStep.TS15_InoutTP1);
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
MoveInfo.log($"{storeMoveType}:进出轴到达待机点"); MoveInfo.log($"{storeMoveType}:进出轴到达待机点");
break; break;
case MoveStep.StoreTS15: case MoveStep.TS15_InoutTP1:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(To.posid, WareCode, storeMoveType, FixtureState.ToOut)); RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(To.posid, WareCode, storeMoveType, FixtureState.ToOut));
if (!IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture, Config).Equals(IO_VALUE.HIGH)) if (!IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture, Config).Equals(IO_VALUE.HIGH))
{ {
...@@ -250,32 +213,32 @@ namespace DeviceLibrary ...@@ -250,32 +213,32 @@ namespace DeviceLibrary
{ {
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS16); MoveInfo.NextMoveStep(MoveStep.TS16_Check);
MoveInfo.log($"{storeMoveType}:安全检查"); MoveInfo.log($"{storeMoveType}:安全检查");
InOutEndProcess(StoreMoveType.PutReel, To.posid); InOutEndProcess(StoreMoveType.PutReel, To.posid);
} }
break; break;
case MoveStep.StoreTS16: case MoveStep.TS16_Check:
MoveInfo.NextMoveStep(MoveStep.StoreTS17); MoveInfo.NextMoveStep(MoveStep.TS17_AxisBack);
if (From != null && From.posid != BoxStorePosition.ngdoor && From.posid != BoxStorePosition.ngdoor) if (RobotManage.mainMachine.AutoInOutTest)
{ {
MoveInfo.log($"{storeMoveType}:库位测试模式,上下轴,旋转不返回待机点"); MoveInfo.log($"{storeMoveType}:库位测试模式,升降轴,旋转不返回待机点");
break; break;
} }
UpDown_Axis.AbsMove(MoveInfo, Config.UpDown_P1, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(MoveInfo, Config.UpDown_P1, Config.UpDown_P1_speed);
Middle_Axis.AbsMove(MoveInfo, Config.Middle_P1, Config.Middle_P1_speed); Middle_Axis.AbsMove(MoveInfo, Config.Middle_P1, Config.Middle_P1_speed);
MoveInfo.log($"{storeMoveType}:上下轴,旋转返回待机点P1"); MoveInfo.log($"{storeMoveType}:升降轴回P1{Config.UpDown_P1},旋转返回待机点P1{Config.Middle_P1}");
ErrMsgTxt = ""; ErrMsgTxt = "";
break; break;
case MoveStep.StoreTS17: case MoveStep.TS17_AxisBack:
MoveInfo.log($"{storeMoveType}:转移料盘完成"); MoveInfo.log($"{storeMoveType}:转移料盘完成");
MoveInfo.EndMove(); MoveInfo.EndMove();
ErrMsgTxt = ""; ErrMsgTxt = "";
To.posid = ""; To.posid = "";
storeMoveType = StoreMoveType.None; storeMoveType = StoreMoveType.None;
break; break;
case MoveStep.StoreTS_Continue: case MoveStep.TS_Continue:
MoveInfo.NextMoveStep(MoveStep.StoreTS17); MoveInfo.NextMoveStep(MoveStep.TS17_AxisBack);
MoveInfo.log($"{storeMoveType}:继续运行进出轴到达待机点"); MoveInfo.log($"{storeMoveType}:继续运行进出轴到达待机点");
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
break; break;
......
...@@ -69,7 +69,7 @@ PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,, ...@@ -69,7 +69,7 @@ PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,15,旋转轴待机点P1,Middle_P1,168460,,,50000,,,,,,,,, PRO,15,旋转轴待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,16,升降轴待机点P1,UpDown_P1,1006626,,,500000,,,,,,,,, PRO,16,升降轴待机点P1,UpDown_P1,1006626,,,500000,,,,,,,,,
PRO,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,, ,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,,
PRO,16,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,, PRO,16,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,17,进出轴待机点P1,InOut_P1,0,,,500000,,,,,,,,, PRO,17,进出轴待机点P1,InOut_P1,0,,,500000,,,,,,,,,
......
位置,类型,备注,优先级,高度,宽度,旋转轴位置P2,升降轴库位入料高点P3,升降轴库位入料低点P4,进出轴库位点取料点P3 位置,类型,备注,优先级,高度,宽度,旋转轴位置P2,升降轴库位入料高点P3,升降轴库位入料低点P4,进出轴库位点取料点P3
U1_A1,0,出口1_A1,0,24,7,99198,417323,379066,227002 U1_1,0,出口1_1,0,24,7,99198,417323,379066,227002
U1_A2,0,出口1_A2,0,24,7,219347,91377,80569,206929 U1_2,0,出口1_2,0,24,7,219347,91377,80569,206929
U1_A3,0,出口1_A3,0,24,7,99198,417323,-99999999,227002 U1_3,0,出口1_3,0,24,7,99198,417323,-99999999,227002
U1_A4,0,出口1_A4,0,24,7,219347,91377,-99999999,206929 U1_4,0,出口1_4,0,24,7,219347,91377,-99999999,206929
U1_A5,0,出口1_A5,0,24,7,219347,91377,123,206929 U1_5,0,出口1_5,0,24,7,219347,91377,123,206929
U1_A6,0,出口1_A6,0,24,7,219347,91377,1231,206929 U1_6,0,出口1_6,0,24,7,219347,91377,1231,206929
U1_A7,0,出口1_A7,0,24,7,219347,91377,23,206929 U1_7,0,出口1_7,0,24,7,219347,91377,23,206929
,,,,,,,,, ,,,,,,,,,
U2_1,0,出口2_1,0,24,7,99198,417323,379066,227002
U2_2,0,出口2_2,0,24,7,219347,91377,80569,206929
U2_3,0,出口2_3,0,24,7,99198,417323,-99999999,227002
U2_4,0,出口2_4,0,24,7,219347,91377,-99999999,206929
U2_5,0,出口2_5,0,24,7,219347,91377,123,206929
U2_6,0,出口2_6,0,24,7,219347,91377,1231,206929
U2_7,0,出口2_7,0,24,7,219347,91377,23,206929
,,,,,,,,, ,,,,,,,,,
U2_A1,0,出口2_A1,0,24,7,99198,417323,379066,227002 U3_1,0,出口3_1,0,24,7,99198,417323,379066,227002
U2_A2,0,出口2_A2,0,24,7,219347,91377,80569,206929 U3_2,0,出口3_2,0,24,7,219347,91377,80569,206929
U2_A3,0,出口2_A3,0,24,7,99198,417323,-99999999,227002 U3_3,0,出口3_3,0,24,7,99198,417323,-99999999,227002
U2_A4,0,出口2_A4,0,24,7,219347,91377,-99999999,206929 U3_4,0,出口3_4,0,24,7,219347,91377,-99999999,206929
U2_A5,0,出口2_A5,0,24,7,219347,91377,123,206929 U3_5,0,出口3_5,0,24,7,219347,91377,123,206929
U2_A6,0,出口2_A6,0,24,7,219347,91377,1231,206929 U3_6,0,出口3_6,0,24,7,219347,91377,1231,206929
U2_A7,0,出口2_A7,0,24,7,219347,91377,23,206929 U3_7,0,出口3_7,0,24,7,219347,91377,23,206929
,,,,,,,,,
U4_1,0,出口4_1,0,24,7,99198,417323,379066,227002
U4_2,0,出口4_2,0,24,7,219347,91377,80569,206929
U4_3,0,出口4_3,0,24,7,99198,417323,-99999999,227002
U4_4,0,出口4_4,0,24,7,219347,91377,-99999999,206929
U4_5,0,出口4_5,0,24,7,219347,91377,123,206929
U4_6,0,出口4_6,0,24,7,219347,91377,1231,206929
U4_7,0,出口4_7,0,24,7,219347,91377,23,206929
...@@ -83,11 +83,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -83,11 +83,11 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("UpDown_P1")] [ConfigProAttribute("UpDown_P1")]
public int UpDown_P1 { get; set; } public int UpDown_P1 { get; set; }
/// <summary> ///// <summary>
/// PRO,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,, ///// PRO,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,,
/// </summary> ///// </summary>
[ConfigProAttribute("UpDown_PoToMM")] //[ConfigProAttribute("UpDown_PoToMM")]
public int UpDown_PoToMM { get; set; } //public int UpDown_PoToMM { get; set; }
/// <summary> /// <summary>
/// PRO,16,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,, /// PRO,16,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,,
/// </summary> /// </summary>
......
...@@ -253,6 +253,7 @@ ...@@ -253,6 +253,7 @@
</PreBuildEvent> </PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>start $(TargetDir)</PostBuildEvent> <PostBuildEvent>
</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
\ No newline at end of file \ No newline at end of file
...@@ -178,7 +178,7 @@ namespace TheMachine ...@@ -178,7 +178,7 @@ namespace TheMachine
dataGridView1.Rows.Clear(); dataGridView1.Rows.Clear();
LoadPosCheck(); LoadPosCheck();
int colcount = 9; int colcount = 6;
for (int i = 0; i < colcount; i++) for (int i = 0; i < colcount; i++)
{ {
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此 如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。 元素。
--> -->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges> </requestedPrivileges>
</security> </security>
</trustInfo> </trustInfo>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!