Commit a274958c LN

移栽模块出库过程中或还有出库任务,不能入库,完全出库完成再入库

1 个父辈 afb5dcce
......@@ -95,7 +95,7 @@
this.panel1.Controls.Add(this.btnReset);
this.panel1.Location = new System.Drawing.Point(2, 1);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1303, 56);
this.panel1.Size = new System.Drawing.Size(1312, 56);
this.panel1.TabIndex = 258;
//
// btnScan
......@@ -206,10 +206,10 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Location = new System.Drawing.Point(5, 60);
this.tabControl1.Location = new System.Drawing.Point(4, 60);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1307, 519);
this.tabControl1.Size = new System.Drawing.Size(1310, 519);
this.tabControl1.TabIndex = 257;
//
// tabPage1
......@@ -223,7 +223,7 @@
this.tabPage1.Location = new System.Drawing.Point(4, 26);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1299, 489);
this.tabPage1.Size = new System.Drawing.Size(1302, 489);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " IO列表 ";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -236,9 +236,9 @@
this.groupBox2.Controls.Add(this.btnlineStop);
this.groupBox2.Controls.Add(this.cmbLineType);
this.groupBox2.Controls.Add(this.btnLine1Test);
this.groupBox2.Location = new System.Drawing.Point(495, 157);
this.groupBox2.Location = new System.Drawing.Point(491, 157);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(797, 66);
this.groupBox2.Size = new System.Drawing.Size(805, 66);
this.groupBox2.TabIndex = 279;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "皮带转动测试";
......@@ -325,9 +325,9 @@
this.groupBox6.Controls.Add(this.lblTrayNum);
this.groupBox6.Controls.Add(this.lblInstoreList);
this.groupBox6.Controls.Add(this.lblMoveInfo);
this.groupBox6.Location = new System.Drawing.Point(495, 227);
this.groupBox6.Location = new System.Drawing.Point(491, 227);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(797, 256);
this.groupBox6.Size = new System.Drawing.Size(808, 256);
this.groupBox6.TabIndex = 278;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "消息";
......@@ -342,7 +342,7 @@
this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblThisSta.Location = new System.Drawing.Point(271, 14);
this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(520, 137);
this.lblThisSta.Size = new System.Drawing.Size(531, 137);
this.lblThisSta.TabIndex = 246;
this.lblThisSta.Text = "等待启动";
this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
......@@ -367,7 +367,7 @@
this.lblInstoreList.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblInstoreList.Location = new System.Drawing.Point(267, 228);
this.lblInstoreList.Name = "lblInstoreList";
this.lblInstoreList.Size = new System.Drawing.Size(524, 53);
this.lblInstoreList.Size = new System.Drawing.Size(535, 53);
this.lblInstoreList.TabIndex = 277;
//
// lblMoveInfo
......@@ -413,7 +413,7 @@
this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox4.Controls.Add(this.tableLayoutPanel2);
this.groupBox4.Location = new System.Drawing.Point(251, 6);
this.groupBox4.Location = new System.Drawing.Point(248, 6);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(240, 477);
this.groupBox4.TabIndex = 104;
......@@ -450,7 +450,7 @@
this.groupBox5.Controls.Add(this.btnStop1Up);
this.groupBox5.Location = new System.Drawing.Point(876, 6);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(416, 147);
this.groupBox5.Size = new System.Drawing.Size(424, 147);
this.groupBox5.TabIndex = 255;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "IO操作测试";
......@@ -573,9 +573,9 @@
this.groupBox1.Controls.Add(this.txtSlaveId);
this.groupBox1.Controls.Add(this.cmbWriteIO);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(495, 6);
this.groupBox1.Location = new System.Drawing.Point(491, 6);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(374, 147);
this.groupBox1.Size = new System.Drawing.Size(382, 147);
this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入";
......
20200324
1.入库逻辑修改:提升轴先上升后需要下降到料盘不溢出的位置,横移气缸才能动作。
2.出料模块取料条件修改:随意放时需要等皮带线空闲。
3.移栽模块出库过程中或还有出库任务,不能入库,完全出库完成再入库
20200323
......
......@@ -620,20 +620,9 @@ namespace OnlineStore.DeviceLibrary
msg += "LastTP:" + TrayLine1.LastTrayPosition + " " + TrayLine2.LastTrayPosition + " " + Line3LastTrayP + " " + "\n";
msg += "LIsRun:" + TrayLine1.IsInTurn() + " " + TrayLine2.IsInTurn() + " " + Line3Turn.InTurn + " " + "\n";
msg += "L3CanRun:" + TrayLine1.Line3CanRun + " " + TrayLine2.Line3CanRun + " " + "\n";
//msg += "LastWidth:" + LastWidth+"\n";
//if (IsNewType)
//{
msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.MoveStep + " " + LastWidth + "=" + StationInfo_Move.CodeStr + "\n";
//}
//else
//{
// msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.MoveStep + " " + LastWidth + "=" + StationInfo_Move.CodeStr + "\n";
//}
msg += "NG 工位:" + StationInfo_NG.ToStr + "\n";
msg += "扫码工位:" + StationInfo_Scan.ToStr + "\n";
//msg += "IsInScanCode:" + IsInScanCode;
// msg += "LastWidth:" + LastWidth + "\n";
msg += "NG 位:" + StationInfo_NG.ToStr + "\n";
msg += "扫码位:" + StationInfo_Scan.ToStr + "\n";
return msg;
}
public override bool StartInStoreMove(InOutParam param)
......
......@@ -20,7 +20,7 @@ namespace OnlineStore.DeviceLibrary
//等待信号亮或者走到绝对位置才停止
if (IOValue(TargetIoType).Equals(TargetIoValue))
{
LogUtil.debug(Name+"CheckWaitResult 检测到" + TargetIoType + "=" + TargetIoValue + ",停止运行");
LogUtil.debug(Name + "CheckWaitResult 检测到" + TargetIoType + "=" + TargetIoValue + ",停止运行");
BatchAxisStopCheck();
if (ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1))
{
......@@ -50,10 +50,10 @@ namespace OnlineStore.DeviceLibrary
}
public override void CheckAlarmProcess(LineMoveInfo moveInfo, LineAlarmType alarmType)
{
if (moveInfo.MoveType.Equals(LineMoveStep.FI_18_WaitNoLocationCheck)&&alarmType.Equals(LineAlarmType.IoSingleTimeOut))
if (moveInfo.MoveType.Equals(LineMoveStep.FI_18_WaitNoLocationCheck) && alarmType.Equals(LineAlarmType.IoSingleTimeOut))
{
string code = CodeManager.ProcessCode(LastCodeList);
LogUtil.error(moveInfo.Name + " [" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待SL_AxisLocationCheck=LOW超时,清空当前料盘条码:"+code);
string code = CodeManager.ProcessCode(LastCodeList);
LogUtil.error(moveInfo.Name + " [" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待SL_AxisLocationCheck=LOW超时,清空当前料盘条码:" + code);
LastCodeList = new List<string>();
}
}
......@@ -61,8 +61,8 @@ namespace OnlineStore.DeviceLibrary
#region 托盘检测
private InOutParam CheckParam = new InOutParam();
internal DateTime lastStopDown = DateTime.Now;
internal DateTime lastStopDown = DateTime.Now;
private Stopwatch swWaitWatch = new Stopwatch();
private object lockObj = "";
......@@ -74,12 +74,12 @@ namespace OnlineStore.DeviceLibrary
{
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
return;
}
}
if (!LineManager.Line.CanProcessLine())
{
swWaitWatch.Stop();
swWaitWatch.Stop();
return;
}
......@@ -88,7 +88,7 @@ namespace OnlineStore.DeviceLibrary
bool canProcess = (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH))
{
if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false ) && canProcess)
if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false) && canProcess)
{
swWaitWatch.Stop();
UpdateTrayNum();
......@@ -110,16 +110,16 @@ namespace OnlineStore.DeviceLibrary
else if (Config.SidesWayNum.Equals(2) && IOValue(IO_Type.SW_StopCheck).Equals(IO_VALUE.HIGH)
&& (DateTime.Now - lastStopDown).TotalSeconds > 3)
{
if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false ) && canProcess)
if (TrayManager.checkWatch(swWaitWatch, TrayManager.SwTrayWaitTime, false) && canProcess)
{
swWaitWatch.Stop();
lastStopDown = DateTime.Now;
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
LogUtil.debug(Name + " [" + trayCount + "] 检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,等待 SW_StopCheck=0");
//CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,等待 SW_StopCheck=0" );
IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH,1200);
IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH, 1200);
SecondMoveInfo.OneWaitCanEndStep = true;
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
//SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.HIGH));
......@@ -183,7 +183,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " StartCheckFixture " + "失败,未得到锁");
}
}
protected override void CheckFixtureProcess()
{
if (!LineManager.Line.LineCanRun())
......@@ -437,7 +437,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(WarnMsg, DeviceID + 11);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
}
}
private void TrayMoveOk()
{
......@@ -467,7 +467,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
if (!Config.SidesWayNum.Equals(2))
{
{
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
}
}
......@@ -475,7 +475,7 @@ namespace OnlineStore.DeviceLibrary
else
{
if (CylinderIsOk(IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down))
{
{
MO_15_WaitCanGo();
}
else
......@@ -503,7 +503,7 @@ namespace OnlineStore.DeviceLibrary
}
private void SMoveEnd()
{
lastStopDown = DateTime.Now.AddSeconds(-2);
lastStopDown = DateTime.Now.AddSeconds(-2);
SecondMoveInfo.EndMove();
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
......@@ -530,10 +530,10 @@ namespace OnlineStore.DeviceLibrary
ShelfEnterProcess();
}
}
return false;
}
public override bool StartInStoreMove(InOutParam param)
public override bool StartInStoreMove(InOutParam param)
{
runStatus = LineRunStatus.Busy;
lineStatus = LineStatus.InStoreExecute;
......@@ -550,7 +550,7 @@ namespace OnlineStore.DeviceLibrary
InLog("检测到料架, " + MoveInfo.MoveStep + " :升降盘定位气缸下降");
TrayLCylinderAfter(MoveInfo);
}
return true ;
return true;
}
private void FI_04_WaitTime()
......@@ -562,7 +562,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
private void LineInStoreProcess()
{
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
......@@ -577,7 +577,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart);
InLog("入料检测: " + MoveInfo.SLog + " 阻挡工位检测有料架,进料阻挡下降1000,流水线转动 1000");
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH,1000);//进料阻挡下降
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH, 1000);//进料阻挡下降
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待指定时间
......@@ -733,6 +733,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_WaitNoLocationCheck))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_19_BatchAxisToP3);
LastWidth = GetWidth();
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,盘宽【" + LastWidth + "】,横移气缸上升 ");
if (!CylinderIsOk(IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up))
{
......@@ -743,20 +744,19 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_BatchAxisToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
//if (MoveCylineCanTakeOrGive())
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderGive);
// InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
// CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
//}
//else
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
// InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
// CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//}
if (MoveCylineIsUp())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderGive);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
LastWidth = GetWidth();
LastHeight = GetHeight();
if (LastWidth.Equals(7) && LastHeight > 16)
{
......@@ -770,8 +770,8 @@ namespace OnlineStore.DeviceLibrary
int chaz = Math.Abs(currP - Config.BatchAxisP3);
if (chaz < BatchAxis.Config.CanErrorCountMax)
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
// MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
InLog("料盘移栽" + MoveInfo.SLog + ":记录 高度【" + LastHeight + "】宽度【" + LastWidth + "】,已经没有料盘,且已达到P3:" + Config.BatchAxisP3 + ",提升轴开始回下降待机点P2");
MoveInfo.ShelfNoTray = true;
BatchAxis.AbsMove(null, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
......@@ -789,25 +789,25 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_SaveSize))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
int maxtPosition = Config.BatchAxisP3 - Config.Height_ChangeValue * 30; //在上料位置基础上下降30mm
int currPositon = BatchAxis.GetAclPosition();
// MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
// int maxtPosition = Config.BatchAxisP3 - Config.Height_ChangeValue * 30; //在上料位置基础上下降30mm
// int currPositon = BatchAxis.GetAclPosition();
int targetPosition = currPositon - Config.Height_ChangeValue * 30;
if (targetPosition <= Config.BatchAxisP2)
{
targetPosition = Config.BatchAxisP2;
}
else if (targetPosition > maxtPosition)
{
targetPosition = maxtPosition;
}
InLog("料盘移栽" + MoveInfo.SLog + ":提升轴下降到料盘不溢出(" + (currPositon - Config.Height_ChangeValue * 40) + "):" + targetPosition);
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_BatchAxisDown))
{
// int targetPosition = currPositon - Config.Height_ChangeValue * 30;
// if (targetPosition <= Config.BatchAxisP2)
// {
// targetPosition = Config.BatchAxisP2;
// }
// else if (targetPosition > maxtPosition)
// {
// targetPosition = maxtPosition;
// }
// InLog("料盘移栽" + MoveInfo.SLog + ":提升轴下降到料盘不溢出(" + (currPositon - Config.Height_ChangeValue * 30) + "):" + targetPosition);
// BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
//}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_BatchAxisDown))
//{
if (MoveCylineIsUp())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderGive);
......@@ -816,7 +816,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
......@@ -826,37 +826,12 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_23_WaitTray);
int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth);
string log = ":移栽伺服下降到P2:" + targetPositon;
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 " + log + "");
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
//TODO 此处需要等待空托盘
if (MoveInfo.ShelfNoTray.Equals(false) && isScan)
{
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 " + log + ",预扫码");
//还有料盘,直接扫码
NextCodeList = new List<string>();
try
{
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
YuScanCode();
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
if (NextCodeList.Count <= 0)
{
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
}
return NextCodeList;
});
}
catch (Exception ex)
{
LogUtil.error(" 为下一盘料扫码出错:", ex);
}
}
else
{
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 " + log + "");
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_WaitTray))//TODO
......@@ -869,9 +844,9 @@ namespace OnlineStore.DeviceLibrary
//UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
MoveInfo.NextMoveStep(LineMoveStep.FI_24_CylinderDown);
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息");
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息 , 提升轴下降指定位置");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
FI_21_BatchAxisDown();
Task.Factory.StartNew(delegate
{
//更新托盘条码信息
......@@ -919,9 +894,17 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_CylinderRelax))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_26_CylinderUp);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升 ");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW) && MoveInfo.ShelfNoTray.Equals(false))
{
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升,上料轴开始慢速上升到P3点,等待检测到料盘");
BatchAxisToP3();
}
else
{
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升 ");
}
if (Config.SidesWayNum > 0)
{
InLog(MoveInfo.SLog + " 提前下降顶升气缸 ,环形线定位气缸先下降");
......@@ -1033,8 +1016,55 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
}
}
private void FI_21_BatchAxisDown()
{
// MoveInfo.NextMoveStep(LineMoveStep.FI_21_BatchAxisDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
int maxtPosition = Config.BatchAxisP3 - Config.Height_ChangeValue * 30; //在上料位置基础上下降30mm
int currPositon = BatchAxis.GetAclPosition();
int targetPosition = currPositon - Config.Height_ChangeValue * 30;
if (targetPosition <= Config.BatchAxisP2)
{
targetPosition = Config.BatchAxisP2;
}
else if (targetPosition > maxtPosition)
{
targetPosition = maxtPosition;
}
InLog("料盘移栽" + MoveInfo.SLog + ":提升轴下降到料盘不溢出(" + (currPositon - Config.Height_ChangeValue * 30) + "):" + targetPosition);
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
}
private void YuScanCode()
{
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
//TODO 此处需要等待空托盘
if (MoveInfo.ShelfNoTray.Equals(false) && isScan)
{
InLog("料盘移栽" + MoveInfo.SLog + ": ,预扫码");
//还有料盘,直接扫码
NextCodeList = new List<string>();
try
{
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
if (NextCodeList.Count <= 0)
{
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
}
return NextCodeList;
});
}
catch (Exception ex)
{
LogUtil.error(" 为下一盘料扫码出错:", ex);
}
}
}
private void FI_12_MoveCylinder_Give()
{
if (MoveCylineIsUp())
......@@ -1053,7 +1083,7 @@ namespace OnlineStore.DeviceLibrary
}
private void FI_13_ScanCode()
{
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW))
if (CylinderIsOk(IO_Type.SL_MoveCylinder_Take,IO_Type.SL_MoveCylinder_Give))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
......@@ -1066,6 +1096,9 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
LastCodeList = new List<string>(NextCodeList);
NextCodeList = new List<string>();
MoveInfo.NextMoveStep(LineMoveStep.FI_14_CylinderTake);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else if (isScan)
{
......@@ -1274,9 +1307,9 @@ namespace OnlineStore.DeviceLibrary
if (trayCanUse && runStatus.Equals(LineRunStatus.Busy) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{
//入料执行中, 且需要空托盘
if (MoveInfo.MoveStep .Equals(LineMoveStep.FI_23_WaitTray)&&MoveInfo.IsInWait.Equals(false))
if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_WaitTray) && MoveInfo.IsInWait.Equals(false))
//if (MoveInfo.MoveStep >= LineMoveStep.FI_11_CylinderUp && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
{
{
if (NeedSaveParam)
{
CheckParam = param;
......
......@@ -460,6 +460,17 @@ namespace OnlineStore.DeviceLibrary
{
return false;
}
//如果正在出库执行中,不能拦截入库托盘
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
return false;
}
else if (waitOutStoreList.Count > 0)
{
return false;
}
bool isfull = TrayManager.TrayIsFull(currTrayNum);
//LogInfo("***************入库*****验证入库编号,托盘号【" + currTrayNum + "】,isfull【" + isfull + "】");
//FixtureCodeInfo code = GetBox().currInOutFixture;
......
......@@ -660,10 +660,10 @@ namespace OnlineStore.DeviceLibrary
/// 料盘移栽:记录高度尺寸
/// </summary>
FI_20_SaveSize ,
/// <summary>
/// 提升轴下降到料盘不溢出的位置
/// </summary>
FI_21_BatchAxisDown,
///// <summary>
///// 提升轴下降到料盘不溢出的位置
///// </summary>
//FI_21_BatchAxisDown,
/// <summary>
/// 料盘移栽: 上料横移气缸放料SOL
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!