Commit e463272d 刘韬

1

1 个父辈 fc9c9494
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox6 = new System.Windows.Forms.GroupBox();
this.chbStickingPos = new System.Windows.Forms.CheckBox(); this.chbStickingPos = new System.Windows.Forms.CheckBox();
this.btnShelfReset = new System.Windows.Forms.Button(); this.btnShelfReset = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btnLabelReset = new System.Windows.Forms.Button(); this.btnLabelReset = new System.Windows.Forms.Button();
this.btnMoveReset = new System.Windows.Forms.Button(); this.btnMoveReset = new System.Windows.Forms.Button();
this.lblAgvInfo = new System.Windows.Forms.Label(); this.lblAgvInfo = new System.Windows.Forms.Label();
...@@ -158,7 +159,6 @@ ...@@ -158,7 +159,6 @@
this.lblName = new System.Windows.Forms.Label(); this.lblName = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.chbMoveStop = new System.Windows.Forms.CheckBox(); this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
...@@ -851,6 +851,20 @@ ...@@ -851,6 +851,20 @@
this.btnShelfReset.UseVisualStyleBackColor = false; this.btnShelfReset.UseVisualStyleBackColor = false;
this.btnShelfReset.Click += new System.EventHandler(this.btnShelfReset_Click); this.btnShelfReset.Click += new System.EventHandler(this.btnShelfReset_Click);
// //
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.White;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(1142, 108);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(126, 40);
this.button1.TabIndex = 302;
this.button1.Text = "复位打印机状态";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// btnLabelReset // btnLabelReset
// //
this.btnLabelReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnLabelReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
...@@ -900,6 +914,7 @@ ...@@ -900,6 +914,7 @@
this.chbPrint.TabIndex = 299; this.chbPrint.TabIndex = 299;
this.chbPrint.Text = "启用标签打印"; this.chbPrint.Text = "启用标签打印";
this.chbPrint.UseVisualStyleBackColor = true; this.chbPrint.UseVisualStyleBackColor = true;
this.chbPrint.Visible = false;
this.chbPrint.CheckedChanged += new System.EventHandler(this.chbPrint_CheckedChanged); this.chbPrint.CheckedChanged += new System.EventHandler(this.chbPrint_CheckedChanged);
// //
// btnPrint // btnPrint
...@@ -2177,20 +2192,6 @@ ...@@ -2177,20 +2192,6 @@
this.chbMoveStop.UseVisualStyleBackColor = true; this.chbMoveStop.UseVisualStyleBackColor = true;
this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged); this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged);
// //
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.White;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(1142, 108);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(126, 40);
this.button1.TabIndex = 302;
this.button1.Text = "复位打印机状态";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// FrmOutputEquip // FrmOutputEquip
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
...@@ -302,6 +302,11 @@ namespace OnlineStore.AutoCountClient ...@@ -302,6 +302,11 @@ namespace OnlineStore.AutoCountClient
private void 启动AToolStripMenuItem_Click(object sender, EventArgs e) private void 启动AToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (!robot.LoadSuccess)
{
MessageBox.Show("配置尚未加载完成不能启动!");
return;
}
if (robot.runStatus != RobotRunStatus.Wait) if (robot.runStatus != RobotRunStatus.Wait)
{ {
MessageBox.Show(robot.Name + "当前状态:" + robot.runStatus + ",不能启动!"); MessageBox.Show(robot.Name + "当前状态:" + robot.runStatus + ",不能启动!");
...@@ -503,9 +508,9 @@ namespace OnlineStore.AutoCountClient ...@@ -503,9 +508,9 @@ namespace OnlineStore.AutoCountClient
if (robot.XrayBean.carerayImageError) if (robot.XrayBean.carerayImageError)
{ {
robot.XrayBean.MoveStop = true; robot.XrayBean.MoveStop = true;
lblXrayWork.Text = "图像平板失效,请及时处理。"; lblXrayWork.Text = "图像平板重启中。";
lblXrayWork.Visible = true; lblXrayWork.Visible = true;
robot.XrayBean.Alarm(AlarmType.SuddenStop); //robot.XrayBean.Alarm(AlarmType.SuddenStop);
} }
else { else {
lblXrayWork.Text = "警告:点料过程中,请勿开门"; lblXrayWork.Text = "警告:点料过程中,请勿开门";
......
...@@ -216,6 +216,6 @@ DO,2,出口防护门上升SOL,X_OutDoor_Up,9,PRO_AOI_IP_6,Y100,,,,,,,,,, ...@@ -216,6 +216,6 @@ DO,2,出口防护门上升SOL,X_OutDoor_Up,9,PRO_AOI_IP_6,Y100,,,,,,,,,,
DO,2,出口防护门下降SOL,X_OutDoor_Down,10,PRO_AOI_IP_6,Y101,,,,,,,,,, DO,2,出口防护门下降SOL,X_OutDoor_Down,10,PRO_AOI_IP_6,Y101,,,,,,,,,,
DO,2,阻挡气缸放行SOL,X_StopCylinder_Up,11,PRO_AOI_IP_6,Y102,,,,,,,,,, DO,2,阻挡气缸放行SOL,X_StopCylinder_Up,11,PRO_AOI_IP_6,Y102,,,,,,,,,,
DO,2,阻挡气缸挡停SOL,X_StopCylinder_Down,12,PRO_AOI_IP_6,Y103,,,,,,,,,, DO,2,阻挡气缸挡停SOL,X_StopCylinder_Down,12,PRO_AOI_IP_6,Y103,,,,,,,,,,
,2,,,13,PRO_AOI_IP_6,Y104,,,,,,,,,, DO,2,X光图像平板电源,X_Xplate_Power,13,PRO_AOI_IP_6,Y104,,,,,,,,,,
,2,,,14,PRO_AOI_IP_6,Y105,,,,,,,,,, ,2,,,14,PRO_AOI_IP_6,Y105,,,,,,,,,,
,2,,,15,PRO_AOI_IP_6,Y106,,,,,,,,,, ,2,,,15,PRO_AOI_IP_6,Y106,,,,,,,,,,
...@@ -334,16 +334,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -334,16 +334,33 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StepEnum.IW23_InoutToP3)) else if (MoveInfo.IsStep(StepEnum.IW23_InoutToP3))
{ {
MoveInfo.NextMoveStep(StepEnum.IW24_WaitCanPut); if (IOValue(IO_Type.X_InLine_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.X_InLine_Run).Equals(IO_VALUE.LOW))
WorkLog("->XRay:等待XRay可放料", 1); {
MoveInfo.TimeOutSeconds = 120; MoveInfo.NextMoveStep(StepEnum.IW24_WaitCanPut);
//TODO WorkLog("->XRay:XRay可放料", 1);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); }
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_InLine_Check, IO_VALUE.LOW)); else if (RobotManager.robot.outputEquip.HasWorkingShelf)
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_InLine_Run, IO_VALUE.LOW)); {
if (MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待 Xray入口皮带线料盘离开X100=Low,Y95=Low 超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, MoveInfo.ErrorLogType, MoveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut);
}
}
else
{
LogUtil.error("当前出口没有料串", MoveInfo.ErrorLogType);
MoveInfo.NextMoveStep(StepEnum.IW23_InoutToP3);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
WarnMsg = "等待出料线装填料串";
}
} }
else if (MoveInfo.IsStep(StepEnum.IW24_WaitCanPut)) else if (MoveInfo.IsStep(StepEnum.IW24_WaitCanPut))
{ {
WarnMsg = "";
//TickLog("等待XRay可放料", true); //TickLog("等待XRay可放料", true);
MoveInfo.NextMoveStep(StepEnum.IW41_Clamping_Relax); MoveInfo.NextMoveStep(StepEnum.IW41_Clamping_Relax);
RobotManager.robot.XrayBean.In_ReelInfo = MoveInfo.MoveParam.GetReelInfo(); RobotManager.robot.XrayBean.In_ReelInfo = MoveInfo.MoveParam.GetReelInfo();
......
...@@ -157,7 +157,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -157,7 +157,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NewMove(RobotMoveType.Reset); MoveInfo.NewMove(RobotMoveType.Reset);
SecMoveInfo.NewMove(RobotMoveType.Reset); SecMoveInfo.NewMove(RobotMoveType.Reset);
ShelfMoveInfo.NewMove(RobotMoveType.Reset); ShelfMoveInfo.NewMove(RobotMoveType.Reset);
LogInfo("开始重置: "); LogInfo("开始重置: ");
StartReset(); StartReset();
mainTimer.Enabled = true ; mainTimer.Enabled = true ;
...@@ -217,6 +216,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -217,6 +216,7 @@ namespace OnlineStore.DeviceLibrary
LabelZAxis.HomeMove(SecMoveInfo); LabelZAxis.HomeMove(SecMoveInfo);
IOMove(IO_Type.Nozzle_Work, IO_VALUE.LOW); IOMove(IO_Type.Nozzle_Work, IO_VALUE.LOW);
CylinderMove(SecMoveInfo, IO_Type.LablePaste_Forward, IO_Type.LablePaste_Back); CylinderMove(SecMoveInfo, IO_Type.LablePaste_Forward, IO_Type.LablePaste_Back);
printerr = 0;
//SecMoveInfo.moveType = RobotMoveType.Reset; //SecMoveInfo.moveType = RobotMoveType.Reset;
} }
......
...@@ -348,7 +348,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -348,7 +348,9 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.OT08_Clamping_Work)) else if (MoveInfo.IsStep(StepEnum.OT08_Clamping_Work))
{ {
MoveInfo.NextMoveStep(StepEnum.OT08_2_Wait_Out_TrayCheck); MoveInfo.NextMoveStep(StepEnum.OT08_2_Wait_Out_TrayCheck);
WorkLog("取料:取料Z轴返回P1 ,验证Out_TrayCheck消失 Out_TrayCheck=" + IOValue(IO_Type.Out_TrayCheck).ToString()); int position = Config.GetMoveXP2(MoveInfo.MoveParam.PlateW);
WorkLog($"取料:取料Z轴返回P1 ,X轴回退3mm:{position}-{(110 * 3)} ,验证Out_TrayCheck消失 Out_TrayCheck=" + IOValue(IO_Type.Out_TrayCheck).ToString());
MoveXAxis.AbsMove(MoveInfo, position - (110 * 3), Config.MoveX_P1Speed);
MoveZAxis.AbsMove(MoveInfo, Config.MoveZ_P1, Config.MoveZ_P1Speed); MoveZAxis.AbsMove(MoveInfo, Config.MoveZ_P1, Config.MoveZ_P1Speed);
if (MoveInfo.MoveParam.IsNgReel) if (MoveInfo.MoveParam.IsNgReel)
{ {
...@@ -462,14 +464,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -462,14 +464,16 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsTimeOut(120)) else if (MoveInfo.IsTimeOut(120))
{ {
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待出料料串准备完成(OS_18_ShelfReady)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]"; var WarnMsg1 = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待出料料串准备完成(OS_20_ShelfReady)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, MoveInfo.ErrorLogType, MoveInfo.logSeconds()); LogUtil.error(WarnMsg1, MoveInfo.ErrorLogType, MoveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut); WarnMsg = "等待出料线装填料串";
//Alarm(AlarmType.IoSingleTimeOut);
} }
CheckStartLabel(); CheckStartLabel();
} }
else if (MoveInfo.IsStep(StepEnum.OT12_MoveXToP3)) else if (MoveInfo.IsStep(StepEnum.OT12_MoveXToP3))
{ {
WarnMsg = "";
if (IOValue(IO_Type.O_WLine_TrayCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.O_WLine_TrayCheck).Equals(IO_VALUE.HIGH))
{ {
ShelfMoveInfo.NextMoveStep(StepEnum.OS_20_ShelfReady); ShelfMoveInfo.NextMoveStep(StepEnum.OS_20_ShelfReady);
...@@ -631,6 +635,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -631,6 +635,7 @@ namespace OnlineStore.DeviceLibrary
private Task printTask = null; private Task printTask = null;
private bool NeedPrint = ConfigAppSettings.GetIntValue(Setting_Init.NeedPrintLabel).Equals(1); private bool NeedPrint = ConfigAppSettings.GetIntValue(Setting_Init.NeedPrintLabel).Equals(1);
private bool StickingPosJudgment = ConfigAppSettings.GetIntValue(Setting_Init.StickingPosJudgment).Equals(1); private bool StickingPosJudgment = ConfigAppSettings.GetIntValue(Setting_Init.StickingPosJudgment).Equals(1);
int printerr = 0;
protected override void LabellingProcess() protected override void LabellingProcess()
{ {
if (SecMoveInfo.IsInWait) if (SecMoveInfo.IsInWait)
...@@ -677,11 +682,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -677,11 +682,16 @@ namespace OnlineStore.DeviceLibrary
else if (SecMoveInfo.IsStep(StepEnum.OL03_PrintLabel)) else if (SecMoveInfo.IsStep(StepEnum.OL03_PrintLabel))
{ {
bool isPrintOk = RobotManager.LastPrintStatus.Equals(Asa.PrintLabel.PrinterStatus.Idle); bool isPrintOk = RobotManager.LastPrintStatus.Equals(Asa.PrintLabel.PrinterStatus.Idle);
bool isTimeOut = SecMoveInfo.IsTimeOut(90); bool isTimeOut = SecMoveInfo.IsTimeOut(40);
if (printTask == null || printTask.IsCompleted) if (printTask == null || printTask.IsCompleted)
{ {
if (isPrintOk || isTimeOut || (!NeedPrint)) if ((isPrintOk || isTimeOut || (!NeedPrint))&& printerr<=5)
{ {
if (isTimeOut)
printerr++;
else
printerr = 0;
WarnMsg = "";
ClearTimeoutAlarm("打印标签状态完成"); ClearTimeoutAlarm("打印标签状态完成");
ClearTimeoutAlarm("打印标签任务完成"); ClearTimeoutAlarm("打印标签任务完成");
...@@ -698,10 +708,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -698,10 +708,20 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsTimeOut(20)) else if (MoveInfo.IsTimeOut(20))
{ {
WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 打印标签状态完成(OL03_PrintLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]"; if (printerr > 5)
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType, SecMoveInfo.logSeconds()); {
Alarm(AlarmType.IoSingleTimeOut); // WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 打印标签状态完成(OL03_PrintLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
NeedAlarm = true;
WarnMsg = SecMoveInfo.Name + $"打印标签状态错误:{printerr}次,可能需要更换标签 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType, SecMoveInfo.logSeconds());
//Alarm(AlarmType.IoSingleTimeOut);
//NeedAlarm = true;
}
else {
WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 打印标签状态完成(OL03_PrintLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType, SecMoveInfo.logSeconds());
}
} }
} }
else if (MoveInfo.IsTimeOut(60)) else if (MoveInfo.IsTimeOut(60))
...@@ -832,9 +852,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -832,9 +852,17 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SecMoveInfo.IsTimeOut(120)) else if (SecMoveInfo.IsTimeOut(120))
{ {
WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 料盘可贴标(OS_25_WaitLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]"; if (HasWorkingShelf)
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType, SecMoveInfo.logSeconds()); {
Alarm(AlarmType.IoSingleTimeOut); WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 料盘可贴标(OS_25_WaitLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType, SecMoveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut);
}
else
{
SecMoveInfo.LastSetpTime = DateTime.Now;
WarnMsg = "等待出料线装填料串";
}
} }
} }
else if (SecMoveInfo.IsStep(StepEnum.OL11_XYToP3)) else if (SecMoveInfo.IsStep(StepEnum.OL11_XYToP3))
...@@ -850,6 +878,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -850,6 +878,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SecMoveInfo.IsStep(StepEnum.OL13_RToP3)) else if (SecMoveInfo.IsStep(StepEnum.OL13_RToP3))
{ {
WarnMsg = "";
if (SecMoveInfo.MoveParam.PlateW.Equals(7)) if (SecMoveInfo.MoveParam.PlateW.Equals(7))
{ {
SecMoveInfo.NextMoveStep(StepEnum.OL14_PasteForward); SecMoveInfo.NextMoveStep(StepEnum.OL14_PasteForward);
......
...@@ -19,6 +19,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -19,6 +19,9 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
public bool HasWorkingShelf { get => ShelfMoveInfo.IsStep(StepEnum.OS_20_ShelfReady); }
#region 料串处理 #region 料串处理
private void StartShelfMove() private void StartShelfMove()
...@@ -241,6 +244,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -241,6 +244,7 @@ namespace OnlineStore.DeviceLibrary
{ {
ShelfMoveInfo.NextMoveStep(StepEnum.OS_20_ShelfReady); ShelfMoveInfo.NextMoveStep(StepEnum.OS_20_ShelfReady);
ShelfMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); ShelfMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
} }
} }
......
...@@ -31,6 +31,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -31,6 +31,7 @@ namespace OnlineStore.DeviceLibrary
public Robot_Config Config = null; public Robot_Config Config = null;
private bool canStart = false; private bool canStart = false;
public SQLite sQLite = null; public SQLite sQLite = null;
public bool LoadSuccess = false;
public RobotBean(Robot_Config lineConfig, InputEquip_Config fconfig, XRay_Config xconfig, OutputEquip_Config pconfig) public RobotBean(Robot_Config lineConfig, InputEquip_Config fconfig, XRay_Config xconfig, OutputEquip_Config pconfig)
{ {
equipsMap = new Dictionary<int, EquipBase>(); equipsMap = new Dictionary<int, EquipBase>();
...@@ -87,11 +88,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -87,11 +88,15 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = true; mainTimer.Enabled = true;
//ledProcessTimer.Enabled = true; //ledProcessTimer.Enabled = true;
canStart = true; canStart = true;
var loadsuccess = XrayBean.XPlateUP();
AgvClient.Init(); AgvClient.Init();
string dataFile =Application.StartupPath+ ConfigAppSettings.GetValue(Setting_Init.DataPath); string dataFile =Application.StartupPath+ ConfigAppSettings.GetValue(Setting_Init.DataPath);
sQLite = new SQLite(dataFile); sQLite = new SQLite(dataFile);
bool result = sQLite.Connect(); bool result = sQLite.Connect();
LogUtil.info(Name + "连接【" + dataFile + "】结果: " + result+","+sQLite.ErrInfo); LogUtil.info(Name + "连接【" + dataFile + "】结果: " + result+","+sQLite.ErrInfo);
LoadSuccess = loadsuccess;
}); });
} }
......
...@@ -4,8 +4,10 @@ using OnlineStore.LoadCSVLibrary; ...@@ -4,8 +4,10 @@ using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net.NetworkInformation;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -54,7 +56,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -54,7 +56,7 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Elapsed += IoCheckTimerProcess; IoCheckTimer.Elapsed += IoCheckTimerProcess;
MoveInfo = new RobotMoveInfo(Name); MoveInfo = new RobotMoveInfo(Name);
SecMoveInfo = new RobotMoveInfo(Name.Trim() + "-SMove"); SecMoveInfo = new RobotMoveInfo(Name.Trim() + "-SMove");
XrayImage.setProcessLevel(4); XrayImage.setProcessLevel(2);
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
XRayLoad(); XRayLoad();
...@@ -66,15 +68,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,15 +68,11 @@ namespace OnlineStore.DeviceLibrary
/// 图像平板报错 /// 图像平板报错
/// </summary> /// </summary>
public bool carerayImageError = false; public bool carerayImageError = false;
private void XRayLoad() private bool XRayLoad()
{ {
try try
{ {
xrayImage = new XrayImage("XRay",XrayImage.DeviceType.CARREY);
//xrayImage = new CarerayImage("XRay");
bool cResult = xrayImage.Open();
LogUtil.info(Name + "carerayImage.Open()=" + cResult);
carerayImageError = !cResult;
xRay = new XRay("XRay"); xRay = new XRay("XRay");
xRay.WarmUp += XRay_WarmUp; xRay.WarmUp += XRay_WarmUp;
...@@ -103,13 +101,93 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,13 +101,93 @@ namespace OnlineStore.DeviceLibrary
{ {
ResultMinCount = 100; ResultMinCount = 100;
} }
return true;
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("XRayLoad 出错:" + ex.ToString()); LogUtil.error("XRayLoad 出错:" + ex.ToString());
} }
return true;
} }
public bool ISXPlateReady = false;
public bool XPlateUP()
{
IOMove(IO_Type.X_Xplate_Power, IO_VALUE.HIGH);
LogUtil.info(Name + " 开始启动x光平板");
var p = Process.GetProcessesByName("server");
if (p.Length > 0)
{
LogUtil.info(Name + " kill server");
p.ToList().ForEach((a) => { a.Kill(); });
}
Thread.Sleep(1 * 1000);
Ping ping = new Ping();
var firstping = false;
var secondping = false;
var lastping = false;
int timecount = 0;
while (true)
{
var rr = ping.Send("192.168.68.1", 5);
if (rr.Status == IPStatus.Success)
{
if (!lastping && !firstping)
{
LogUtil.info(Name + " x光平板,第一次ping通");
firstping = true;
Thread.Sleep(1000 * 15);
}
if (!lastping && firstping && !secondping)
{
LogUtil.info(Name + " x光平板,第二次ping通");
secondping = true;
Thread.Sleep(1000 * 10);
break;
}
lastping = true;
}
else
{
LogUtil.info(Name + " x光平板,未ping通");
lastping = false;
}
Thread.Sleep(500);
timecount++;
if (timecount > 120 * 100 / 500)
{
LogUtil.info(Name + " x光平板,启动超时");
return false;
}
}
if (xrayImage != null)
{
try
{
xrayImage.Close();
}
catch { }
}
xrayImage = new XrayImage("XRay", XrayImage.DeviceType.CARREY);
//xrayImage = new CarerayImage("XRay");
bool cResult = xrayImage.Open();
LogUtil.info(Name + "carerayImage.Open()=" + cResult);
carerayImageError = !cResult;
if (carerayImageError)
XPlateUP();
this.MoveStop = false;
ISXPlateReady = true;
return true;
}
public void XPlateReStart()
{
ISXPlateReady = false;
IOMove(IO_Type.X_Xplate_Power, IO_VALUE.LOW);
Thread.Sleep(1000*3);
XPlateUP();
}
public void XRayDispose() public void XRayDispose()
{ {
try try
......
...@@ -250,7 +250,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -250,7 +250,7 @@ namespace OnlineStore.DeviceLibrary
{ {
TickLog("打开xray", true); TickLog("打开xray", true);
MoveInfo.NextMoveStep(StepEnum.XW13_GetXRayImage); MoveInfo.NextMoveStep(StepEnum.XW13_GetXRayImage);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(80000));
WorkLog("点料:清理" + path1_tif + "内容,开始获取X射线图形 "); WorkLog("点料:清理" + path1_tif + "内容,开始获取X射线图形 ");
if (string.IsNullOrEmpty(CapImage())) if (string.IsNullOrEmpty(CapImage()))
...@@ -276,18 +276,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -276,18 +276,35 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW); IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW);
MoveInfo.TimeOutSeconds = 120; MoveInfo.TimeOutSeconds = 120;
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_Lock_On, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_Lock_On, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Out_TrayCheck, IO_VALUE.LOW)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Out_TrayCheck, IO_VALUE.LOW));
} }
#endregion #endregion
else if (MoveInfo.IsStep(StepEnum.XW16_EndCount)) else if (MoveInfo.IsStep(StepEnum.XW16_EndCount))
{ {
MoveInfo.NextMoveStep(StepEnum.XW21_WaitOutNoReel); if (IOValue(IO_Type.Out_TrayCheck).Equals(IO_VALUE.LOW))
MoveInfo.TimeOutSeconds = 120; {
WorkLog("料盘处理:等待出口无料盘", 0); MoveInfo.NextMoveStep(StepEnum.XW21_WaitOutNoReel);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Out_TrayCheck, IO_VALUE.LOW)); //MoveInfo.TimeOutSeconds = 120;
WorkLog("料盘处理:出口无料盘继续", 0);
}
else if (RobotManager.robot.outputEquip.HasWorkingShelf)
{
if (MoveInfo.IsTimeOut(120)) {
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待 出口皮带线料盘离开X57=Low 超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, MoveInfo.ErrorLogType, MoveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut);
}
}
else {
LogUtil.error("当前出口没有料串", MoveInfo.ErrorLogType);
MoveInfo.NextMoveStep(StepEnum.XW16_EndCount);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
WarnMsg = "等待出料线装填料串";
}
} }
else if (MoveInfo.IsStep(StepEnum.XW21_WaitOutNoReel)) else if (MoveInfo.IsStep(StepEnum.XW21_WaitOutNoReel))
{ {
WarnMsg = "";
//判断取料机构是否正转夹料 //判断取料机构是否正转夹料
bool ingetWare = RobotManager.robot.outputEquip.IsInGetWare(); bool ingetWare = RobotManager.robot.outputEquip.IsInGetWare();
...@@ -403,7 +420,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -403,7 +420,7 @@ namespace OnlineStore.DeviceLibrary
private void XW12_XRayStart() private void XW12_XRayStart()
{ {
MoveInfo.NextMoveStep(StepEnum.XW12_XRayStart); MoveInfo.NextMoveStep(StepEnum.XW12_XRayStart);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
InXWork = true; InXWork = true;
bool result = xRay.Start(); bool result = xRay.Start();
WorkLog("料盘处理:启动X射线[" + result + "],等待1秒"); WorkLog("料盘处理:启动X射线[" + result + "],等待1秒");
...@@ -513,7 +530,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -513,7 +530,8 @@ namespace OnlineStore.DeviceLibrary
Work_ReelInfo.NgMsg = NgMsg; Work_ReelInfo.NgMsg = NgMsg;
outF = NgMsg; outF = NgMsg;
} }
int c = RobotManager.robot.sQLite.Insert(Work_ReelInfo.WareCode, Work_ReelInfo.PlateW, Work_ReelInfo.PlateH, count, outF);
int c = RobotManager.robot.sQLite.Insert(Work_ReelInfo.WareCode, Work_ReelInfo.PlateW, Work_ReelInfo.PlateH, count, lastParam.Sign.ToString()+ ";"+ outF);
LogUtil.info("插入数据【" + Work_ReelInfo.WareCode + "】【" + count + "】【" + outF + "】结果:" + c + " ," + RobotManager.robot.sQLite.ErrInfo); LogUtil.info("插入数据【" + Work_ReelInfo.WareCode + "】【" + count + "】【" + outF + "】结果:" + c + " ," + RobotManager.robot.sQLite.ErrInfo);
} }
catch (Exception ex) catch (Exception ex)
...@@ -583,6 +601,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -583,6 +601,15 @@ namespace OnlineStore.DeviceLibrary
} }
} }
carerayImageError = !imgResult; carerayImageError = !imgResult;
if (carerayImageError)
{
LogUtil.error(Name + "carerayImage.Open 无法打开,开始重启");
XPlateReStart();
LogUtil.info(Name + "carerayImage 重启完成");
MoveInfo.EndStepWait();
MoveInfo.NextMoveStep(StepEnum.XW12_XRayStart);
return "";
}
xrayImage.WindowWidth = Config.WindowWidth; xrayImage.WindowWidth = Config.WindowWidth;
xrayImage.WindowLevel = Config.WindowLevel; xrayImage.WindowLevel = Config.WindowLevel;
if (imgResult) if (imgResult)
......
...@@ -70,9 +70,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -70,9 +70,9 @@ namespace OnlineStore.DeviceLibrary
//bool result = false; //bool result = false;
//CountParam lastParam = new CountParam("", ThresholdValue, 3); //CountParam lastParam = new CountParam("", ThresholdValue, 3);
string pn = GetCodeStrPN(codeStr); string pn = GetCodeStrPN(codeStr);
var pns = pn.Split('.'); //var pns = pn.Split('.');
if (pns.Length == 3) //if (pns.Length == 3)
pn = pns[0] +"."+ pns[2]; // pn = pns[0] +"."+ pns[2];
if (countParamMap.ContainsKey(pn)) if (countParamMap.ContainsKey(pn))
{ {
CountParam lastParam = countParamMap[pn]; CountParam lastParam = countParamMap[pn];
...@@ -261,9 +261,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -261,9 +261,9 @@ namespace OnlineStore.DeviceLibrary
{ {
public CountParam(string pn, int th = 0, int size = 0, SignType sign=SignType.AUTO, int value = 0) public CountParam(string pn, int th = 0, int size = 0, SignType sign=SignType.AUTO, int value = 0)
{ {
var pns = pn.Split('.'); //var pns = pn.Split('.');
if (pns.Length == 3) //if (pns.Length == 3)
pn = pns[0] + "." + pns[2]; // pn = pns[0] + "." + pns[2];
this.PN = pn; this.PN = pn;
this.Threshold = th; this.Threshold = th;
this.WindowSize = size; this.WindowSize = size;
...@@ -295,15 +295,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -295,15 +295,15 @@ namespace OnlineStore.DeviceLibrary
if (array.Length >= 5) if (array.Length >= 5)
{ {
string pn = array[0].Trim(); string pn = array[0].Trim();
var pns = pn.Split('.'); //var pns = pn.Split('.');
if (pns.Length == 3) //if (pns.Length == 3)
pn = pns[0] + "." + pns[2]; // pn = pns[0] + "." + pns[2];
SignType sign = SignType.AUTO; SignType sign = SignType.AUTO;
Enum.TryParse<SignType>(array[1].Trim(), out sign); Enum.TryParse<SignType>(array[1].Trim(), out sign);
int value = Convert.ToInt32(array[2].Trim()); int value = 0;// Convert.ToInt32(array[2].Trim());
int th = Convert.ToInt32(array[3].Trim()); int th =0;// Convert.ToInt32(array[3].Trim());
int size = Convert.ToInt32(array[4].Trim()); int size = 0;//Convert.ToInt32(array[4].Trim());
return new CountParam(pn, th, size, sign, value); return new CountParam(pn, th, size, sign, value);
} }
} }
......
...@@ -524,6 +524,10 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -524,6 +524,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DI,2,扫描区域阻挡气缸放行端,X_StopCylinder_Up,12,PRO_AOI_IP_6,X103,,,,,,,,,, /// DI,2,扫描区域阻挡气缸放行端,X_StopCylinder_Up,12,PRO_AOI_IP_6,X103,,,,,,,,,,
/// </summary> /// </summary>
public static string X_StopCylinder_Up = "X_StopCylinder_Up"; public static string X_StopCylinder_Up = "X_StopCylinder_Up";
/// <summary>
/// DI,2,X光图像平板电源,X_Xplate_Power,12,PRO_AOI_IP_6,X104,,,,,,,,,,
/// </summary>
public static string X_Xplate_Power = "X_Xplate_Power";
///// <summary> ///// <summary>
///// DO,2,自动指示灯,AutoRun_HddLed,0,PRO_AOI_IP_6,Y91,,,,,,,,,, ///// DO,2,自动指示灯,AutoRun_HddLed,0,PRO_AOI_IP_6,Y91,,,,,,,,,,
///// </summary> ///// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!