Commit c4b8bec5 LN

增加读托盘号

1 个父辈 04bea6bc
......@@ -92,6 +92,7 @@
this.btnMoveto = new System.Windows.Forms.Button();
this.txtSizePosition = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.chbBoxSendShelf = new System.Windows.Forms.CheckBox();
this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.lblName = new System.Windows.Forms.Label();
this.btnScan = new System.Windows.Forms.Button();
......@@ -595,7 +596,7 @@
//
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(651, 15);
this.chbDebug.Location = new System.Drawing.Point(651, 13);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 247;
......@@ -623,7 +624,7 @@
this.lblStoreStatus.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStoreStatus.ForeColor = System.Drawing.Color.Green;
this.lblStoreStatus.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblStoreStatus.Location = new System.Drawing.Point(835, 17);
this.lblStoreStatus.Location = new System.Drawing.Point(979, 15);
this.lblStoreStatus.Name = "lblStoreStatus";
this.lblStoreStatus.Size = new System.Drawing.Size(65, 20);
this.lblStoreStatus.TabIndex = 245;
......@@ -1113,6 +1114,7 @@
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.chbBoxSendShelf);
this.panel1.Controls.Add(this.chbMoveStop);
this.panel1.Controls.Add(this.lblName);
this.panel1.Controls.Add(this.btnScan);
......@@ -1126,11 +1128,23 @@
this.panel1.Size = new System.Drawing.Size(1306, 47);
this.panel1.TabIndex = 258;
//
// chbBoxSendShelf
//
this.chbBoxSendShelf.AutoSize = true;
this.chbBoxSendShelf.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbBoxSendShelf.Location = new System.Drawing.Point(831, 13);
this.chbBoxSendShelf.Name = "chbBoxSendShelf";
this.chbBoxSendShelf.Size = new System.Drawing.Size(140, 24);
this.chbBoxSendShelf.TabIndex = 251;
this.chbBoxSendShelf.Text = "出库完成送出料架";
this.chbBoxSendShelf.UseVisualStyleBackColor = true;
this.chbBoxSendShelf.CheckedChanged += new System.EventHandler(this.chbBoxSendShelf_CheckedChanged);
//
// chbMoveStop
//
this.chbMoveStop.AutoSize = true;
this.chbMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMoveStop.Location = new System.Drawing.Point(741, 15);
this.chbMoveStop.Location = new System.Drawing.Point(741, 13);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(84, 24);
this.chbMoveStop.TabIndex = 250;
......@@ -1281,6 +1295,7 @@
private System.Windows.Forms.Label lblwidth;
private System.Windows.Forms.Button btnFLStop1;
private System.Windows.Forms.Button btnFLStop2Down;
private System.Windows.Forms.CheckBox chbBoxSendShelf;
}
}
......@@ -91,7 +91,7 @@ namespace OnlineStore.AssemblyLine
cmbWriteIO.DisplayMember = "DisplayStr";
}
private bool IsInCheck = false;
private void timer1_Tick(object sender, EventArgs e)
{
try
......@@ -121,6 +121,10 @@ namespace OnlineStore.AssemblyLine
FormStatus(false );
}
}
if (!equipBean.OutEndSendShelfOut.Equals(chbBoxSendShelf.Checked)&&(!IsInCheck))
{
chbBoxSendShelf.Checked = equipBean.OutEndSendShelfOut;
}
lblAgvInfo.Text = "AGV-" + equipBean.Config.AgvInName + " 状态:" + AgvClient.GetAction(equipBean.Config.AgvInName).ToString() +
"\t AGV-" + equipBean.Config.AgvOutName + " 状态:" + AgvClient.GetAction(equipBean.Config.AgvOutName).ToString() + "";
string canOut = equipBean.Config.IsCanOut.Equals(1) ? "紧急出料模块" : "入料模块";
......@@ -255,7 +259,9 @@ namespace OnlineStore.AssemblyLine
txtBp1.Text = equipBean.Config.BatchAxisP1.ToString();
txtBP2.Text = equipBean.Config.BatchAxisP2.ToString();
txtBP3.Text = equipBean.Config.BatchAxisP3.ToString();
lblName.Text = equipBean.Name;
lblName.Text = equipBean.Name;
chbBoxSendShelf.Visible = equipBean.Config.IsCanOut.Equals(1);
chbBoxSendShelf.Checked = equipBean.OutEndSendShelfOut;
IsLoad = true;
}
......@@ -543,8 +549,7 @@ namespace OnlineStore.AssemblyLine
}
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
{
if (!IsLoad)
{
return;
......@@ -559,16 +564,22 @@ namespace OnlineStore.AssemblyLine
}
private void btnFLStop1_Click(object sender, EventArgs e)
{
{
BtnMove(btnFLStop1, "FL阻挡1下降", "FL阻挡1上升", IO_Type.FL_StopCylinder_Down1);
}
private void btnFLStop2Down_Click(object sender, EventArgs e)
{
{
BtnMove(btnFLStop2Down, "FL阻挡2下降", "FL阻挡2上升", IO_Type.FL_StopCylinder_Down2);
}
private void chbBoxSendShelf_CheckedChanged(object sender, EventArgs e)
{
IsInCheck = true;
LogUtil.info(equipBean.Name + "用户点击:出库完成送出料架=" + chbBoxSendShelf.Checked);
equipBean.OutEndSendShelfOut = chbBoxSendShelf.Checked;
IsInCheck = false;
}
}
}
......
......@@ -297,7 +297,7 @@ namespace OnlineStore.AssemblyLine
return;
}
LogUtil.info(LOGGER, "开始启动");
startTimer.Interval = 1;
startTimer.Interval = 300;
startTimer.Elapsed += timer_Elapsed;
startTimer.Enabled = true;
this.timer1.Start();
......
......@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
public partial class FeedingEquip : EquipBase
{
public FeedingEquip_Config Config;
public bool OutEndSendShelfOut = false;
public AxisBean BatchAxis = null;
public FeedingEquip(string cid, FeedingEquip_Config config)
{
......@@ -356,7 +356,13 @@ namespace OnlineStore.DeviceLibrary
}
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None) && NoErrorAlarm())
{
StartCheckFixture();
if (Config.IsCanOut.Equals(0))
{
StartCheckFixture();
}else if (LineManager.Line.runStatus <= LineRunStatus.Wait)
{
StartCheckFixture();
}
}
IOTimeOutProcess();
}
......
......@@ -27,6 +27,7 @@ namespace OnlineStore.DeviceLibrary
bool isOk = ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0);
if (isOk)
{
//TODO 判断是否达到高度,如果未达到,继续上升
BatchAxisStopCheck();
return true;
}
......@@ -82,10 +83,10 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
TrayManager.UpdateSWState(Config.SidesWayNum, 2);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down);
CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,最多等待1秒");
CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,等待"+TrayManager.StopDownWaitTime);
IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
}
}
else
......@@ -146,7 +147,7 @@ namespace OnlineStore.DeviceLibrary
{
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸上升,等待SW_TrayCheck=1)");
IOMove(IO_Type.SW_StopDown, IO_VALUE.LOW);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH));
}
}
......@@ -262,13 +263,13 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_TopCylinder_Down))
{
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
if (Config.SidesWayNum > 0)
{
{
CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,等待托盘离开");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.LOW));
}
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_15_WaitCanGo))
{
......@@ -315,23 +316,22 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_200_WaitInoutParam))
{
if (MoveInfo.MoveType.Equals(LineMoveType.None))
if (MoveInfo.MoveType.Equals(LineMoveType.None) && StartTrayOut(SecondMoveInfo.MoveParam))
{
StartTrayOut(SecondMoveInfo.MoveParam);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_WaitOutEnd);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_WaitOutEnd);
}
else
{
TimeSpan span = DateTime.Now - MoveInfo.LastSetpTime;
if (span.TotalSeconds > 180)
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveType + "][" + SecondMoveInfo.MoveStep + "]等待横移机构空闲超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveType + "][" + SecondMoveInfo.MoveStep + "]等待横移机构空闲可出库超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID + 11);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
}
}
#endregion
......@@ -773,6 +773,8 @@ namespace OnlineStore.DeviceLibrary
#endregion
}
private void FI_12_MoveCylinder_Give()
{
if (MoveCylineCanTakeOrGive())
......@@ -843,7 +845,7 @@ namespace OnlineStore.DeviceLibrary
if (LastHeight <= 8) { LastHeight = 8; }
else
{
LastHeight = (int)Math.Ceiling(1F * (LastHeight - 2 - 4) / 4) * 4;
LastHeight = (int)Math.Floor(1F * (LastHeight) / 4) * 4;
}
if (LastHeight <= 8) { LastHeight = 8; }
LogUtil.info(msg + ",归类为" + LastHeight);
......
......@@ -11,20 +11,43 @@ namespace OnlineStore.DeviceLibrary
partial class FeedingEquip
{
#region 出料流程
private int OutStoreHeight = -1;
private bool StartTrayOut(InOutParam outParam)
internal bool CanStartCheckOut()
{
UpdateTrayNum();
if (CurrTrayIsNeed(currTrayNum, true))
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
TrayManager.UpdateSWState(Config.SidesWayNum, 2);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_06_TopCylinderUp);
CheckLog("检测到SW_TrayCheck:" + SecondMoveInfo.SLog + "横移顶升气缸上升 )");
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up);
return true;
}
else
{
// currTrayNum = num;
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
return false;
}
}
private bool StartTrayOut(InOutParam outParam)
{
if(outParam == null || outParam.PosId == null || outParam.PosId.Equals(""))
if (outParam == null || outParam.PosId == null || outParam.PosId.Equals(""))
{
LogUtil.error(Name + "出库失败,参数不完整:" ) ;
LogUtil.error(Name + "出库失败,参数不完整:");
LogUtil.error(outParam.ToStr());
return false ;
return false;
}
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.LOW) || OutStoreHeight < 0)
{
LogUtil.error(Name + "出库" + outParam.ToStr() + "失败,未准备好料架");
return false;
}
runStatus = LineRunStatus.Busy;
lineStatus = LineStatus.OutStoreExecute;
MoveInfo.NewMove(LineMoveType.OutStore,outParam);
MoveInfo.NewMove(LineMoveType.OutStore, outParam);
//可以开始出库啦
MoveInfo.NextMoveStep(LineMoveStep.FO_211_AxisDownMove);
OutLog("出库移栽 " + MoveInfo.SLog + " :提升伺服下降指定的高度,升降轴回原点");
......@@ -32,7 +55,7 @@ namespace OnlineStore.DeviceLibrary
if (targetPosition < Config.BatchAxisP2)
{
targetPosition = Config.BatchAxisP2;
}
}
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
return true;
//UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
......@@ -245,14 +268,13 @@ namespace OnlineStore.DeviceLibrary
BatchAxisStartCheck(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW);
}
}
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_31_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_32_TrayLocationCylinder_After);
OutLog("出料完成 " + MoveInfo.SLog + ": 升降盘定位气缸后退");
OutLog("出料完成 " + MoveInfo.SLog + ": 升降盘定位气缸后退,重置OutEndSendShelfOut=fasle,OutStoreHeight = -1");
OutEndSendShelfOut = false;
OutStoreHeight = -1;
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_32_TrayLocationCylinder_After))
......@@ -291,7 +313,6 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_36_WaitShelfGo))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_37_LineStop);
OutStoreHeight = -1;
OutLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止,清空出料高度 ");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.LOW);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
......@@ -413,8 +434,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_221_UpdownAxisToP1))
{
//出库结束 TODO
bool isNeedSendShelf = false;
if (isNeedSendShelf)
// bool isNeedSendShelf = false;
if (OutEndSendShelfOut)
{
MoveInfo.NextMoveStep(LineMoveStep.FO_31_BatchAxisToP2);
OutLog("紧急出料移栽 " + MoveInfo.SLog + ":需要将料架送出,提升伺服到P2点");
......
......@@ -121,13 +121,13 @@ namespace OnlineStore.DeviceLibrary
cioList = new List<string>(ioList);
string ids = ConfigAppSettings.GetValue(Setting_Init.DebugDeviceId);
rfidList = new List<string>(DeviceConfig.ProRFIpMap.Values);
// rfidList = new List<string>(DeviceConfig.ProRFIpMap.Values);
rfidList = new List<string>();
if (IsDebug)
{
//rfidList = new List<string>() {
// "192.168.210.116","192.168.210.120","192.168.210.121"
//};
rfidList = new List<string>() {
"192.168.210.116","192.168.210.120","192.168.210.121"
};
try
{
cioList = new List<string>();
......@@ -183,14 +183,14 @@ namespace OnlineStore.DeviceLibrary
{
IOManager.instance.ConnectionIOList(cioList);
Thread.Sleep(5);
// if (!IsDebug)
// if (!IsDebug)
//{
// Task.Factory.StartNew(delegate
// {
// string[] rfidArray = rfidList.ToArray();
// //连接rfip
// TrayManager.RfidReader.Open(rfidArray);
// });
Task.Factory.StartNew(delegate
{
string[] rfidArray = rfidList.ToArray();
//连接rfip
TrayManager.RfidReader.Open(rfidArray);
});
//}
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
......
......@@ -719,7 +719,7 @@ namespace OnlineStore.DeviceLibrary
if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown);
SWLog("横移轨道23:阻挡气缸下降 等待 "+ TrayManager.StopDownWaitTime);
SWLog("横移轨道23:阻挡气缸下降 等待 " + TrayManager.StopDownWaitTime);
IOMove(IO_Type.SW2_StopDown, IO_VALUE.HIGH);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
}
......@@ -775,11 +775,12 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_TopCylinderDown))
{
if (CheckTrayIsNeed(104, Sw23TrayNum))
{ //开始入库
bool result = FeedingEquipMap[104].CanStartCheckOut();
if (result)
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitTrayGo);
SWLog("横移轨道41:关闭皮带电机,不需要等待 托盘离开");
SWLog("横移轨道41:关闭皮带电机,需要紧急出料,不需要等待 托盘离开");
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_MotorRun, IO_VALUE.LOW));
......
......@@ -12,12 +12,8 @@ namespace OnlineStore.DeviceLibrary
{
public class TrayManager
{
public static int StopDownWaitTime = 1000;
public static RFID RfidReader = new RFID();
///// <summary>
///// 出库时,可以不下降直接放料盘的宽度
///// </summary>
//public const int CanPushBagWidth = 7;
public static int StopDownWaitTime = 500;
public static RFID RfidReader = new RFID();
/// <summary>
/// 托盘集合,key=托盘编号,value=托盘详细信息
/// </summary>
......@@ -184,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public static int GetTrayNum(int subType, bool isClear = false)
{
return 9;
// return 9;
if (subType.Equals(104))
{
return LineManager.Line.Sw23TrayNum;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!