Commit b092104a LN

1

1 个父辈 0295cdf2
...@@ -387,9 +387,9 @@ ...@@ -387,9 +387,9 @@
this.lblThisSta.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblThisSta.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblThisSta.ForeColor = System.Drawing.Color.Red; this.lblThisSta.ForeColor = System.Drawing.Color.Red;
this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblThisSta.Location = new System.Drawing.Point(247, 29); this.lblThisSta.Location = new System.Drawing.Point(263, 29);
this.lblThisSta.Name = "lblThisSta"; this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(539, 120); this.lblThisSta.Size = new System.Drawing.Size(523, 191);
this.lblThisSta.TabIndex = 246; this.lblThisSta.TabIndex = 246;
this.lblThisSta.Text = "等待启动"; this.lblThisSta.Text = "等待启动";
this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -592,7 +592,7 @@ ...@@ -592,7 +592,7 @@
this.lblMoveInfo.AutoSize = true; this.lblMoveInfo.AutoSize = true;
this.lblMoveInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblMoveInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveInfo.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblMoveInfo.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblMoveInfo.Location = new System.Drawing.Point(18, 29); this.lblMoveInfo.Location = new System.Drawing.Point(6, 22);
this.lblMoveInfo.Name = "lblMoveInfo"; this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(68, 17); this.lblMoveInfo.Size = new System.Drawing.Size(68, 17);
this.lblMoveInfo.TabIndex = 279; this.lblMoveInfo.TabIndex = 279;
...@@ -616,9 +616,9 @@ ...@@ -616,9 +616,9 @@
this.lblInstoreList.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblInstoreList.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblInstoreList.ForeColor = System.Drawing.Color.Green; this.lblInstoreList.ForeColor = System.Drawing.Color.Green;
this.lblInstoreList.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblInstoreList.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblInstoreList.Location = new System.Drawing.Point(247, 149); this.lblInstoreList.Location = new System.Drawing.Point(267, 228);
this.lblInstoreList.Name = "lblInstoreList"; this.lblInstoreList.Name = "lblInstoreList";
this.lblInstoreList.Size = new System.Drawing.Size(539, 44); this.lblInstoreList.Size = new System.Drawing.Size(519, 53);
this.lblInstoreList.TabIndex = 277; this.lblInstoreList.TabIndex = 277;
// //
// panel1 // panel1
......
...@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public partial class DischargeLine : EquipBase public partial class DischargeLine : EquipBase
{ {
public int Line3MaxPosition = 13;
public DischargeLine_Config Config; public DischargeLine_Config Config;
public OutTrayLineBean TrayLine1 = null; public OutTrayLineBean TrayLine1 = null;
public OutTrayLineBean TrayLine2 = null; public OutTrayLineBean TrayLine2 = null;
...@@ -38,6 +38,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -38,6 +38,14 @@ namespace OnlineStore.DeviceLibrary
TrayLine1 = new OutTrayLineBean("皮带线" + (id - 1) * 3+1, IO_Type.EntryLocation_Check1, IO_Type.ExitLocation_Check1, IO_Type.ExitTray_Check1,IO_Type.DLine_Run1, IO_Type.EntryTray_Check3, this); TrayLine1 = new OutTrayLineBean("皮带线" + (id - 1) * 3+1, IO_Type.EntryLocation_Check1, IO_Type.ExitLocation_Check1, IO_Type.ExitTray_Check1,IO_Type.DLine_Run1, IO_Type.EntryTray_Check3, this);
TrayLine2 = new OutTrayLineBean("皮带线" + (id - 1) * 3+2, IO_Type.EntryLocation_Check2, IO_Type.ExitLocation_Check2, IO_Type.ExitTray_Check2,IO_Type.DLine_Run2,IO_Type.MiddleTray_Check3,this); TrayLine2 = new OutTrayLineBean("皮带线" + (id - 1) * 3+2, IO_Type.EntryLocation_Check2, IO_Type.ExitLocation_Check2, IO_Type.ExitTray_Check2,IO_Type.DLine_Run2,IO_Type.MiddleTray_Check3,this);
Line3Turn = new LineTurnBean(DeviceID); Line3Turn = new LineTurnBean(DeviceID);
if((DeviceID%100).Equals(1))
{
Line3MaxPosition = 13;
}
else
{
Line3MaxPosition = 22;
}
} }
/// <summary> /// <summary>
...@@ -79,6 +87,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -79,6 +87,9 @@ namespace OnlineStore.DeviceLibrary
} }
private void StartReset() private void StartReset()
{ {
TrayLine1.LastTrayPosition = 0;
TrayLine2.LastTrayPosition = 0;
Line3LastTrayP = 0;
ResetClearData(); ResetClearData();
lineStatus = LineStatus.ResetMove; lineStatus = LineStatus.ResetMove;
MoveInfo.NextMoveStep(LineMoveStep.DL_R_CylinderDown); MoveInfo.NextMoveStep(LineMoveStep.DL_R_CylinderDown);
...@@ -95,6 +106,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -95,6 +106,11 @@ namespace OnlineStore.DeviceLibrary
{ {
mainTimer.Start(); mainTimer.Start();
} }
//三个流水线都转动到定位亮
TrayLine1.LineStartTurn();
TrayLine2.LineStartTurn();
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
isInPro = false; isInPro = false;
} }
...@@ -118,6 +134,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -118,6 +134,7 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.DL_R_CylinderDown: case LineMoveStep.DL_R_CylinderDown:
LogInfo(MoveInfo.MoveType + "完成!"); LogInfo(MoveInfo.MoveType + "完成!");
runStatus = LineRunStatus.Runing; runStatus = LineRunStatus.Runing;
lineStatus = LineStatus.StoreOnline;
MoveInfo.EndMove(); MoveInfo.EndMove();
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
break; break;
...@@ -215,41 +232,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -215,41 +232,38 @@ namespace OnlineStore.DeviceLibrary
} }
//判断流水线打开了才可以运行 //判断流水线打开了才可以运行
if (runStatus.Equals(LineRunStatus.Runing) && NoAlarm()) if (runStatus.Equals(LineRunStatus.Runing) && NoAlarm() && MoveInfo.MoveType.Equals(LineMoveType.None))
{ {
//皮带线3出口有料,分盘定位装置无料
if (MoveInfo.MoveType.Equals(LineMoveType.None)) if (Line3Turn.InTurn.Equals(false) && IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW))
{ {
//皮带线3出口有料,分盘定位装置无料 //开始扫码然后送出料盘
if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW)) //1.扫码,
{ //2.从服务器获取尺寸
//开始扫码然后送出料盘 //3.顶升或下降定位气缸
//1.扫码, //皮带线3转动,分料皮带转动,
//2.从服务器获取尺寸 //等待料盘到达工位。
//3.顶升或下降定位气缸
//皮带线3转动,分料皮带转动,
//等待料盘到达工位。
StartOutStoreMove(new InOutParam()); StartOutStoreMove(new InOutParam());
}
} }
}
if (runStatus>=(LineRunStatus.HomeMoving) && NoAlarm())
{
//判断皮带线3出口无料,皮带线无操作 //判断皮带线3出口无料,皮带线无操作
if (MoveInfo.MoveType.Equals(LineMoveType.None) && if (Line3Turn.InTurn.Equals(false) &&
MoveInfo.MoveType.Equals(LineMoveType.None) &&
TrayLine1.Line3CanRun && TrayLine1.Line3CanRun &&
TrayLine2.Line3CanRun && TrayLine2.Line3CanRun &&
IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW) && IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW) &&
Line3LastTrayP < 11) Line3HasTray())
{ {
//判断皮带三还有料盘,需要转动一个工位 //判断皮带三还有料盘,需要转动一个工位
UpdateLastP();
LogInfo("皮带线3空闲,且流水线还有料盘,转动一个工位"); LogInfo("皮带线3空闲,且流水线还有料盘,转动一个工位");
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess); Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
} }
//皮带线1出口无料 //皮带线1出口无料
if (TrayLine1.MoveInfo.MoveType.Equals(LineMoveType.None) && if (TrayLine1.IsInTurn().Equals(false) && TrayLine1.MoveInfo.MoveType.Equals(LineMoveType.None) && TrayLine1.HasTray())
TrayLine1.LastTrayPosition > 0 &&
TrayLine1.LastTrayPosition < 5
)
{ {
if (IOValue(IO_Type.ExitTray_Check1).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.ExitTray_Check1).Equals(IO_VALUE.LOW))
{ {
...@@ -266,10 +280,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -266,10 +280,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
if (TrayLine2.MoveInfo.MoveType.Equals(LineMoveType.None) && if (TrayLine2.IsInTurn().Equals(false) && TrayLine2.MoveInfo.MoveType.Equals(LineMoveType.None) && TrayLine2.HasTray())
TrayLine2.LastTrayPosition > 0 &&
TrayLine2.LastTrayPosition < 5
)
{ {
if (IOValue(IO_Type.ExitTray_Check2).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.ExitTray_Check2).Equals(IO_VALUE.LOW))
{ {
...@@ -281,7 +292,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -281,7 +292,6 @@ namespace OnlineStore.DeviceLibrary
//皮带线1出口有料,皮带3入库无料,且在停止状态 //皮带线1出口有料,皮带3入库无料,且在停止状态
if (Line3Turn.InTurn.Equals(false) && IOValue(IO_Type.MiddleTray_Check3).Equals(IO_VALUE.LOW)) if (Line3Turn.InTurn.Equals(false) && IOValue(IO_Type.MiddleTray_Check3).Equals(IO_VALUE.LOW))
{ {
TrayLine2.Line3CanRun = false; TrayLine2.Line3CanRun = false;
TrayLine2.LineStartTurn(); TrayLine2.LineStartTurn();
} }
...@@ -300,6 +310,54 @@ namespace OnlineStore.DeviceLibrary ...@@ -300,6 +310,54 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH); IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH);
} }
} }
private List<int> ListProList = new List<int> { 1,2,3};
private void Line1TimerPro()
{
}
private void UpdateLastP()
{
if (IOValue(IO_Type.EntryTray_Check3).Equals(IO_VALUE.HIGH))
{
Line3LastTrayP = 1;
}
else if (IOValue(IO_Type.MiddleTray_Check3).Equals(IO_VALUE.HIGH))
{
if (DeviceID.Equals(301))
{
if (Line3LastTrayP < 1 || Line3LastTrayP > 12)
{
Line3LastTrayP = 12;
}
}
else if (DeviceID.Equals(302))
{
if (Line3LastTrayP < 1 || Line3LastTrayP > 11)
{
Line3LastTrayP = 11;
}
}
}
}
private bool Line3HasTray()
{
if (Line3LastTrayP > 0 && Line3LastTrayP <= Line3MaxPosition)
{
return true;
}
if (IOValue(IO_Type.EntryTray_Check3).Equals(IO_VALUE.HIGH))
{
return true;
}
if (IOValue(IO_Type.MiddleTray_Check3).Equals(IO_VALUE.HIGH))
{
return true;
}
return false;
}
/// <summary> /// <summary>
/// 转动结束,最后一盘料的位置+1 /// 转动结束,最后一盘料的位置+1
/// </summary> /// </summary>
...@@ -326,6 +384,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -326,6 +384,7 @@ namespace OnlineStore.DeviceLibrary
msg += "Line1-Move:".PadRight(tLength, ' ') + TrayLine1.MoveInfo.MoveType +" " + TrayLine1.MoveInfo.MoveStep + "\n"; msg += "Line1-Move:".PadRight(tLength, ' ') + TrayLine1.MoveInfo.MoveType +" " + TrayLine1.MoveInfo.MoveStep + "\n";
msg += "Line2-Move:".PadRight(tLength, ' ') + TrayLine2.MoveInfo.MoveType + " " + TrayLine2.MoveInfo.MoveStep + "\n"; msg += "Line2-Move:".PadRight(tLength, ' ') + TrayLine2.MoveInfo.MoveType + " " + TrayLine2.MoveInfo.MoveStep + "\n";
msg += "LastTrayP:".PadRight(tLength, ' ') + TrayLine1.LastTrayPosition+" " + TrayLine2.LastTrayPosition + " " + Line3LastTrayP + " " + "\n"; msg += "LastTrayP:".PadRight(tLength, ' ') + TrayLine1.LastTrayPosition+" " + TrayLine2.LastTrayPosition + " " + Line3LastTrayP + " " + "\n";
msg += "IsInRun:".PadRight(tLength, ' ') + TrayLine1.IsInTurn() + " " + TrayLine2.IsInTurn() + " " +Line3Turn.InTurn + " " +"\n";
msg += "Line3CanRun:".PadRight(tLength, ' ') + TrayLine1.Line3CanRun + " " + TrayLine2.Line3CanRun + " " + "\n"; msg += "Line3CanRun:".PadRight(tLength, ' ') + TrayLine1.Line3CanRun + " " + TrayLine2.Line3CanRun + " " + "\n";
return msg; return msg;
} }
......
...@@ -126,15 +126,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -126,15 +126,6 @@ namespace OnlineStore.DeviceLibrary
// rfidList = new List<string>(); // rfidList = new List<string>();
if (IsDebug) if (IsDebug)
{ {
//rfidList = new List<string>() {
// "192.168.210.116","192.168.210.120","192.168.210.121"
//};
//rfidList = new List<string>() {
// RFIDManager.GetRFIP(103),
// RFIDManager.GetRFIP(11),
// RFIDManager.GetRFIP(12),
//};
try try
{ {
cioList = new List<string>(); cioList = new List<string>();
...@@ -167,17 +158,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -167,17 +158,17 @@ namespace OnlineStore.DeviceLibrary
{ {
cioList = new List<string>(); cioList = new List<string>();
cioList.AddRange(ioList); cioList.AddRange(ioList);
List<string> removeList = new List<string>() { //List<string> removeList = new List<string>() {
"192.168.101.22", // "192.168.101.22",
"192.168.101.23" // "192.168.101.23"
}; //};
foreach (string s in removeList) //foreach (string s in removeList)
{ //{
if (cioList.Contains(s)) // if (cioList.Contains(s))
{ // {
cioList.Remove(s); // cioList.Remove(s);
} // }
} //}
} }
} }
} }
......
...@@ -14,6 +14,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -14,6 +14,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public class OutTrayLineBean public class OutTrayLineBean
{ {
public int MaxPosition = 5;
private DischargeLine equipBean = null; private DischargeLine equipBean = null;
private string Line3_TrayCheck = ""; private string Line3_TrayCheck = "";
//入口定位信号 //入口定位信号
...@@ -201,8 +202,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -201,8 +202,30 @@ namespace OnlineStore.DeviceLibrary
if (result&&LastTrayPosition>0) if (result&&LastTrayPosition>0)
{ {
LastTrayPosition++; LastTrayPosition++;
Line3CanRun = true;
} }
Line3CanRun = true;
}
/// <summary>
/// 此皮带线是否有盘。重启会重置为空
/// </summary>
/// <returns></returns>
internal bool HasTray()
{
if (LastTrayPosition > 0 &&
LastTrayPosition <= MaxPosition)
{
return true;
}
if (equipBean.IOValue(ExitTray_Check).Equals(IO_VALUE.HIGH))
{
return true;
}
return false;
}
internal bool IsInTurn()
{
return lineRun.InTurn;
} }
#endregion #endregion
......
...@@ -291,7 +291,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -291,7 +291,7 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary> /// <summary>
/// DI 皮带线2出口定位检测 ExitLocation_Check2 6 PRO_AOI_IP_2 0 皮带线2出口定位检测 X027 X027 /// DI 皮带线2出口定位检测 ExitLocation_Check2 6 PRO_AOI_IP_2 0 皮带线2出口定位检测 X027 X027
/// </summary> /// </summary>
public static string ExitLocation_Check2 = " ExitLocation_Check2"; public static string ExitLocation_Check2 = "ExitLocation_Check2";
/// <summary> /// <summary>
/// DI 皮带线2出口料盘检测 ExitTray_Check2 7 PRO_AOI_IP_2 0 皮带线2出口料盘检测 X028 X028 /// DI 皮带线2出口料盘检测 ExitTray_Check2 7 PRO_AOI_IP_2 0 皮带线2出口料盘检测 X028 X028
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!