Commit 87d44079 LN

皮带线456需要提前扫码,扫码后缓存,送料逻辑修改

1 个父辈 62da7271
......@@ -5,7 +5,7 @@
</configSections>
<appSettings>
<!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1" />
<add key="App_AutoRun" value="0" />
<add key="App_Title" value="流水线客户端" />
<!--Server address-->
<!--<add key="http.server" value="http://localhost/myproject/service/store/emptyPosForPutin"/>-->
......@@ -50,7 +50,7 @@
<add key ="OpenRFIDWrite" value ="1"/>
<add key="DefaultPWD" value ="123456"/>
<!--当前调试的设备ID,分号分割-->
<add key ="DebugDeviceId" value ="301"/>
<add key ="DebugDeviceId" value ="302"/>
<add key ="Server_Log_Open" value ="0"/>
<add key ="CodeCount" value ="3"/>
<add key ="DefaultTrayNum" value ="0"/>
......
......@@ -26,6 +26,7 @@
this.btnStart = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button();
this.btnReset = new System.Windows.Forms.Button();
this.btnScanCylinder = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
......@@ -36,8 +37,8 @@
this.cmbLineType = new System.Windows.Forms.ComboBox();
this.btnLine1Test = new System.Windows.Forms.Button();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.lblThisSta = new System.Windows.Forms.Label();
this.lblMoveInfo = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label();
this.lblTrayNum = new System.Windows.Forms.Label();
this.lblInstoreList = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
......@@ -45,14 +46,13 @@
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.btnScanCylinder = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.btnNgMove = new System.Windows.Forms.Button();
this.btnSRun = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btnRun2 = new System.Windows.Forms.Button();
this.btnRun3 = new System.Windows.Forms.Button();
this.btnRun1 = new System.Windows.Forms.Button();
this.btnCloseAll = new System.Windows.Forms.Button();
this.btnStop1Up = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtDOIndex = new System.Windows.Forms.TextBox();
......@@ -62,6 +62,7 @@
this.btnOpenDo = new System.Windows.Forms.Button();
this.btnWriteSingleDO = new System.Windows.Forms.Button();
this.txtWriteTime = new System.Windows.Forms.TextBox();
this.btnCloseAll = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.txtSlaveId = new System.Windows.Forms.TextBox();
this.cmbWriteIO = new System.Windows.Forms.ComboBox();
......@@ -186,6 +187,19 @@
this.btnReset.UseVisualStyleBackColor = false;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// btnScanCylinder
//
this.btnScanCylinder.BackColor = System.Drawing.Color.White;
this.btnScanCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnScanCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnScanCylinder.Location = new System.Drawing.Point(271, 62);
this.btnScanCylinder.Name = "btnScanCylinder";
this.btnScanCylinder.Size = new System.Drawing.Size(128, 34);
this.btnScanCylinder.TabIndex = 266;
this.btnScanCylinder.Text = "扫码NG气缸前进";
this.btnScanCylinder.UseVisualStyleBackColor = false;
this.btnScanCylinder.Click += new System.EventHandler(this.btnScanCylinder_Click);
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
......@@ -307,8 +321,8 @@
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.lblThisSta);
this.groupBox6.Controls.Add(this.lblMoveInfo);
this.groupBox6.Controls.Add(this.lblThisSta);
this.groupBox6.Controls.Add(this.lblTrayNum);
this.groupBox6.Controls.Add(this.lblInstoreList);
this.groupBox6.Location = new System.Drawing.Point(495, 227);
......@@ -318,6 +332,17 @@
this.groupBox6.TabStop = false;
this.groupBox6.Text = "消息";
//
// lblMoveInfo
//
this.lblMoveInfo.AutoSize = true;
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.Location = new System.Drawing.Point(6, 22);
this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(68, 17);
this.lblMoveInfo.TabIndex = 279;
this.lblMoveInfo.Text = "运动信息:";
//
// lblThisSta
//
this.lblThisSta.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
......@@ -326,24 +351,13 @@
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.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblThisSta.Location = new System.Drawing.Point(271, 19);
this.lblThisSta.Location = new System.Drawing.Point(271, 14);
this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(520, 234);
this.lblThisSta.Size = new System.Drawing.Size(520, 137);
this.lblThisSta.TabIndex = 246;
this.lblThisSta.Text = "等待启动";
this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblMoveInfo
//
this.lblMoveInfo.AutoSize = true;
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.Location = new System.Drawing.Point(6, 22);
this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(68, 17);
this.lblMoveInfo.TabIndex = 279;
this.lblMoveInfo.Text = "运动信息:";
//
// lblTrayNum
//
this.lblTrayNum.AutoSize = true;
......@@ -426,13 +440,13 @@
this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox5.Controls.Add(this.btnScanCylinder);
this.groupBox5.Controls.Add(this.button1);
this.groupBox5.Controls.Add(this.button2);
this.groupBox5.Controls.Add(this.btnNgMove);
this.groupBox5.Controls.Add(this.btnSRun);
this.groupBox5.Controls.Add(this.button1);
this.groupBox5.Controls.Add(this.btnRun2);
this.groupBox5.Controls.Add(this.btnRun3);
this.groupBox5.Controls.Add(this.btnRun1);
this.groupBox5.Controls.Add(this.btnCloseAll);
this.groupBox5.Controls.Add(this.btnStop1Up);
this.groupBox5.Location = new System.Drawing.Point(876, 6);
this.groupBox5.Name = "groupBox5";
......@@ -441,42 +455,29 @@
this.groupBox5.TabStop = false;
this.groupBox5.Text = "IO操作测试";
//
// btnScanCylinder
//
this.btnScanCylinder.BackColor = System.Drawing.Color.White;
this.btnScanCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnScanCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnScanCylinder.Location = new System.Drawing.Point(140, 102);
this.btnScanCylinder.Name = "btnScanCylinder";
this.btnScanCylinder.Size = new System.Drawing.Size(128, 34);
this.btnScanCylinder.TabIndex = 266;
this.btnScanCylinder.Text = "扫码NG气缸前进";
this.btnScanCylinder.UseVisualStyleBackColor = false;
this.btnScanCylinder.Click += new System.EventHandler(this.btnScanCylinder_Click);
//
// button1
// button2
//
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(8, 102);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(128, 34);
this.button1.TabIndex = 265;
this.button1.Text = "分盘装置电机停止";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
this.button2.BackColor = System.Drawing.Color.White;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(140, 62);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(128, 34);
this.button2.TabIndex = 266;
this.button2.Text = "分盘装置电机反转";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// btnNgMove
//
this.btnNgMove.BackColor = System.Drawing.Color.White;
this.btnNgMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNgMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNgMove.Location = new System.Drawing.Point(271, 62);
this.btnNgMove.Location = new System.Drawing.Point(271, 102);
this.btnNgMove.Name = "btnNgMove";
this.btnNgMove.Size = new System.Drawing.Size(128, 34);
this.btnNgMove.TabIndex = 264;
this.btnNgMove.Text = "NG气缸前进";
this.btnNgMove.Text = "入库NG气缸前进";
this.btnNgMove.UseVisualStyleBackColor = false;
this.btnNgMove.Click += new System.EventHandler(this.btnNgMove_Click);
//
......@@ -485,7 +486,7 @@
this.btnSRun.BackColor = System.Drawing.Color.White;
this.btnSRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSRun.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSRun.Location = new System.Drawing.Point(8, 62);
this.btnSRun.Location = new System.Drawing.Point(140, 22);
this.btnSRun.Name = "btnSRun";
this.btnSRun.Size = new System.Drawing.Size(128, 34);
this.btnSRun.TabIndex = 263;
......@@ -493,12 +494,25 @@
this.btnSRun.UseVisualStyleBackColor = false;
this.btnSRun.Click += new System.EventHandler(this.btnSRun_Click);
//
// button1
//
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(140, 102);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(128, 34);
this.button1.TabIndex = 265;
this.button1.Text = "分盘装置电机停止";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// btnRun2
//
this.btnRun2.BackColor = System.Drawing.Color.White;
this.btnRun2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun2.Location = new System.Drawing.Point(140, 22);
this.btnRun2.Location = new System.Drawing.Point(8, 62);
this.btnRun2.Name = "btnRun2";
this.btnRun2.Size = new System.Drawing.Size(128, 34);
this.btnRun2.TabIndex = 262;
......@@ -511,7 +525,7 @@
this.btnRun3.BackColor = System.Drawing.Color.White;
this.btnRun3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun3.Location = new System.Drawing.Point(271, 22);
this.btnRun3.Location = new System.Drawing.Point(8, 102);
this.btnRun3.Name = "btnRun3";
this.btnRun3.Size = new System.Drawing.Size(128, 34);
this.btnRun3.TabIndex = 261;
......@@ -532,25 +546,12 @@
this.btnRun1.UseVisualStyleBackColor = false;
this.btnRun1.Click += new System.EventHandler(this.btnRun1_Click);
//
// btnCloseAll
//
this.btnCloseAll.BackColor = System.Drawing.Color.White;
this.btnCloseAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAll.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAll.Location = new System.Drawing.Point(271, 102);
this.btnCloseAll.Name = "btnCloseAll";
this.btnCloseAll.Size = new System.Drawing.Size(128, 34);
this.btnCloseAll.TabIndex = 259;
this.btnCloseAll.Text = "关闭所有DO";
this.btnCloseAll.UseVisualStyleBackColor = false;
this.btnCloseAll.Click += new System.EventHandler(this.btnCloseAll_Click);
//
// btnStop1Up
//
this.btnStop1Up.BackColor = System.Drawing.Color.White;
this.btnStop1Up.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStop1Up.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStop1Up.Location = new System.Drawing.Point(140, 62);
this.btnStop1Up.Location = new System.Drawing.Point(271, 22);
this.btnStop1Up.Name = "btnStop1Up";
this.btnStop1Up.Size = new System.Drawing.Size(128, 34);
this.btnStop1Up.TabIndex = 256;
......@@ -567,6 +568,7 @@
this.groupBox1.Controls.Add(this.btnOpenDo);
this.groupBox1.Controls.Add(this.btnWriteSingleDO);
this.groupBox1.Controls.Add(this.txtWriteTime);
this.groupBox1.Controls.Add(this.btnCloseAll);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtSlaveId);
this.groupBox1.Controls.Add(this.cmbWriteIO);
......@@ -582,7 +584,7 @@
//
this.txtDOIndex.Enabled = false;
this.txtDOIndex.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtDOIndex.Location = new System.Drawing.Point(322, 63);
this.txtDOIndex.Location = new System.Drawing.Point(201, 63);
this.txtDOIndex.MaxLength = 10;
this.txtDOIndex.Name = "txtDOIndex";
this.txtDOIndex.Size = new System.Drawing.Size(47, 23);
......@@ -593,7 +595,7 @@
//
this.txtDoName.Enabled = false;
this.txtDoName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtDoName.Location = new System.Drawing.Point(65, 63);
this.txtDoName.Location = new System.Drawing.Point(40, 63);
this.txtDoName.MaxLength = 10;
this.txtDoName.Name = "txtDoName";
this.txtDoName.Size = new System.Drawing.Size(116, 23);
......@@ -607,9 +609,9 @@
this.label17.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label17.Location = new System.Drawing.Point(13, 66);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(46, 17);
this.label17.Size = new System.Drawing.Size(22, 17);
this.label17.TabIndex = 266;
this.label17.Text = "设备IP:";
this.label17.Text = "IP:";
this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label14
......@@ -617,7 +619,7 @@
this.label14.AutoSize = true;
this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label14.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label14.Location = new System.Drawing.Point(266, 66);
this.label14.Location = new System.Drawing.Point(161, 66);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(35, 17);
this.label14.TabIndex = 265;
......@@ -629,7 +631,7 @@
this.btnOpenDo.BackColor = System.Drawing.Color.White;
this.btnOpenDo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenDo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenDo.Location = new System.Drawing.Point(163, 99);
this.btnOpenDo.Location = new System.Drawing.Point(14, 102);
this.btnOpenDo.Name = "btnOpenDo";
this.btnOpenDo.Size = new System.Drawing.Size(100, 34);
this.btnOpenDo.TabIndex = 264;
......@@ -642,7 +644,7 @@
this.btnWriteSingleDO.BackColor = System.Drawing.Color.White;
this.btnWriteSingleDO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnWriteSingleDO.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnWriteSingleDO.Location = new System.Drawing.Point(269, 99);
this.btnWriteSingleDO.Location = new System.Drawing.Point(126, 102);
this.btnWriteSingleDO.Name = "btnWriteSingleDO";
this.btnWriteSingleDO.Size = new System.Drawing.Size(100, 34);
this.btnWriteSingleDO.TabIndex = 261;
......@@ -653,19 +655,32 @@
// txtWriteTime
//
this.txtWriteTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtWriteTime.Location = new System.Drawing.Point(76, 105);
this.txtWriteTime.Location = new System.Drawing.Point(318, 62);
this.txtWriteTime.MaxLength = 10;
this.txtWriteTime.Name = "txtWriteTime";
this.txtWriteTime.Size = new System.Drawing.Size(66, 23);
this.txtWriteTime.Size = new System.Drawing.Size(46, 23);
this.txtWriteTime.TabIndex = 263;
this.txtWriteTime.Text = "0";
//
// btnCloseAll
//
this.btnCloseAll.BackColor = System.Drawing.Color.White;
this.btnCloseAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAll.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAll.Location = new System.Drawing.Point(238, 102);
this.btnCloseAll.Name = "btnCloseAll";
this.btnCloseAll.Size = new System.Drawing.Size(128, 34);
this.btnCloseAll.TabIndex = 259;
this.btnCloseAll.Text = "关闭所有DO";
this.btnCloseAll.UseVisualStyleBackColor = false;
this.btnCloseAll.Click += new System.EventHandler(this.btnCloseAll_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label5.Location = new System.Drawing.Point(13, 108);
this.label5.Location = new System.Drawing.Point(253, 65);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(60, 17);
this.label5.TabIndex = 262;
......@@ -781,6 +796,7 @@
private System.Windows.Forms.Button btnNgMove;
private System.Windows.Forms.Button btnScanCylinder;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
}
}
......@@ -351,20 +351,7 @@ namespace OnlineStore.AssemblyLine
private void btnSRun_Click(object sender, EventArgs e)
{
LogUtil.info(equipBase.Name + "点击【" + btnSRun.Text + "】 ");
if (btnSRun.Text.Equals("分盘装置电机正转"))
{
equipBean.SeparateLineRun();
btnSRun.Text = "分盘装置电机反转";
btnSRun.BackColor = Color.Aqua;
}
else
{
equipBean.SeparateBackRun();
btnSRun.Text = "分盘装置电机正转";
btnSRun.BackColor = Color.SkyBlue;
}
//BtnMove(btnSRun, "分盘装置电机驱动", "分盘装置电机停止", IO_Type.SeparateDevice_Run);
equipBean.SeparateLineRun();
}
private void btnStrart_Click(object sender, EventArgs e)
......@@ -446,37 +433,49 @@ namespace OnlineStore.AssemblyLine
//判断line2是否停止
if (equipBase.IOValue(IO_Type.DLine_Run2).Equals(IO_VALUE.LOW))
{
BtnMove(btnNgMove, "NG气缸前进", "NG气缸后退", IO_Type.NGCylinder_After, IO_Type.NGCylinder_Before);
BtnMove(btnNgMove, "入库NG气缸前进", "入库NG气缸后退", IO_Type.NGCylinder_After, IO_Type.NGCylinder_Before);
}
else
{
MessageBox.Show(line2Name+"运转中,NG气缸不能动作");
MessageBox.Show(line2Name+"运转中,入库NG气缸不能动作");
}
}
private void button1_Click(object sender, EventArgs e)
{
LogUtil.info(equipBase.Name + "点击【" + button1.Text + "】 ");
equipBean.SeparateStopRun();
btnSRun.BackColor = Color.White;
equipBean.SeparateStopRun();
}
private void btnScanCylinder_Click(object sender, EventArgs e)
{
LogUtil.info(equipBase.Name + "点击【" + btnScanCylinder.Text + "】 ");
if (btnScanCylinder.Text.Equals("扫码NG气缸前进"))
if (equipBase.IOValue(IO_Type.DLine_Run3).Equals(IO_VALUE.LOW))
{
equipBean.ScanNgForward(null);
btnScanCylinder.Text = "扫码NG气缸后退";
btnScanCylinder.BackColor = Color.Aqua;
}
LogUtil.info(equipBase.Name + "点击【" + btnScanCylinder.Text + "】 ");
if (btnScanCylinder.Text.Equals("扫码NG气缸前进"))
{
equipBean.ScanNgForward(null);
btnScanCylinder.Text = "扫码NG气缸后退";
btnScanCylinder.BackColor = Color.Aqua;
}
else
{
equipBean.ScanNgBack(null);
btnScanCylinder.Text = "扫码NG气缸前进";
btnScanCylinder.BackColor = Color.SkyBlue;
}
}
else
{
equipBean.ScanNgBack(null);
btnScanCylinder.Text = "扫码NG气缸前进";
btnScanCylinder.BackColor = Color.SkyBlue;
MessageBox.Show(line2Name + "运转中,扫码NG气缸不能动作");
}
}
private void button2_Click(object sender, EventArgs e)
{
LogUtil.info(equipBase.Name + "点击【" + button2.Text + "】 ");
equipBean.SeparateStopRun();
}
}
}
......
......@@ -246,8 +246,10 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
皮带线扫码NG修改,皮带线123NG时转动到接驳台并倒转。
皮带线456扫码提前一个工位,NG时转动到下一个工位并NG气缸推出。
20200305:皮带线逻辑修改:
皮带线456需要提前扫码,扫码后缓存,送料逻辑修改。
皮带线456需要提前扫码,扫码后缓存。
......
......@@ -19,10 +19,17 @@ namespace OnlineStore.DeviceLibrary
public DischargeLine_Config Config;
public OutTrayLineBean TrayLine1 = null;
public OutTrayLineBean TrayLine2 = null;
private StationTrayInfo StationInfo_Scan = new StationTrayInfo();
private StationTrayInfo StationInfo_NG = new StationTrayInfo(IO_VALUE.HIGH);
private StationTrayInfo StationInfo_Move = new StationTrayInfo();
private bool IsInScanCode = false;
private bool IsNewType = false;
internal LineTurnBean Line3Turn = null;
//皮带线3最后一盘料的位置
public int Line3LastTrayP = 0;
private string hengyiName = "横移皮带线1";
private string hengyiName = "皮带线_1";
public DischargeLine(string cid, DischargeLine_Config config)
{
baseConfig = config;
......@@ -30,22 +37,23 @@ namespace OnlineStore.DeviceLibrary
this.Config = config;
IsDebug = config.IsDebug.Equals(1);
baseConfig = config;
Name = (" " + "_出料皮带线_" + (DeviceID.Equals(301) ? "123" : "456") + " ").ToUpper();
Name = (" " + "_皮带线_" + (DeviceID.Equals(301) ? "123" : "456") + " ").ToUpper();
Init();
UseAxis = false;
MoveInfo = new LineMoveInfo(DeviceID, "[" + Name + "-Move]");
SecondMoveInfo = new LineMoveInfo(DeviceID, "[" + Name + "-SMove]");
int id = DeviceID % 100;
hengyiName = "横移皮带线-" + ((id - 1) * 3 + 3) + " ";
hengyiName = "皮带线_" + ((id - 1) * 3 + 3) + " ";
if (id.Equals(1))
{
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.DeviceID);
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.DeviceID);
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.DeviceID);
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.DeviceID);
}
else
{
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.MiddleTray_Check3, this.DeviceID);
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.EntryTray_Check3, this.DeviceID);
IsNewType = true;
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.MiddleTray_Check3, this.DeviceID);
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.EntryTray_Check3, this.DeviceID);
}
Line3Turn = new LineTurnBean(DeviceID);
if ((DeviceID % 100).Equals(1))
......@@ -75,6 +83,8 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.StoreOnline;
runStatus = LineRunStatus.HomeMoving;
MoveInfo.NewMove(LineMoveType.ReturnHome);
//启动时需要主动扫码一次
NewTypeScan(true);
StartReset();
if (isDebug)
{
......@@ -96,13 +106,13 @@ namespace OnlineStore.DeviceLibrary
}
private void StartReset()
{
LogInfo("StartReset: 重置灯状态,关闭所有皮带线,定位气缸下降 开始;");
LogInfo("StartReset: 重置灯状态,关闭所有皮带线,定位气缸下降 开始;");
//复位时默认为有托盘
TrayLine1.LastTrayPosition = 1;
TrayLine2.LastTrayPosition = 1;
Line3LastTrayP = 1;
ResetClearData();
ResetClearData();
lineStatus = LineStatus.ResetMove;
MoveInfo.NextMoveStep(LineMoveStep.DL_R_CylinderDown);
CylinderMove(null, IO_Type.SeparateDevice_Up, IO_Type.SeparateDevice_Down);
......@@ -176,7 +186,7 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove(IO_Type.DLine_Run1, IO_VALUE.LOW);
CheckAndMove(IO_Type.DLine_Run2, IO_VALUE.LOW);
CheckAndMove(IO_Type.DLine_Run3, IO_VALUE.LOW);
// CheckAndMove(IO_Type.SeparateDevice_Run, IO_VALUE.LOW);
// CheckAndMove(IO_Type.SeparateDevice_Run, IO_VALUE.LOW);
SeparateStopRun();
}
......@@ -254,19 +264,29 @@ namespace OnlineStore.DeviceLibrary
IOTimeOutProcess();
//判断流水线打开了才可以运行
if (runStatus.Equals(LineRunStatus.Runing) && NoAlarm() && MoveInfo.MoveType.Equals(LineMoveType.None))
if (runStatus.Equals(LineRunStatus.Runing) && NoAlarm() && MoveInfo.MoveType.Equals(LineMoveType.None) && Line3TurnIsStop() && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW))
{
//皮带线3出口有料,分盘定位装置无料
if (Line3TurnIsStop() && IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW))
if (IsNewType)
{
//开始扫码然后送出料盘
//1.扫码,
//2.从服务器获取尺寸
//3.顶升或下降定位气缸
//皮带线3转动,分料皮带转动,
//等待料盘到达工位。
StartOutStoreMove(new InOutParam());
if (Line3TurnIsStop() && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW) && StationInfo_NG.TrayValue.Equals(IO_VALUE.HIGH))
{
StartNOutStoreMove(new InOutParam());
}
}
else
{
//皮带线3出口有料,分盘定位装置无料
if (Line3TurnIsStop() && IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW))
{
//开始扫码然后送出料盘
//1.扫码,
//2.从服务器获取尺寸
//3.顶升或下降定位气缸
//皮带线3转动,分料皮带转动,
//等待料盘到达工位。
StartOutStoreMove(new InOutParam());
}
}
}
if ((runStatus.Equals(LineRunStatus.Runing) || runStatus.Equals(LineRunStatus.Busy)))
......@@ -315,11 +335,11 @@ namespace OnlineStore.DeviceLibrary
}
internal bool ScanNgIsBack()
{
if (DeviceID.Equals(302) && IOValue(IO_Type.ScanNGCylinder_Back).Equals(IO_VALUE.LOW))
if (IsNewType && IOValue(IO_Type.ScanNGCylinder_Back).Equals(IO_VALUE.LOW))
{
return false ;
return false;
}
return true ;
return true;
}
internal bool Line3TurnIsStop()
{
......@@ -341,23 +361,30 @@ namespace OnlineStore.DeviceLibrary
}
private void Line3TimerPro()
{
bool ngNoTray = IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW);
if (IsNewType)
{
ngNoTray = StationInfo_NG.TrayValue.Equals(IO_VALUE.LOW);
}
//判断皮带线3出口无料,皮带线无操作
if (
ScanNgIsBack() &&
ScanNgIsBack() &&
Line3TurnIsStop() &&
Line3Turn.CanStart() &&
MoveInfo.MoveType.Equals(LineMoveType.None) &&
TrayLine1.Line3CanRun &&
TrayLine2.Line3CanRun &&
IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW) &&
ngNoTray &&
Line3HasTray()
&& (IsNewType.Equals(false) || IsInScanCode.Equals(false))
)
{
//判断皮带三还有料盘,需要转动一个工位
UpdateLastP();
LogUtil.debug(hengyiName + "空闲,且流水线还有料盘,转动一个工位");
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
}
}
}
private void UpdateLastP()
......@@ -414,9 +441,61 @@ namespace OnlineStore.DeviceLibrary
{
Line3LastTrayP++;
}
NewTypeScan();
}
}
private void NewTypeScan(bool isfirst = false)
{
if (IsNewType)
{
IsInScanCode = true;
LastCode = "";
//LastCodeList = new List<string>();
if (isfirst)
{
StationInfo_NG = new StationTrayInfo(IO_VALUE.HIGH);
}
else
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW))
{
StationInfo_Scan = new StationTrayInfo(IO_VALUE.LOW);
IsInScanCode = false;
}
else
{
Task.Factory.StartNew(delegate
{
try
{
LogUtil.info(hengyiName + "扫码工位:开始扫码,IsInScanCode=" + IsInScanCode);
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
LastCode = SServerManager.ProcessCodeList(LastCodeList);
// Thread.Sleep(5000);
}
catch (Exception ex)
{
LogUtil.error(Name + "扫码错误:" + ex.ToString());
}
finally
{
StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode);
IsInScanCode = false;
LogUtil.info(hengyiName + " 扫码工位 : 扫码结束 ," + StationInfo_Scan.ToStr + " IsInScanCode = " + IsInScanCode);
}
});
}
}
}
protected override void IOTimeOutProcess()
{
try
......@@ -449,21 +528,30 @@ namespace OnlineStore.DeviceLibrary
}
public override string GetMoveStr()
{
string msg = "";
int tLength = 10;
// int tLength = 10;
msg += "runS:" + runStatus + "\n";
msg += "lineS:" + lineStatus + "\n";
msg += "alarm: " + alarmType + "\n";
msg += "MoveT:" + MoveInfo.MoveType + "\n";
msg += "MoveS:" + MoveInfo.SLog + "\n";
msg += "L1-M:" + TrayLine1.MoveInfo.MoveType + " " + TrayLine1.MoveInfo.MoveStep + "\n";
msg += "L2-M:" + TrayLine2.MoveInfo.MoveType + " " + TrayLine2.MoveInfo.MoveStep + "\n";
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;
//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 + "=" + LastCode + "\n";
}
msg += "扫码工位:" + StationInfo_Scan.ToStr + "\n";
msg += "NG 工位:" + StationInfo_NG.ToStr + "\n";
msg += "IsInScanCode:" + IsInScanCode;
// msg += "LastWidth:" + LastWidth + "\n";
return msg;
}
public override bool StartInStoreMove(InOutParam param)
......@@ -493,7 +581,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SeparateDevice_BackRun, IO_VALUE.LOW);
}
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
}
public void SeparateBackRun(LineMoveInfo moveInfo = null)
{
......@@ -534,6 +622,7 @@ namespace OnlineStore.DeviceLibrary
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ScanNGCylinder_Back, IO_VALUE.LOW));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ScanNGCylinder_Forward, IO_VALUE.HIGH));
}
IOMove(IO_Type.ScanNGCylinder_Back, IO_VALUE.LOW);
IOMove(IO_Type.ScanNGCylinder_Forward, IO_VALUE.HIGH);
......@@ -546,10 +635,30 @@ namespace OnlineStore.DeviceLibrary
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ScanNGCylinder_Back, IO_VALUE.HIGH));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ScanNGCylinder_Forward, IO_VALUE.LOW));
}
IOMove(IO_Type.ScanNGCylinder_Forward, IO_VALUE.LOW);
IOMove(IO_Type.ScanNGCylinder_Back, IO_VALUE.HIGH);
}
}
}
public class StationTrayInfo
{
public StationTrayInfo(IO_VALUE value = IO_VALUE.LOW, string codes = "")
{
this.TrayValue = value;
this.CodeStr = codes;
}
public IO_VALUE TrayValue = IO_VALUE.LOW;
public string CodeStr = "";
public string ToStr
{
get
{
return TrayValue + "=" + CodeStr;
}
}
}
}
......@@ -11,11 +11,16 @@ namespace OnlineStore.DeviceLibrary
{
partial class DischargeLine
{
// private List<string> LastCodeList = new List<string>();
private string LastCode = "";
private int LastWidth = 0;
private int scanCodeCount = 0;
protected override bool CheckWaitResult(LineMoveInfo moveInfo, WaitResultInfo wait)
{
if (wait.WaitType.Equals(WaitEnum.W301_DLineScanCode))
{
if (LastCodeList.Count > 0)
if (String.IsNullOrEmpty(LastCode).Equals(false))
{
return true;
}
......@@ -27,7 +32,7 @@ namespace OnlineStore.DeviceLibrary
internal bool CanStartOut(int lineNum)
{
if (NoAlarm() || runStatus>LineRunStatus.HomeMoving)
if (NoAlarm() || runStatus > LineRunStatus.HomeMoving)
{
if (lineNum.Equals(1) && TrayLine1.MoveInfo.MoveType.Equals(LineMoveType.None))
{
......@@ -38,7 +43,7 @@ namespace OnlineStore.DeviceLibrary
return true;
}
}
return false;
}
......@@ -46,17 +51,18 @@ namespace OnlineStore.DeviceLibrary
#region 料盘移栽处理
public override bool StartOutStoreMove(InOutParam param)
{
{
if (runStatus.Equals(LineRunStatus.Runing))
{
runStatus = LineRunStatus.Busy;
MoveInfo.MoveParam = param;
MoveInfo.NewMove(LineMoveType.OutStore);
LogInfo(hengyiName+ "出口有料,NG气缸后退,等待1000后扫码");
LogUtil.info(hengyiName + "出口有料,NG气缸后退,等待1000后扫码");
MoveInfo.NextMoveStep(LineMoveStep.DO_01_WaitTime);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ScanNgBack(MoveInfo);
LastCodeList = new List<string>();
//LastCodeList = new List<string>();
LastCode = "";
LastWidth = 0;
scanCodeCount = 0;
return true;
......@@ -67,17 +73,14 @@ namespace OnlineStore.DeviceLibrary
return false;
}
}
private List<string> LastCodeList = new List<string>();
private int LastWidth = 0;
private int scanCodeCount=0;
private void ScanCode()
{
MoveInfo.NextMoveStep(LineMoveStep.DO_02_ScanCode);
MoveInfo.NextMoveStep(LineMoveStep.DO_02_ScanCode);
List<string> cameraList = Config.GetCameraList();
if (cameraList.Count > 0)
{
scanCodeCount++;
LogInfo(hengyiName + "出口有料,开始第【"+scanCodeCount+"】次扫码,皮带线停止转动");
LogUtil.info(hengyiName + "出口有料,开始第【" + scanCodeCount + "】次扫码,皮带线停止转动");
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitDLineScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
......@@ -86,25 +89,50 @@ namespace OnlineStore.DeviceLibrary
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
LastCode = SServerManager.ProcessCodeList(LastCodeList);
return LastCodeList;
});
}
catch (Exception ex)
{
LogUtil.error("FI_13_ScanCode扫码出错:",ex);
LogUtil.error("FI_13_ScanCode扫码出错:", ex);
}
}
else
{
LogInfo(hengyiName + "出口有料,未取到相机名称,不扫码,等待1000后继续");
LogUtil.info(hengyiName + "出口有料,未取到相机名称,不扫码,等待1000后继续");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
}
}
private void WaitSeparateCheck()
{
MoveInfo.NextMoveStep(LineMoveStep.DO_07_SeparateCheck);
// Line3LastTrayP++;
LogUtil.info(hengyiName + "出口有料,等待料盘到达分盘装置位置,最多等待60000");
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(60000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SeparateDevice_Check, IO_VALUE.HIGH));
}
private bool TrayProcessCanStartLine()
{
if (TrayLine2.Line3CanRun && TrayLine1.Line3CanRun
&& Line3TurnIsStop()
&& Line3Turn.CanStart()
&& ScanNgIsBack()
&& (IsNewType.Equals(false) || IsInScanCode.Equals(false))
)
{
return true;
}
return false;
}
protected override void OutStoreProcess()
{
if (MoveInfo.IsInWait)
......@@ -119,6 +147,8 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
#region 原有方式的横移料盘处理
if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_01_WaitTime))
{
ScanCode();
......@@ -127,13 +157,13 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.DO_03_GetTraySize);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
string lastCode = "";
foreach (string code in LastCodeList)
{
lastCode += code;
}
//string lastCode = "";
//foreach (string code in LastCodeList)
//{
// lastCode += code;
//}
//如果未扫到条码,重新扫码3次
if (scanCodeCount < 3 && lastCode.Equals("") && Config.GetCameraList().Count > 0)
if (scanCodeCount < 3 && LastCode.Equals("") && Config.GetCameraList().Count > 0)
{
ScanCode();
}
......@@ -145,8 +175,8 @@ namespace OnlineStore.DeviceLibrary
{
robotIndex = 2;
}
string result = SServerManager.GetTraySize(Name, robotIndex, LastCodeList, out LastWidth);
LogInfo(hengyiName + "出口有料,二维码[" + lastCode + "] 获取料盘尺寸【" + LastWidth + "】【" + result + "】");
string result = SServerManager.GetTraySize(Name, robotIndex, LastCode, out LastWidth);
LogUtil.info(hengyiName + "出口有料,二维码[" + LastCode + "] 获取料盘尺寸【" + LastWidth + "】【" + result + "】");
}
// MoveInfo.EndMove();
}
......@@ -155,12 +185,12 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.DO_04_SUpDownMove);
if (LastWidth.Equals(7))
{
LogInfo(hengyiName + "出口有料,料盘尺寸【" + LastWidth + "】上升分盘定位气缸");
CylinderMove(MoveInfo, IO_Type.SeparateDevice_Down, IO_Type.SeparateDevice_Up);
LogUtil.info(hengyiName + "出口有料,料盘尺寸【" + LastWidth + "】上升分盘定位气缸");
CylinderMove(MoveInfo, IO_Type.SeparateDevice_Down, IO_Type.SeparateDevice_Up);
}
else if (LastWidth > 0)
{
LogInfo(hengyiName + "出口有料,料盘尺寸【" + LastWidth + "】下降分盘定位气缸");
LogUtil.info(hengyiName + "出口有料,料盘尺寸【" + LastWidth + "】下降分盘定位气缸");
CylinderMove(MoveInfo, IO_Type.SeparateDevice_Up, IO_Type.SeparateDevice_Down);
}
else
......@@ -170,19 +200,19 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.DO_11_NGToNextStation);
if (DeviceID.Equals(301))
{
LogInfo(hengyiName + "扫码NG料, 先转动NG料到扫码后一个工位,需要停止接驳台皮带线");
{
LogUtil.info(hengyiName + "扫码NG料, 先转动NG料到扫码后一个工位,需要停止接驳台皮带线");
SeparateStopRun(MoveInfo);
}
else
{
LogInfo(hengyiName + "扫码NG料, 先转动NG料到扫码后一个工位");
{
LogUtil.info(hengyiName + "扫码NG料, 先转动NG料到扫码后一个工位");
}
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Location_Check3, IO_VALUE.HIGH));
}
}
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_04_SUpDownMove))
......@@ -190,7 +220,7 @@ namespace OnlineStore.DeviceLibrary
if (TrayProcessCanStartLine())
{
MoveInfo.NextMoveStep(LineMoveStep.DO_05_LineRun1);
LogInfo(hengyiName + "出口有料,转动皮带线到扫码后一个工位,同时转动分盘装置");
LogUtil.info(hengyiName + "出口有料,转动皮带线到扫码后一个工位,同时转动分盘装置");
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
......@@ -203,7 +233,7 @@ namespace OnlineStore.DeviceLibrary
if (DeviceID.Equals(301))
{
//如果是301可以直接结束
WaitSeparateCheck();
WaitSeparateCheck();
}
else
{
......@@ -211,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
if (TrayProcessCanStartLine())
{
MoveInfo.NextMoveStep(LineMoveStep.DO_06_LineRun2);
LogInfo(hengyiName + "出口有料,转动皮带线到扫码后二个工位,同时转动分盘装置");
LogUtil.info(hengyiName + "出口有料,转动皮带线到扫码后二个工位,同时转动分盘装置");
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
......@@ -234,23 +264,25 @@ namespace OnlineStore.DeviceLibrary
{
robotIndex = 2;
}
LogInfo(hengyiName + "出口有料,转动接驳台皮带线2000 , 收到SeparateDevice_Check信号,调用arriveRobotLocation=" + robotIndex);
LogUtil.info(hengyiName + "出口有料,转动接驳台皮带线2000 , 收到SeparateDevice_Check信号,调用arriveRobotLocation=" + robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex);
}
else
{
LogInfo(hengyiName + "出口有料,转动接驳台皮带线2000 ,未收到SeparateDevice_Check信号");
LogUtil.info(hengyiName + "出口有料,转动接驳台皮带线2000 ,未收到SeparateDevice_Check信号");
}
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_08_CRun))
{
MoveEndS();
// IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.LOW);
LogInfo(hengyiName + "出口有料,送料结束 ");
LogUtil.info(hengyiName + "出口有料,送料结束 ");
}
#endregion
#region NG料处理
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_11_NGToNextStation))
......@@ -259,14 +291,14 @@ namespace OnlineStore.DeviceLibrary
if (DeviceID.Equals(301))
{
MoveInfo.NextMoveStep(LineMoveStep.DO_15_SeparateBackRun);
LogInfo(hengyiName + "扫码NG料,接驳台开始倒转");
SeparateBackRun(MoveInfo);
LogUtil.info(hengyiName + "扫码NG料,接驳台开始倒转");
SeparateBackRun(MoveInfo);
}
//如果是302,NG气缸前进
else
{
MoveInfo.NextMoveStep(LineMoveStep.DO_12_NGCylinderForward);
LogInfo(hengyiName + "扫码NG料,NG气缸前进");
LogUtil.info(hengyiName + "扫码NG料,NG气缸前进");
ScanNgForward(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
......@@ -274,67 +306,181 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_12_NGCylinderForward))
{
MoveInfo.NextMoveStep(LineMoveStep.DO_13_NGCylinderWait);
LogInfo(hengyiName + "扫码NG料,NG气缸等待1500后后退");
LogUtil.info(hengyiName + "扫码NG料,NG气缸等待1500后后退");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_13_NGCylinderWait))
{
MoveInfo.NextMoveStep(LineMoveStep.DO_14_NGCylinderBack);
LogInfo(hengyiName + "扫码NG料,NG气缸后退");
LogUtil.info(hengyiName + "扫码NG料,NG气缸后退");
ScanNgBack(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_14_NGCylinderBack))
{
MoveEndS();
LogInfo(hengyiName + "扫码NG料结束,NG气缸已后退 ");
}
LogUtil.info(hengyiName + "扫码NG料结束,NG气缸已后退 ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_15_SeparateBackRun))
{
MoveInfo.NextMoveStep(LineMoveStep.DO_16_SeparateBackRunWait);
LogInfo(hengyiName + "扫码NG料,接驳台反转等待3000");
LogUtil.info(hengyiName + "扫码NG料,接驳台反转等待3000");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_16_SeparateBackRunWait))
{
MoveInfo.NextMoveStep(LineMoveStep.DO_17_SeparateStopRun);
LogInfo(hengyiName + "扫码NG料,接驳台停止反转");
LogUtil.info(hengyiName + "扫码NG料,接驳台停止反转");
SeparateStopRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_17_SeparateStopRun))
{
MoveInfo.NextMoveStep(LineMoveStep.DO_18_SeparateRun);
LogInfo(hengyiName + "扫码NG料,接驳台恢复正转");
LogUtil.info(hengyiName + "扫码NG料,接驳台恢复正转");
SeparateLineRun(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_18_SeparateRun))
{
MoveEndS();
LogInfo(hengyiName + "扫码NG料结束,皮带线已正转 ");
LogUtil.info(hengyiName + "扫码NG料结束,皮带线已正转 ");
}
#endregion
}
private void WaitSeparateCheck()
{
MoveInfo.NextMoveStep(LineMoveStep.DO_07_SeparateCheck);
// Line3LastTrayP++;
LogInfo(hengyiName + "出口有料,等待料盘到达分盘装置位置,最多等待60000");
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(60000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SeparateDevice_Check, IO_VALUE.HIGH));
#region 新方式的横移料盘处理,扫码工位与NG工位分开处理
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_01_WaitTime))
{
MoveInfo.NextMoveStep(LineMoveStep.DON_03_GetTraySize);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
LastWidth = 0;
int robotIndex = 1;
if (DeviceID.Equals(301))
{
robotIndex = 2;
}
string result = SServerManager.GetTraySize(Name, robotIndex, StationInfo_Move.CodeStr, out LastWidth);
LogUtil.info(hengyiName + MoveInfo.SLog + "送料: [" + StationInfo_Move.CodeStr + "] 获取尺寸【" + LastWidth + "】【" + result + "】");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_03_GetTraySize))
{
MoveInfo.NextMoveStep(LineMoveStep.DON_04_SUpDownMove);
if (LastWidth.Equals(7))
{
LogUtil.info(hengyiName + MoveInfo.SLog + "送料:【" + LastWidth + "】寸,上升分盘定位气缸");
CylinderMove(MoveInfo, IO_Type.SeparateDevice_Down, IO_Type.SeparateDevice_Up);
}
else if (LastWidth > 0)
{
LogUtil.info(hengyiName + MoveInfo.SLog + "送料: 【" + LastWidth + "】寸,下降分盘定位气缸");
CylinderMove(MoveInfo, IO_Type.SeparateDevice_Up, IO_Type.SeparateDevice_Down);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.DON_12_NGCylinderForward);
LogUtil.info(hengyiName + MoveInfo.SLog + "NG料:NG气缸前进");
ScanNgForward(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_04_SUpDownMove))
{
if (TrayProcessCanStartLine())
{
MoveInfo.NextMoveStep(LineMoveStep.DON_05_LineRun);
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,NG->接驳台,转动接驳台皮带");
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Location_Check3, IO_VALUE.HIGH));
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_05_LineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.DON_07_SeparateCheck);
// Line3LastTrayP++;
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,等待料盘到达接驳台,最多等待60000");
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(60000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SeparateDevice_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_07_SeparateCheck))
{
MoveInfo.NextMoveStep(LineMoveStep.DON_08_CRun);
if (IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.HIGH))
{
int robotIndex = 1;
if (DeviceID.Equals(301))
{
robotIndex = 2;
}
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台有料盘,等待2000,调用arriveRobotLocation=" + robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex);
}
else
{
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台无料盘,等待2000,");
}
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_08_CRun))
{
MoveEndS();
LogUtil.info(hengyiName + MoveInfo.SLog + "送料结束 ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_12_NGCylinderForward))
{
MoveInfo.NextMoveStep(LineMoveStep.DON_13_NGCylinderWait);
LogUtil.info(hengyiName + MoveInfo.SLog + ",NG气缸等待1500后后退");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_13_NGCylinderWait))
{
MoveInfo.NextMoveStep(LineMoveStep.DON_14_NGCylinderBack);
LogUtil.info(hengyiName + MoveInfo.SLog + "NG气缸后退");
ScanNgBack(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_14_NGCylinderBack))
{
MoveEndS();
LogUtil.info(hengyiName + MoveInfo.SLog + "NG处理结束 ,清理NG工位");
StationInfo_NG = new StationTrayInfo();
}
#endregion
}
private bool TrayProcessCanStartLine()
#endregion
#region 料盘新移栽处理:扫码提前,增加NG气缸
public bool StartNOutStoreMove(InOutParam param)
{
if (TrayLine2.Line3CanRun && TrayLine1.Line3CanRun
&& Line3TurnIsStop()
&& Line3Turn.CanStart()
&&ScanNgIsBack())
if (runStatus.Equals(LineRunStatus.Runing))
{
StationInfo_Move = new StationTrayInfo(StationInfo_NG.TrayValue, StationInfo_NG.CodeStr);
runStatus = LineRunStatus.Busy;
MoveInfo.MoveParam = param;
MoveInfo.NewMove(LineMoveType.OutStore);
LogUtil.info(hengyiName + "NG工位有料,NG气缸后退,等待100后获取尺寸");
MoveInfo.NextMoveStep(LineMoveStep.DON_01_WaitTime);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ScanNgBack(MoveInfo);
// LastCodeList = new List<string>();
LastWidth = 0;
// scanCodeCount = 0;
return true;
}
return false;
else
{
LogUtil.error(Name + " 启动出料失败,当前 storeStatus=" + runStatus);
return false;
}
}
#endregion
#endregion
}
}
......@@ -623,8 +623,8 @@ namespace OnlineStore.DeviceLibrary
//收到复位信号后启动
if (isAutoStart && fuweiValue.Equals(IO_VALUE.HIGH) && lastFuwei.Equals(IO_VALUE.LOW))
{
//没有启动时收到复位按钮,相当于启动按钮
LogUtil.info( Name + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
//没有启动时收到启动按钮
LogUtil.info( Name + "没有启动时收到启动按钮,开始调用启动方法!");
bool isOk = StartRun();
if (!isOk)
{
......
......@@ -450,7 +450,7 @@ namespace OnlineStore.DeviceLibrary
if (result.Equals(""))
{
if (span.TotalSeconds >= 4 && span.TotalSeconds <= 5)
{
{
LogUtil.debug(subType + "停止运动:[" + moveDO + "] [" + checkDI + "] 耗时 [" + FormUtil.GetSpanStr(span) + "][" + canWhileCount + "]");
}
else
......@@ -464,7 +464,10 @@ namespace OnlineStore.DeviceLibrary
}
LastEndTime = DateTime.Now;
IOManager.IOMove(moveDO, IO_VALUE.LOW, subType);
turnEnd?.Invoke(result.Equals(""));
Task.Factory.StartNew(delegate
{
turnEnd?.Invoke(result.Equals(""));
});
InTurn = false;
return result;
}
......
......@@ -145,22 +145,36 @@ namespace OnlineStore.DeviceLibrary
}
return "";
}
public static string GetTraySize(string deviceName, int robotIndex, List<string> codeList, out int outSize)
public static string ProcessCodeList(List<string> codeList)
{
string codeStr = "";
List<string> list = new List<string>();
foreach (string str in codeList)
{
if (list.Contains(str.Trim()) || String.IsNullOrEmpty(str.Trim()))
{
continue;
}
codeStr = codeStr + str.Trim() + spiltStr;
}
return codeStr;
}
public static string GetTraySize(string deviceName, int robotIndex, string codeStr, out int outSize)
{
outSize = 0;
string msg = "";
try
{
string codeStr = "";
List<string> list = new List<string>();
foreach (string str in codeList)
{
if (list.Contains(str.Trim()) || String.IsNullOrEmpty(str.Trim()))
{
continue;
}
codeStr = codeStr + str.Trim() + spiltStr;
}
//string codeStr = "";
//List<string> list = new List<string>();
//foreach (string str in codeList)
//{
// if (list.Contains(str.Trim()) || String.IsNullOrEmpty(str.Trim()))
// {
// continue;
// }
// codeStr = codeStr + str.Trim() + spiltStr;
//}
if (String.IsNullOrEmpty(codeStr))
{
return msg = deviceName + "未扫到条码";
......
......@@ -117,7 +117,7 @@ namespace OnlineStore.DeviceLibrary
if (balserNameList.Contains(cameraName))
{
bool result = BaslerCamera.Instance.Open(cameraName);
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
LogUtil.info("相机【" + cameraName + "】打开:" + result + "");
if (result)
{
BaslerCamera.Instance.GrabOne();
......@@ -183,20 +183,21 @@ namespace OnlineStore.DeviceLibrary
{
continue;
}
LogUtil.info(" 摄像机【" + cameraName + "】开始获取图片");
LogUtil.info(" 相机【" + cameraName + "】开始打开相机获取图片");
using (Bitmap bitmap = GetCamerImage(cameraName))
{
if (bitmap == null)
{
LogUtil.error(" 摄像机【" + cameraName + "】获取图片失败,关闭相机");
LogUtil.error(" 机【" + cameraName + "】获取图片失败,关闭相机");
CloseCamera();
continue;
}
LogUtil.info(" 【" + cameraName + "】获取图片完成,开始转换图片");
LogUtil.info("相机 【" + cameraName + "】获取图片完成,开始转换图片,并扫码");
System.Threading.Thread.Sleep(1);
//转换托盘大概100-150ms,不打印日志
HalconDotNet.HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.info(" 【" + cameraName + "】转换图片完成,开始扫码");
// LogUtil.info(" 相机【" + cameraName + "】转换图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
string r = "";
foreach (string codeType in codeTypeList)
......@@ -216,10 +217,10 @@ namespace OnlineStore.DeviceLibrary
codeList.Add(str);
r = r + "##" + str;
}
LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
// LogUtil.debug(" 相机【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
}
LogUtil.info("【" + cameraName + "】扫码完成:" + r);
LogUtil.info("相机【" + cameraName + "】扫码完成:" + r);
ho_Image.Dispose();
bitmap.Dispose();
}
......
......@@ -1040,6 +1040,50 @@ namespace OnlineStore.DeviceLibrary
DO_18_SeparateRun = 30218,
#endregion
#region 皮带线3送出料盘新处理,增加NG推出气缸后的处理
/// <summary>
/// 送料盘到双层线:NG气缸后退,等待100后处理,
/// </summary>
DON_01_WaitTime = 30401,
/// <summary>
/// 送料盘到双层线:根据二维码从服务器获取料盘尺寸
/// </summary>
DON_03_GetTraySize = 30403,
/// <summary>
/// 送料盘到双层线:上升或下降分盘定位气缸
/// </summary>
DON_04_SUpDownMove = 30404,
/// <summary>
/// 送料盘到双层线:转动皮带线,同时转动分盘装置
/// </summary>
DON_05_LineRun = 30405,
/// <summary>
/// 送料盘到双层线:等待料盘到达分盘装置位置
/// </summary>
DON_07_SeparateCheck = 30407,
/// <summary>
/// 送料盘到双层线:到达后再转动500
/// </summary>
DON_08_CRun = 30408,
/// <summary>
/// 横移NG料:NG气缸前进
/// </summary>
DON_12_NGCylinderForward = 30412,
/// <summary>
/// 横移NG料:NG气缸前进后等待1000ms
/// </summary>
DON_13_NGCylinderWait = 30413,
/// <summary>
/// 横移NG料:NG气缸后退
/// </summary>
DON_14_NGCylinderBack = 30414,
#endregion
#region 皮带线12接收料盘并转动处理
/// <summary>
/// 皮带线12处理料盘:需要放入料盘,等待入口无料盘
......@@ -1089,6 +1133,8 @@ namespace OnlineStore.DeviceLibrary
DLO_11_ExitNoTray
#endregion
#endregion
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!