Commit 8f0dfe34 张东亮

0112

1 个父辈 7df10dbf
......@@ -39,10 +39,6 @@
this.btnDis = new System.Windows.Forms.Button();
this.btnInit = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnSwitch = new System.Windows.Forms.Button();
this.btnRollerRun = new System.Windows.Forms.Button();
this.btnTranverseRun = new System.Windows.Forms.Button();
this.btnTranverse = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.btnStopTDown = new System.Windows.Forms.Button();
......@@ -223,10 +219,6 @@
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox2.Controls.Add(this.btnSwitch);
this.groupBox2.Controls.Add(this.btnRollerRun);
this.groupBox2.Controls.Add(this.btnTranverseRun);
this.groupBox2.Controls.Add(this.btnTranverse);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.numericUpDown1);
this.groupBox2.Controls.Add(this.btnStopTDown);
......@@ -248,50 +240,6 @@
this.groupBox2.TabIndex = 276;
this.groupBox2.TabStop = false;
//
// btnSwitch
//
this.btnSwitch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSwitch.Location = new System.Drawing.Point(22, 413);
this.btnSwitch.Name = "btnSwitch";
this.btnSwitch.Size = new System.Drawing.Size(132, 39);
this.btnSwitch.TabIndex = 290;
this.btnSwitch.Text = "料串切换气缸前进";
this.btnSwitch.UseVisualStyleBackColor = true;
this.btnSwitch.Click += new System.EventHandler(this.btnSwitch_Forward_Click);
//
// btnRollerRun
//
this.btnRollerRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRollerRun.Location = new System.Drawing.Point(298, 368);
this.btnRollerRun.Name = "btnRollerRun";
this.btnRollerRun.Size = new System.Drawing.Size(132, 39);
this.btnRollerRun.TabIndex = 289;
this.btnRollerRun.Text = "滚筒电机运转";
this.btnRollerRun.UseVisualStyleBackColor = true;
this.btnRollerRun.Click += new System.EventHandler(this.btnRollerRun_Click);
//
// btnTranverseRun
//
this.btnTranverseRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTranverseRun.Location = new System.Drawing.Point(298, 323);
this.btnTranverseRun.Name = "btnTranverseRun";
this.btnTranverseRun.Size = new System.Drawing.Size(132, 39);
this.btnTranverseRun.TabIndex = 288;
this.btnTranverseRun.Text = "横移电机运转";
this.btnTranverseRun.UseVisualStyleBackColor = true;
this.btnTranverseRun.Click += new System.EventHandler(this.btnTranverseRun_Click);
//
// btnTranverse
//
this.btnTranverse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTranverse.Location = new System.Drawing.Point(298, 278);
this.btnTranverse.Name = "btnTranverse";
this.btnTranverse.Size = new System.Drawing.Size(132, 39);
this.btnTranverse.TabIndex = 287;
this.btnTranverse.Text = "横移机构下降";
this.btnTranverse.UseVisualStyleBackColor = true;
this.btnTranverse.Click += new System.EventHandler(this.btnTranverse_Click);
//
// label1
//
this.label1.AutoSize = true;
......@@ -397,7 +345,7 @@
this.btnOLOutStopDown.Name = "btnOLOutStopDown";
this.btnOLOutStopDown.Size = new System.Drawing.Size(132, 39);
this.btnOLOutStopDown.TabIndex = 281;
this.btnOLOutStopDown.Text = "分盘2线体出口阻挡下降";
this.btnOLOutStopDown.Text = "出料线体出口阻挡下降";
this.btnOLOutStopDown.UseVisualStyleBackColor = true;
this.btnOLOutStopDown.Click += new System.EventHandler(this.btnOLOutStopDown_Click);
//
......@@ -408,7 +356,7 @@
this.btnOLInStopDown.Name = "btnOLInStopDown";
this.btnOLInStopDown.Size = new System.Drawing.Size(132, 39);
this.btnOLInStopDown.TabIndex = 280;
this.btnOLInStopDown.Text = "分盘2线体阻挡下降";
this.btnOLInStopDown.Text = "出料线体阻挡下降";
this.btnOLInStopDown.UseVisualStyleBackColor = true;
this.btnOLInStopDown.Click += new System.EventHandler(this.btnOLInStopDown_Click);
//
......@@ -419,7 +367,7 @@
this.btnInLOutStopDown.Name = "btnInLOutStopDown";
this.btnInLOutStopDown.Size = new System.Drawing.Size(132, 39);
this.btnInLOutStopDown.TabIndex = 279;
this.btnInLOutStopDown.Text = "分盘1线体出口阻挡下降";
this.btnInLOutStopDown.Text = "入料线体出口阻挡下降";
this.btnInLOutStopDown.UseVisualStyleBackColor = true;
this.btnInLOutStopDown.Click += new System.EventHandler(this.btnInLOutStopDown_Click);
//
......@@ -430,7 +378,7 @@
this.btnInLInStopDown.Name = "btnInLInStopDown";
this.btnInLInStopDown.Size = new System.Drawing.Size(132, 39);
this.btnInLInStopDown.TabIndex = 278;
this.btnInLInStopDown.Text = "分盘1线体阻挡下降";
this.btnInLInStopDown.Text = "入料线体阻挡下降";
this.btnInLInStopDown.UseVisualStyleBackColor = true;
this.btnInLInStopDown.Click += new System.EventHandler(this.btnInLInStopDown_Click);
//
......@@ -441,7 +389,7 @@
this.btnInLineRun.Name = "btnInLineRun";
this.btnInLineRun.Size = new System.Drawing.Size(132, 39);
this.btnInLineRun.TabIndex = 276;
this.btnInLineRun.Text = "分盘1线体运转";
this.btnInLineRun.Text = "入料线体运转";
this.btnInLineRun.UseVisualStyleBackColor = true;
this.btnInLineRun.Click += new System.EventHandler(this.btnInLineRun_Click);
//
......@@ -452,7 +400,7 @@
this.btnOutL.Name = "btnOutL";
this.btnOutL.Size = new System.Drawing.Size(132, 39);
this.btnOutL.TabIndex = 277;
this.btnOutL.Text = "分盘2线体运转";
this.btnOutL.Text = "出料线体运转";
this.btnOutL.UseVisualStyleBackColor = true;
this.btnOutL.Click += new System.EventHandler(this.btnOutL_Click);
//
......@@ -735,10 +683,6 @@
private System.Windows.Forms.TextBox txtShelfId;
private System.Windows.Forms.CheckBox chbMoveStop;
private System.Windows.Forms.CheckBox chkBoxAGVCancel;
private System.Windows.Forms.Button btnRollerRun;
private System.Windows.Forms.Button btnTranverseRun;
private System.Windows.Forms.Button btnTranverse;
private System.Windows.Forms.Button btnSwitch;
}
}
......@@ -333,32 +333,32 @@ namespace OnlineStore.DISTLineClient
}
private void btnInLineRun_Click(object sender, EventArgs e)
{
BtnMove(btnInLineRun, "分盘1线体运转", "分盘1线体停止", IO_Type.L1_Run);
BtnMove(btnInLineRun, "入料线体运转", "入料线体停止", IO_Type.L1_Run);
}
private void btnInLInStopDown_Click(object sender, EventArgs e)
{
BtnMove(btnInLInStopDown, "分盘1线体阻挡下降", "分盘1线体阻挡上升", IO_Type.L1_StopDown);
BtnMove(btnInLInStopDown, "入料线体阻挡下降", "入料线体阻挡上升", IO_Type.L1_StopDown);
}
private void btnInLOutStopDown_Click(object sender, EventArgs e)
{
BtnMove(btnInLOutStopDown, "分盘1线体出口阻挡下降", "分盘1线体出口阻挡上升", IO_Type.L1_OutStopDown);
BtnMove(btnInLOutStopDown, "入料线体出口阻挡下降", "入料线体出口阻挡上升", IO_Type.L1_OutStopDown);
}
private void btnOLInStopDown_Click(object sender, EventArgs e)
{
BtnMove(btnOLInStopDown, "分盘2线体阻挡下降", "分盘2线体阻挡上升", IO_Type.L2_StopDown);
BtnMove(btnOLInStopDown, "出料线体阻挡下降", "出料线体阻挡上升", IO_Type.L2_StopDown);
}
private void btnOutL_Click(object sender, EventArgs e)
{
BtnMove(btnOutL, "分盘2线体运转", "分盘2线体停止", IO_Type.L2_Run);
BtnMove(btnOutL, "出料线体运转", "出料线体停止", IO_Type.L2_Run);
}
private void btnOLOutStopDown_Click(object sender, EventArgs e)
{
BtnMove(btnOLOutStopDown, "分盘2线体出口阻挡下降", "分盘2线体出口阻挡上升", IO_Type.L2_OutStopDown);
BtnMove(btnOLOutStopDown, "出料线体出口阻挡下降", "出料线体出口阻挡上升", IO_Type.L2_OutStopDown);
}
private void btnCloseA_Click(object sender, EventArgs e)
......@@ -424,43 +424,5 @@ namespace OnlineStore.DISTLineClient
AgvClient.SetCancelState(chkBoxAGVCancel.Checked);
}
private void btnTranverse_Click(object sender, EventArgs e)
{
if (btnTranverse.Text.Equals("横移机构下降"))
{
IOManager.IOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.LOW);
BtnMove(btnTranverse, "横移机构下降", "横移机构上升", IO_Type.Traverse_Up_SOL);
}
else
{
IOManager.IOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.LOW);
BtnMove(btnTranverse, "横移机构上升", "横移机构下降", IO_Type.Traverse_Down_SOL);
}
}
private void btnTranverseRun_Click(object sender, EventArgs e)
{
BtnMove(btnTranverseRun, "横移电机运转", "横移电机停止", IO_Type.Traverse_Run);
}
private void btnRollerRun_Click(object sender, EventArgs e)
{
BtnMove(btnRollerRun, "滚筒电机运转", "滚筒电机停止", IO_Type.Roller_Run);
}
private void btnSwitch_Forward_Click(object sender, EventArgs e)
{
if (btnSwitch.Text.Equals("料串切换气缸前进"))
{
IOManager.IOMove(IO_Type.Switch_Forward, IO_VALUE.LOW);
BtnMove(btnSwitch, "料串切换气缸前进", "料串切换气缸后退", IO_Type.Switch_Back);
}
else
{
IOManager.IOMove(IO_Type.Switch_Back, IO_VALUE.LOW);
BtnMove(btnSwitch, "料串切换气缸后退", "料串切换气缸前进", IO_Type.Switch_Forward);
}
}
}
}
......@@ -82,6 +82,13 @@
<Compile Include="acDISTLine\LineManager.cs" />
<Compile Include="acDISTLine\WaitUtil.cs" />
<Compile Include="agvClient\AgvClient.cs" />
<Compile Include="bean\RunStepInfo.cs" />
<Compile Include="bean\runStep\IStep.cs" />
<Compile Include="bean\runStep\steps\S4_Finish.cs" />
<Compile Include="bean\runStep\steps\S3_ToEmptyLine.cs" />
<Compile Include="bean\runStep\steps\S3_ToOutLine.cs" />
<Compile Include="bean\runStep\steps\S2_CheckTarLine.cs" />
<Compile Include="bean\runStep\steps\S1_None.cs" />
<Compile Include="bean\StoreMoveInfo.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="IO\IOManager.cs" />
......
......@@ -48,7 +48,7 @@ DO,空料串线出口阻挡下降,L3_OutStopDown,20,PRO_AOI_IP_1,0,空料串线出口阻挡下降,Y2
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,进料线AGV节点名称,L1_AgvName,A8,,,,,,,
PRO,出料线AGV节点名称,L2_AgvName,A7,,,,,,,
PRO,空料串线AGV节点名称,L3_AgvName,A9,,,,,,,
PRO,出料线AGV节点名称,L2_AgvName,A9,,,,,,,
PRO,空料串线AGV节点名称,L3_AgvName,A7,,,,,,,
PRO,分盘线出口RFIDIP,L2Out_RFIDIP,10.85.199.130,,,,,, ,
PRO,休眠秒数(秒),SleepSeconds,60,,,,,,,
......@@ -103,8 +103,14 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_Down_SOL, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.L2_Traverse_Down_SOL, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.L3_Traverse_Down_SOL, IO_VALUE.HIGH);
AgvClient.SetStatus(Config.L2_AgvName);
AgvClient.SetStatus(Config.L1_AgvName);
mainTimer.Enabled = true;
......@@ -199,14 +205,24 @@ namespace OnlineStore.DeviceLibrary
{
IOManager.IOMove(IO_Type.L1_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_BackRun, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Traverse_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_BackRun, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_Traverse_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_Traverse_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L3_Traverse_Up_SOL, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_Down_SOL, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.L2_Traverse_Down_SOL, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.L3_Traverse_Down_SOL, IO_VALUE.HIGH);
}
private bool InProcess = false;
......@@ -242,7 +258,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (runStatus.Equals(RunStatus.Runing))
{
InLineTimerProcess();
TranverseProcess();
LineAgvTimerProcess();
OutLineTimerProcess();
......@@ -324,27 +342,30 @@ namespace OnlineStore.DeviceLibrary
}
}
private DateTime il_lastCallAgvTime = DateTime.Now.AddMinutes(-5);
private DateTime il_lastCallAgvTime2 = DateTime.Now.AddMinutes(-5);
private Stopwatch il_outstopCheckWarch = new Stopwatch();
private Stopwatch il_outstopCheckWarch2 = new Stopwatch();
private Stopwatch il_manualCheckWatch = new Stopwatch();
/// <summary>
/// 入料线体定时处理
/// 线体出料信号定时处理
/// </summary>
private void InLineTimerProcess()
private void LineAgvTimerProcess()
{
TimeSpan span = DateTime.Now - il_lastCallAgvTime;
TimeSpan span1 = DateTime.Now - il_lastCallAgvTime2;
//出口有料架,需要通知agv取走料架
//每次叫小车时间间隔3分钟?
//出口信号需要持续1秒钟
if (IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.HIGH) && span.TotalSeconds > 60)
{
if (LastOutShelfId.Equals("00").Equals(false))
//if (LastOutShelfId.Equals("000").Equals(false))
{
if (LineManager.checkWatch(il_outstopCheckWarch, 1000))
{
il_lastCallAgvTime = DateTime.Now;
//StopIOMove(IO_Type.InL_OutStopDown, StopDownMS);
LogUtil.info(" 分盘2线体出口有料架" + LastOutShelfId + ",呼叫agv小车[" + Config.L2_AgvName + "] [NeedLeave] ");
LogUtil.info(" 出料线体出口有料架" + LastOutShelfId + ",呼叫agv小车[" + Config.L2_AgvName + "] [NeedLeave] ");
AgvClient.NeedLeave(Config.L2_AgvName, LastOutShelfId);
}
}
......@@ -355,90 +376,57 @@ namespace OnlineStore.DeviceLibrary
ClientAction currA = AgvClient.GetAction(Config.L2_AgvName);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{
if (IOManager.IOValue(IO_Type.L1_StopDown).Equals(IO_VALUE.HIGH))
if (IOManager.IOValue(IO_Type.L2_StopDown).Equals(IO_VALUE.HIGH))
{
IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_StopDown, IO_VALUE.LOW);
}
}
}
//空料串出口
//如果是出口无料架,NeedLeave状态,改为None
if (IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.L2_AgvName).Equals(ClientAction.NeedLeave))
if (IOManager.IOValue(IO_Type.L3_OutCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.L3_AgvName).Equals(ClientAction.NeedLeave))
{
il_outstopCheckWarch.Stop();
LogUtil.info(" 分盘2线体出口无料架 ,更改[" + Config.L2_AgvName + "] 状态[None] ");
AgvClient.SetToNone(Config.L2_AgvName, "");
il_outstopCheckWarch2.Stop();
LogUtil.info(" 空料串线体出口无料架 ,更改[" + Config.L3_AgvName + "] 状态[None] ");
AgvClient.SetToNone(Config.L3_AgvName, "");
}
}
private static void TranverseProcess()
{
LogUtil.info(" TranverseProcess");
if(IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.PackingShelf_Sig).Equals(IO_VALUE.HIGH))
{
IOManager.CIOMove(IO_Type.Switch_Forward, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.Switch_Back, IO_VALUE.HIGH);
LogUtil.info(" 横移包装料架");
while(IOManager.IOValue(IO_Type.Switch_Back_Sig).Equals(IO_VALUE.LOW))
if (IOManager.IOValue(IO_Type.L3_OutCheck).Equals(IO_VALUE.HIGH) && span1.TotalSeconds > 60)
{
}
LogUtil.info(" 料串气缸到达后退端");
}
else if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.PackingShelf_Sig).Equals(IO_VALUE.LOW))
//if (LastOutShelfId.Equals("000").Equals(false))
{
IOManager.CIOMove(IO_Type.Switch_Back, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.Switch_Forward, IO_VALUE.HIGH);
LogUtil.info(" 横移料串");
while (IOManager.IOValue(IO_Type.Switch_Forward_Sig).Equals(IO_VALUE.LOW))
if (LineManager.checkWatch(il_outstopCheckWarch2, 1000))
{
il_lastCallAgvTime2 = DateTime.Now;
//StopIOMove(IO_Type.InL_OutStopDown, StopDownMS);
LogUtil.info(" 空料串线体出口有料架" + LastOutShelfId + ",呼叫agv小车[" + Config.L3_AgvName + "] [NeedLeave] ");
AgvClient.NeedLeave(Config.L3_AgvName, LastOutShelfId);
}
LogUtil.info(" 料串气缸到达前进端");
}
if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
}
else if (span1.TotalMilliseconds > StopDownMS)
{
IOManager.CIOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.IOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
LogUtil.info(" 横移机构上升");
while (IOManager.IOValue(IO_Type.L2_UpDown_Up_Sig).Equals(IO_VALUE.LOW))
il_outstopCheckWarch2.Stop();
ClientAction currA = AgvClient.GetAction(Config.L3_AgvName);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{
if (IOManager.IOValue(IO_Type.L3_StopDown).Equals(IO_VALUE.HIGH))
{
IOManager.IOMove(IO_Type.L3_StopDown, IO_VALUE.LOW);
}
IOManager.IOMove(IO_Type.Traverse_Run, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Roller_Run, IO_VALUE.HIGH);
LogUtil.info(" 滚筒电机、横移机构电机运行");
}
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
while (IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
{
if (stopwatch.Elapsed.TotalMinutes >= 2)
{
//stopwatch.Stop();
//IOManager.CIOMove(IO_Type.Traverse_Run, IO_VALUE.LOW);
//IOManager.CIOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
LogUtil.info(" 横移机构转移料架超时 [" + IO_Type.L1_StopDown + "] 大于2分钟");
//break;
}
//如果是出口无料架,NeedLeave状态,改为None
if (IOManager.IOValue(IO_Type.L3_OutCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.L3_AgvName).Equals(ClientAction.NeedLeave))
{
il_outstopCheckWarch.Stop();
LogUtil.info(" 空料串线体出口无料架 ,更改[" + Config.L3_AgvName + "] 状态[None] ");
AgvClient.SetToNone(Config.L3_AgvName, "");
}
stopwatch.Stop();
Thread.Sleep(2000);
IOManager.IOMove(IO_Type.Traverse_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
LogUtil.info(" 滚筒、横移电机停止");
Thread.Sleep(1000);
IOManager.CIOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.HIGH);
IOManager.CIOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.LOW);
LogUtil.info(" 横移机构下降");
LogUtil.info(" TranverseProcess Finish");
}
private Task TranverseTask;
//private void LedProcess()
//{
// try
......@@ -474,35 +462,34 @@ namespace OnlineStore.DeviceLibrary
//}
//private IO_VALUE LastResetValue = IO_VALUE.LOW;
private Stopwatch ol_tranverseShelfWatch = new Stopwatch();
public void IoCheckProcess()
public DeviceLibrary.bean.RunStepInfo tranverseStep = new bean.RunStepInfo();
public void TranverseProcess()
{
DateTime time = DateTime.Now;
//人工取料
if (IOManager.IOValue(IO_Type.L1_ManualRecSig).Equals(IO_VALUE.HIGH))
{
if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
if (IOManager.IOValue(IO_Type.L2_ManualRecSig).Equals(IO_VALUE.HIGH) || IOManager.IOValue(IO_Type.L3_ManualRecSig).Equals(IO_VALUE.HIGH))
{
//if (LineManager.checkWatch(ol_tranverseShelfWatch, 2000))
{
if (TranverseTask == null)
if (tranverseStep.IsStep(tranverseStep.S1))
{
TranverseTask = Task.Factory.StartNew(new Action(TranverseProcess));
il_lastCallAgvTime = DateTime.Now;
tranverseStep.Execute();
}
else if (TranverseTask.IsCompleted)
else
{
TranverseTask = Task.Factory.StartNew(new Action(TranverseProcess));
il_lastCallAgvTime = DateTime.Now;
if(tranverseStep.IsFinished())
{
tranverseStep.Execute();
}
}
}
}
else
{
ol_tranverseShelfWatch.Stop();
}
public void IoCheckProcess()
{
DateTime time = DateTime.Now;
//if (runStatus.Equals(RunStatus.Wait))
//{
// //获取新的Io状态
......
......@@ -128,8 +128,9 @@ namespace OnlineStore.DeviceLibrary
{
//return "进料线出口" + Config.L2_AgvName + ":" + AgvClient.GetAction(Config.L2_AgvName) + ",料架: " + LastInShelfId + "\r\n" +
// "出料线进口" + Config.L1_AgvName + ":" + AgvClient.GetAction(Config.L1_AgvName) + ",料架: " + LastOutShelfId + "\r\n";
return "分盘1线入料口" + Config.L1_AgvName + ":" + AgvClient.GetAction(Config.L1_AgvName) + ",料架: " + LastInShelfId + "\r\n" +
"分盘2线出料口" + Config.L2_AgvName + ":" + AgvClient.GetAction(Config.L2_AgvName) + ",料架: " + LastOutShelfId + "\r\n";
return "入料线入料口" + Config.L1_AgvName + ":" + AgvClient.GetAction(Config.L1_AgvName) + ",料架: " + LastInShelfId + "\r\n" +
"出料线出料口" + Config.L2_AgvName + ":" + AgvClient.GetAction(Config.L2_AgvName) + ",料架: " + LastOutShelfId + "\r\n"+
"空串线出料口" + Config.L3_AgvName + ":" + AgvClient.GetAction(Config.L3_AgvName) + ",料架: " + LastOutShelfId + "\r\n";
}
#endregion
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.bean
{
public class RunStepInfo
{
public IStep Step;
public IStep S1;
public IStep S2;
public IStep S3_Out;
public IStep S3_Empty;
public IStep S4;
public RunStepInfo()
{
Step = new S1_None(this);
S1 = new S1_None(this);
S2 = new S2_CheckTarLine(this);
S3_Empty = new S3_ToEmptyLine(this);
S3_Out = new S3_ToOutLine(this);
S4 = new S4_Finish(this);
}
public bool IsStep(IStep step)
{
return Step.Equals(step);
}
public void Execute()
{
Step.Execute();
}
public bool IsFinished()
{
return Step.IsFinished();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.bean
{
public abstract class IStep
{
protected RunStepInfo runStepInfo;
protected string msg = "";
protected IStep preStep;
public string Msg
{
get { return msg; }
set
{
if (!string.IsNullOrEmpty(value))
{
if (!value.Equals(msg))
{
Common.LogUtil.info(msg);
msg = value;
}
}
}
}
public IStep(RunStepInfo runStepInfo)
{
this.runStepInfo = runStepInfo;
}
/// <summary>
/// 执行该步骤
/// </summary>
public abstract void Execute();
/// <summary>
/// 进行下一步骤
/// </summary>
public virtual void ToNextStep(IStep nextStep)
{
preStep = runStepInfo.Step;
runStepInfo.Step = nextStep;
}
/// <summary>
/// 结束流程
/// </summary>
public virtual void EndStep()
{
runStepInfo.Step = runStepInfo.S1;
}
/// <summary>
/// 检查该步骤是否完成
/// </summary>
/// <returns></returns>
public abstract bool IsFinished();
}
}
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.bean
{
public class S1_None : IStep
{
public S1_None(RunStepInfo runStepInfo):base(runStepInfo)
{
}
public override void Execute()
{
if(IOManager.IOValue(IO_Type.L2_ManualRecSig).Equals(IO_VALUE.HIGH) || IOManager.IOValue(IO_Type.L3_ManualRecSig).Equals(IO_VALUE.HIGH))
{
IOManager.CIOMove(IO_Type.L1_Traverse_Down_SOL, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.IOMove(IO_Type.L1_Traverse_Up_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
}
}
public override bool IsFinished()
{
if (IOManager.IOValue(IO_Type.L1_UpDown_Up_Sig).Equals(IO_VALUE.LOW) && IOManager.IOValue(IO_Type.L1_Traverse_Down_SOL).Equals(IO_VALUE.HIGH))
{
msg = "入料线体横移上升";
ToNextStep(runStepInfo.S2);
return true;
}
return false;
}
}
}
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.bean
{
public class S2_CheckTarLine : IStep
{
public S2_CheckTarLine(RunStepInfo runStepInfo):base(runStepInfo)
{
}
public override void Execute()
{
if (IOManager.IOValue(IO_Type.L2_ManualRecSig).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L3_ManualRecSig).Equals(IO_VALUE.LOW) &&
IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))//进料线-》出料线
{
IOManager.CIOMove(IO_Type.L2_Traverse_Down_SOL, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.IOMove(IO_Type.L2_Traverse_Up_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
}
else if (IOManager.IOValue(IO_Type.L3_ManualRecSig).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_ManualRecSig).Equals(IO_VALUE.LOW) &&
IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L3_InCheck).Equals(IO_VALUE.LOW))//进料线-》空料串料线
{
IOManager.CIOMove(IO_Type.L3_Traverse_Down_SOL, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.IOMove(IO_Type.L3_Traverse_Up_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
}
}
public override bool IsFinished()
{
if(IOManager.IOValue(IO_Type.L2_UpDown_Up_Sig).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_Traverse_Down_SOL).Equals(IO_VALUE.LOW))
{
msg = "出料线体横移上升";
ToNextStep(runStepInfo.S3_Out);
return true;
}
else if(IOManager.IOValue(IO_Type.L3_UpDown_Up_Sig).Equals(IO_VALUE.HIGH)&& IOManager.IOValue(IO_Type.L3_UpDown_Down_Sig).Equals(IO_VALUE.LOW))
{
msg = "空料串线体横移上升";
ToNextStep(runStepInfo.S3_Empty);
return true;
}
return false;
}
}
}
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.bean
{
public class S3_ToEmptyLine : IStep
{
public S3_ToEmptyLine(RunStepInfo runStepInfo):base(runStepInfo)
{
}
public override void Execute()
{
IOManager.CIOMove(IO_Type.L1_Traverse_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_BackRun, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.L3_Traverse_Run, IO_VALUE.HIGH);
}
public override bool IsFinished()
{
if (IOManager.IOValue(IO_Type.L3_InCheck).Equals(IO_VALUE.HIGH))
{
msg = "料串流到空料串线体";
Thread.Sleep(3000);
this.ToNextStep(runStepInfo.S4);
return true;
}
msg = "横移反转,等待料串流到空料串线体";
return false;
}
}
}
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.bean
{
public class S3_ToOutLine : IStep
{
public S3_ToOutLine(RunStepInfo runStepInfo):base(runStepInfo)
{
}
public override void Execute()
{
IOManager.IOMove(IO_Type.L1_Traverse_BackRun, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_Traverse_Run, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.L2_Traverse_Run, IO_VALUE.HIGH);
}
public override bool IsFinished()
{
if (IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.HIGH))
{
msg = "料串流到出料线体";
Thread.Sleep(3000);
this.ToNextStep(runStepInfo.S4);
return true;
}
msg = "横移正转,等待料串流到出料线体";
return false;
}
}
}
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.bean
{
public class S4_Finish : IStep
{
public S4_Finish(RunStepInfo runStepInfo):base(runStepInfo)
{
}
public override void Execute()
{
IOManager.IOMove(IO_Type.L1_Traverse_Up_SOL, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.L1_Traverse_Down_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.L1_Traverse_Run, IO_VALUE.LOW);
IOManager.CIOMove(IO_Type.L1_Traverse_BackRun, IO_VALUE.LOW);
if (preStep.Equals(runStepInfo.S3_Empty))
{
IOManager.IOMove(IO_Type.L3_Traverse_Up_SOL, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.L3_Traverse_Down_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
}
else if(preStep.Equals(runStepInfo.S3_Out))
{
IOManager.IOMove(IO_Type.L2_Traverse_Up_SOL, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.L2_Traverse_Down_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
}
}
public override bool IsFinished()
{
if (preStep.Equals(runStepInfo.S3_Empty))
{
if(IOManager.IOValue(IO_Type.L3_Traverse_Down_SOL).Equals(IO_VALUE.HIGH))
{
msg = "料串转移完成:入料线体->空料串线体";
EndStep();
return true;
}
}
else if (preStep.Equals(runStepInfo.S3_Out))
{
if (IOManager.IOValue(IO_Type.L2_Traverse_Down_SOL).Equals(IO_VALUE.HIGH))
{
msg = "料串转移完成:入料线体->出料线体";
EndStep();
return true;
}
}
return false;
}
}
}
......@@ -41,15 +41,20 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IO_DOLength")]
public string IO_DOLength { get; set; }
/// <summary>
/// PRO,分盘1线AGV节点名称,L1_AgvName,A8,,,,,,,
///PRO,进料线AGV节点名称,L1_AgvName,A8,,,,,,,
/// </summary>
[ConfigProAttribute("L1_AgvName")]
public string L1_AgvName { get; set; }
/// <summary>
/// PRO,分盘2线AGV节点名称,L2_AgvName,A7,,,,,,,
/// PRO,出料线AGV节点名称,L2_AgvName,A9,,,,,,,
/// </summary>
[ConfigProAttribute("L2_AgvName")]
public string L2_AgvName { get; set; }
/// <summary>
/// PRO,空料串线AGV节点名称,L3_AgvName,A7,,,,,,,
/// </summary>
[ConfigProAttribute("L3_AgvName")]
public string L3_AgvName { get; set; }
public double AirCheckSeconds = 60;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!