Commit 8f31be6a LN

上料机构升降轴增加点取料位置P3

1 个父辈 0432b9cd
此文件类型无法预览
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
this.txtBP2 = new System.Windows.Forms.TextBox(); this.txtBP2 = new System.Windows.Forms.TextBox();
this.axisMoveControl1 = new OnlineStore.AssemblyLine.AxisMoveControl(); this.axisMoveControl1 = new OnlineStore.AssemblyLine.AxisMoveControl();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtUpdownP3 = new System.Windows.Forms.TextBox();
this.btnUpdownP3 = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.txtP1 = new System.Windows.Forms.TextBox(); this.txtP1 = new System.Windows.Forms.TextBox();
this.btnMoveToP1 = new System.Windows.Forms.Button(); this.btnMoveToP1 = new System.Windows.Forms.Button();
...@@ -87,6 +89,7 @@ ...@@ -87,6 +89,7 @@
this.btnMoveto = new System.Windows.Forms.Button(); this.btnMoveto = new System.Windows.Forms.Button();
this.txtSizePosition = new System.Windows.Forms.TextBox(); this.txtSizePosition = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.lblName = new System.Windows.Forms.Label(); this.lblName = new System.Windows.Forms.Label();
this.btnScan = new System.Windows.Forms.Button(); this.btnScan = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
...@@ -546,7 +549,7 @@ ...@@ -546,7 +549,7 @@
// //
this.chbDebug.AutoSize = true; this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(914, 21); this.chbDebug.Location = new System.Drawing.Point(881, 23);
this.chbDebug.Name = "chbDebug"; this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(84, 24); this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 247; this.chbDebug.TabIndex = 247;
...@@ -574,7 +577,7 @@ ...@@ -574,7 +577,7 @@
this.lblStoreStatus.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblStoreStatus.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStoreStatus.ForeColor = System.Drawing.Color.Green; this.lblStoreStatus.ForeColor = System.Drawing.Color.Green;
this.lblStoreStatus.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblStoreStatus.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblStoreStatus.Location = new System.Drawing.Point(1027, 23); this.lblStoreStatus.Location = new System.Drawing.Point(1065, 25);
this.lblStoreStatus.Name = "lblStoreStatus"; this.lblStoreStatus.Name = "lblStoreStatus";
this.lblStoreStatus.Size = new System.Drawing.Size(65, 20); this.lblStoreStatus.Size = new System.Drawing.Size(65, 20);
this.lblStoreStatus.TabIndex = 245; this.lblStoreStatus.TabIndex = 245;
...@@ -807,7 +810,7 @@ ...@@ -807,7 +810,7 @@
this.groupBox9.Size = new System.Drawing.Size(836, 150); this.groupBox9.Size = new System.Drawing.Size(836, 150);
this.groupBox9.TabIndex = 220; this.groupBox9.TabIndex = 220;
this.groupBox9.TabStop = false; this.groupBox9.TabStop = false;
this.groupBox9.Text = "上料轴位置配置"; this.groupBox9.Text = "上料提升轴位置配置";
// //
// btnBP3 // btnBP3
// //
...@@ -816,7 +819,7 @@ ...@@ -816,7 +819,7 @@
this.btnBP3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBP3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBP3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnBP3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBP3.ForeColor = System.Drawing.Color.Red; this.btnBP3.ForeColor = System.Drawing.Color.Red;
this.btnBP3.Location = new System.Drawing.Point(349, 34); this.btnBP3.Location = new System.Drawing.Point(324, 34);
this.btnBP3.Name = "btnBP3"; this.btnBP3.Name = "btnBP3";
this.btnBP3.RightToLeft = System.Windows.Forms.RightToLeft.No; this.btnBP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnBP3.Size = new System.Drawing.Size(163, 34); this.btnBP3.Size = new System.Drawing.Size(163, 34);
...@@ -831,7 +834,7 @@ ...@@ -831,7 +834,7 @@
this.txtBP3.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtBP3.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtBP3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtBP3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtBP3.ForeColor = System.Drawing.SystemColors.WindowText; this.txtBP3.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtBP3.Location = new System.Drawing.Point(515, 38); this.txtBP3.Location = new System.Drawing.Point(490, 38);
this.txtBP3.MaxLength = 12; this.txtBP3.MaxLength = 12;
this.txtBP3.Name = "txtBP3"; this.txtBP3.Name = "txtBP3";
this.txtBP3.RightToLeft = System.Windows.Forms.RightToLeft.No; this.txtBP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
...@@ -844,7 +847,7 @@ ...@@ -844,7 +847,7 @@
this.btnBSave.BackColor = System.Drawing.SystemColors.Control; this.btnBSave.BackColor = System.Drawing.SystemColors.Control;
this.btnBSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBSave.ForeColor = System.Drawing.Color.Red; this.btnBSave.ForeColor = System.Drawing.Color.Red;
this.btnBSave.Location = new System.Drawing.Point(349, 83); this.btnBSave.Location = new System.Drawing.Point(645, 79);
this.btnBSave.Name = "btnBSave"; this.btnBSave.Name = "btnBSave";
this.btnBSave.Size = new System.Drawing.Size(163, 34); this.btnBSave.Size = new System.Drawing.Size(163, 34);
this.btnBSave.TabIndex = 310; this.btnBSave.TabIndex = 310;
...@@ -921,6 +924,8 @@ ...@@ -921,6 +924,8 @@
// //
// groupBox2 // groupBox2
// //
this.groupBox2.Controls.Add(this.txtUpdownP3);
this.groupBox2.Controls.Add(this.btnUpdownP3);
this.groupBox2.Controls.Add(this.btnSave); this.groupBox2.Controls.Add(this.btnSave);
this.groupBox2.Controls.Add(this.txtP1); this.groupBox2.Controls.Add(this.txtP1);
this.groupBox2.Controls.Add(this.btnMoveToP1); this.groupBox2.Controls.Add(this.btnMoveToP1);
...@@ -933,14 +938,44 @@ ...@@ -933,14 +938,44 @@
this.groupBox2.Size = new System.Drawing.Size(836, 147); this.groupBox2.Size = new System.Drawing.Size(836, 147);
this.groupBox2.TabIndex = 218; this.groupBox2.TabIndex = 218;
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "升降轴位置配置"; this.groupBox2.Text = "移栽升降轴位置配置";
//
// txtUpdownP3
//
this.txtUpdownP3.BackColor = System.Drawing.SystemColors.Window;
this.txtUpdownP3.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtUpdownP3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtUpdownP3.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtUpdownP3.Location = new System.Drawing.Point(490, 83);
this.txtUpdownP3.MaxLength = 12;
this.txtUpdownP3.Name = "txtUpdownP3";
this.txtUpdownP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpdownP3.Size = new System.Drawing.Size(111, 26);
this.txtUpdownP3.TabIndex = 312;
this.txtUpdownP3.Text = "-1";
//
// btnUpdownP3
//
this.btnUpdownP3.BackColor = System.Drawing.SystemColors.Control;
this.btnUpdownP3.Cursor = System.Windows.Forms.Cursors.Default;
this.btnUpdownP3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdownP3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdownP3.ForeColor = System.Drawing.Color.Blue;
this.btnUpdownP3.Location = new System.Drawing.Point(324, 79);
this.btnUpdownP3.Name = "btnUpdownP3";
this.btnUpdownP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpdownP3.Size = new System.Drawing.Size(163, 34);
this.btnUpdownP3.TabIndex = 311;
this.btnUpdownP3.Text = "移栽升降轴取料位置P3:";
this.btnUpdownP3.UseVisualStyleBackColor = true;
this.btnUpdownP3.Click += new System.EventHandler(this.btnUpdownP3_Click);
// //
// btnSave // btnSave
// //
this.btnSave.BackColor = System.Drawing.SystemColors.Control; this.btnSave.BackColor = System.Drawing.SystemColors.Control;
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.ForeColor = System.Drawing.Color.Blue; this.btnSave.ForeColor = System.Drawing.Color.Blue;
this.btnSave.Location = new System.Drawing.Point(349, 80); this.btnSave.Location = new System.Drawing.Point(645, 80);
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(163, 34); this.btnSave.Size = new System.Drawing.Size(163, 34);
this.btnSave.TabIndex = 310; this.btnSave.TabIndex = 310;
...@@ -954,7 +989,7 @@ ...@@ -954,7 +989,7 @@
this.txtP1.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtP1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtP1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtP1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP1.ForeColor = System.Drawing.SystemColors.WindowText; this.txtP1.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtP1.Location = new System.Drawing.Point(515, 36); this.txtP1.Location = new System.Drawing.Point(493, 36);
this.txtP1.MaxLength = 12; this.txtP1.MaxLength = 12;
this.txtP1.Name = "txtP1"; this.txtP1.Name = "txtP1";
this.txtP1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.txtP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
...@@ -969,7 +1004,7 @@ ...@@ -969,7 +1004,7 @@
this.btnMoveToP1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnMoveToP1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMoveToP1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnMoveToP1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnMoveToP1.ForeColor = System.Drawing.Color.Blue; this.btnMoveToP1.ForeColor = System.Drawing.Color.Blue;
this.btnMoveToP1.Location = new System.Drawing.Point(349, 32); this.btnMoveToP1.Location = new System.Drawing.Point(327, 32);
this.btnMoveToP1.Name = "btnMoveToP1"; this.btnMoveToP1.Name = "btnMoveToP1";
this.btnMoveToP1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.btnMoveToP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnMoveToP1.Size = new System.Drawing.Size(163, 34); this.btnMoveToP1.Size = new System.Drawing.Size(163, 34);
...@@ -1013,7 +1048,7 @@ ...@@ -1013,7 +1048,7 @@
this.btnMoveto.RightToLeft = System.Windows.Forms.RightToLeft.No; this.btnMoveto.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnMoveto.Size = new System.Drawing.Size(163, 34); this.btnMoveto.Size = new System.Drawing.Size(163, 34);
this.btnMoveto.TabIndex = 306; this.btnMoveto.TabIndex = 306;
this.btnMoveto.Text = "移栽位置"; this.btnMoveto.Text = "移栽位置P2";
this.btnMoveto.UseVisualStyleBackColor = true; this.btnMoveto.UseVisualStyleBackColor = true;
this.btnMoveto.Click += new System.EventHandler(this.btnMoveto_Click); this.btnMoveto.Click += new System.EventHandler(this.btnMoveto_Click);
// //
...@@ -1035,6 +1070,7 @@ ...@@ -1035,6 +1070,7 @@
// //
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.chbMoveStop);
this.panel1.Controls.Add(this.lblName); this.panel1.Controls.Add(this.lblName);
this.panel1.Controls.Add(this.btnScan); this.panel1.Controls.Add(this.btnScan);
this.panel1.Controls.Add(this.chbDebug); this.panel1.Controls.Add(this.chbDebug);
...@@ -1049,6 +1085,18 @@ ...@@ -1049,6 +1085,18 @@
this.panel1.Size = new System.Drawing.Size(1326, 68); this.panel1.Size = new System.Drawing.Size(1326, 68);
this.panel1.TabIndex = 258; this.panel1.TabIndex = 258;
// //
// chbMoveStop
//
this.chbMoveStop.AutoSize = true;
this.chbMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMoveStop.Location = new System.Drawing.Point(971, 23);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(84, 24);
this.chbMoveStop.TabIndex = 250;
this.chbMoveStop.Text = "暂停运动";
this.chbMoveStop.UseVisualStyleBackColor = true;
this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged);
//
// lblName // lblName
// //
this.lblName.BackColor = System.Drawing.Color.DodgerBlue; this.lblName.BackColor = System.Drawing.Color.DodgerBlue;
...@@ -1185,6 +1233,9 @@ ...@@ -1185,6 +1233,9 @@
private System.Windows.Forms.Button btnScan; private System.Windows.Forms.Button btnScan;
private System.Windows.Forms.Label lblName; private System.Windows.Forms.Label lblName;
private System.Windows.Forms.Label lblMoveInfo; private System.Windows.Forms.Label lblMoveInfo;
internal System.Windows.Forms.TextBox txtUpdownP3;
internal System.Windows.Forms.Button btnUpdownP3;
private System.Windows.Forms.CheckBox chbMoveStop;
} }
} }
...@@ -105,9 +105,9 @@ namespace OnlineStore.AssemblyLine ...@@ -105,9 +105,9 @@ namespace OnlineStore.AssemblyLine
ReadIOList(); ReadIOList();
//lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID); //lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
} }
lblAgvInfo.Text ="AGV-"+equipBean.Config.AgvInName +" 状态:"+ AgvClient.GetAction(equipBean.Config.AgvInName).ToString()+ lblAgvInfo.Text = "AGV-" + equipBean.Config.AgvInName + " 状态:" + AgvClient.GetAction(equipBean.Config.AgvInName).ToString() +
"\t AGV-" + equipBean.Config.AgvOutName + " 状态:" + AgvClient.GetAction(equipBean.Config.AgvOutName).ToString() + ""; "\t AGV-" + equipBean.Config.AgvOutName + " 状态:" + AgvClient.GetAction(equipBean.Config.AgvOutName).ToString() + "";
string canOut =equipBean.Config.IsCanOut.Equals(1) ? "紧急出料模块" : "入料模块"; string canOut = equipBean.Config.IsCanOut.Equals(1) ? "紧急出料模块" : "入料模块";
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus) + "(" + canOut + ")"; lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus) + "(" + canOut + ")";
lblThisSta.Text = equipBean.WarnMsg; lblThisSta.Text = equipBean.WarnMsg;
string text = ""; string text = "";
...@@ -123,7 +123,7 @@ namespace OnlineStore.AssemblyLine ...@@ -123,7 +123,7 @@ namespace OnlineStore.AssemblyLine
if (!lblInstoreList.Text.Equals(text)) if (!lblInstoreList.Text.Equals(text))
{ {
lblInstoreList.Text = text; lblInstoreList.Text = text;
} }
lblMoveInfo.Text = equipBean.GetMoveStr(); lblMoveInfo.Text = equipBean.GetMoveStr();
} }
catch (Exception ex) catch (Exception ex)
...@@ -222,7 +222,7 @@ namespace OnlineStore.AssemblyLine ...@@ -222,7 +222,7 @@ namespace OnlineStore.AssemblyLine
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus); lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus);
lblThisSta.Text = equipBean.WarnMsg; lblThisSta.Text = equipBean.WarnMsg;
txtP1.Text = equipBean.Config.UpDownAxisP1.ToString(); txtP1.Text = equipBean.Config.UpDownAxisP1.ToString();
txtUpdownP3.Text = equipBean.Config.UpDownAxisP3.ToString();
if (equipBean.Config.SidesWayNum > 0) if (equipBean.Config.SidesWayNum > 0)
{ {
btnSwLocationCylinder.Visible = true; btnSwLocationCylinder.Visible = true;
...@@ -256,11 +256,11 @@ namespace OnlineStore.AssemblyLine ...@@ -256,11 +256,11 @@ namespace OnlineStore.AssemblyLine
e.Graphics.DrawString(io.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3); e.Graphics.DrawString(io.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
} }
} }
private void btnReadIO_Click(object sender, EventArgs e) private void btnReadIO_Click(object sender, EventArgs e)
{ {
ReadIOList(); ReadIOList();
} }
internal override void FormStatus(bool isStart) internal override void FormStatus(bool isStart)
{ {
btnStart.Enabled = !isStart; btnStart.Enabled = !isStart;
...@@ -277,7 +277,7 @@ namespace OnlineStore.AssemblyLine ...@@ -277,7 +277,7 @@ namespace OnlineStore.AssemblyLine
private void btnStart_Click(object sender, EventArgs e) private void btnStart_Click(object sender, EventArgs e)
{ {
StartDebug(); StartDebug();
} }
private void btnStop_Click(object sender, EventArgs e) private void btnStop_Click(object sender, EventArgs e)
{ {
StopRun(); StopRun();
...@@ -371,7 +371,14 @@ namespace OnlineStore.AssemblyLine ...@@ -371,7 +371,14 @@ namespace OnlineStore.AssemblyLine
} }
private void btnFeedSideWayCylinder_Click(object sender, EventArgs e) private void btnFeedSideWayCylinder_Click(object sender, EventArgs e)
{ {
BtnMove(btnFeedSideWayCylinder, "上料横移气缸取料端", "上料横移气缸放料端", IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); if (equipBean.MoveCylineCanTakeOrGive())
{
BtnMove(btnFeedSideWayCylinder, "上料横移气缸取料端", "上料横移气缸放料端", IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
MessageBox.Show("上料横移机构不在上升端", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
} }
private void btnTrayLocationCylinder_Click(object sender, EventArgs e) private void btnTrayLocationCylinder_Click(object sender, EventArgs e)
{ {
...@@ -401,7 +408,7 @@ namespace OnlineStore.AssemblyLine ...@@ -401,7 +408,7 @@ namespace OnlineStore.AssemblyLine
int size = 0; int size = 0;
try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { } try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { }
txtSizePosition.Text = equipBean.Config.GetUpdownPositionP2(size).ToString(); txtSizePosition.Text = equipBean.Config.GetUpdownPositionP2(size).ToString();
btnMoveto.Text = size + "寸移栽位置 :"; btnMoveto.Text = size + "寸移栽位置P2 :";
} }
private void btnMoveto_Click(object sender, EventArgs e) private void btnMoveto_Click(object sender, EventArgs e)
...@@ -409,7 +416,7 @@ namespace OnlineStore.AssemblyLine ...@@ -409,7 +416,7 @@ namespace OnlineStore.AssemblyLine
int position = FormUtil.GetIntValue(txtSizePosition); int position = FormUtil.GetIntValue(txtSizePosition);
int speed = equipBean.Config.UpdownAxis_P2Speed; int speed = equipBean.Config.UpdownAxis_P2Speed;
LogUtil.info("点击【移栽位置】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】"); LogUtil.info("点击【移栽位置P2】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed); equipBean.UpdownAxis.AbsMove(position, speed);
} }
...@@ -424,7 +431,7 @@ namespace OnlineStore.AssemblyLine ...@@ -424,7 +431,7 @@ namespace OnlineStore.AssemblyLine
private void btnCloseAll_Click(object sender, EventArgs e) private void btnCloseAll_Click(object sender, EventArgs e)
{ {
foreach (Control con in groupBox5.Controls) foreach (Control con in groupBox5.Controls)
{ {
if (con is Button) if (con is Button)
...@@ -440,25 +447,23 @@ namespace OnlineStore.AssemblyLine ...@@ -440,25 +447,23 @@ namespace OnlineStore.AssemblyLine
private void button3_Click(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e)
{ {
int position = FormUtil.GetIntValue(txtP1); int position = FormUtil.GetIntValue(txtP1);
int speed = equipBean.Config.UpdownAxis_P1Speed;
int speed = equipBean.Config.UpdownAxis_P2Speed; LogUtil.info("点击【移栽升降轴待机位置P1:】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
LogUtil.info("点击【P1点测试】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
} }
private void btnSave_Click(object sender, EventArgs e) private void btnSave_Click(object sender, EventArgs e)
{ {
int p1Position = FormUtil.GetIntValue(txtP1); int p1Position = FormUtil.GetIntValue(txtP1);
equipBean.Config.BatchAxisP1 = p1Position; equipBean.Config.UpDownAxisP1 = p1Position;
int p3Position = FormUtil.GetIntValue(txtUpdownP3);
equipBean.Config.UpDownAxisP3 = p3Position;
int size = 0; int size = 0;
try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { } try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { }
int sizePosition = FormUtil.GetIntValue(txtSizePosition); int sizePosition = FormUtil.GetIntValue(txtSizePosition);
equipBean.Config.UpdateUpdownPositon(size, sizePosition); equipBean.Config.UpdateUpdownP2(size, sizePosition);
//equipBean.Config.UpdateUpdownBoxPositon(size, sizeBoxP);
LineManager.SaveFeedingEquipConfig(equipBean.Config); LineManager.SaveFeedingEquipConfig(equipBean.Config);
MessageBox.Show("保存成功!"); MessageBox.Show("保存成功!");
} }
...@@ -525,15 +530,34 @@ namespace OnlineStore.AssemblyLine ...@@ -525,15 +530,34 @@ namespace OnlineStore.AssemblyLine
string msg = ""; string msg = "";
if (LastCodeList.Count > 0) if (LastCodeList.Count > 0)
{ {
foreach(string str in LastCodeList) foreach (string str in LastCodeList)
{ {
msg = str + "\r\n"; msg = str + "\r\n";
} }
} }
LogUtil.info(equipBean.Name+ "扫码测试结果:" + msg); LogUtil.info(equipBean.Name + "扫码测试结果:" + msg);
MessageBox.Show(equipBean.Name + "扫码测试结果:" + msg); MessageBox.Show(equipBean.Name + "扫码测试结果:" + msg);
} }
private void btnUpdownP3_Click(object sender, EventArgs e)
{
int position = FormUtil.GetIntValue(txtUpdownP3);
int speed = equipBean.Config.UpdownAxis_P3Speed;
LogUtil.info("点击【移栽升降轴取料位置P3:】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
}
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
equipBean.MoveStop = chbMoveStop.Checked;
LogUtil.info(equipBean.Name + "用户切换是否暂停: " + equipBean.MoveStop);
}
} }
} }
......
...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,2,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,2,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,, PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,, ,,,,,,,,,
,,,,,,,,, ,,,,,,,,,
DI,0,SL1急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_11,0,SL1急停,X101,X101 DI,0,SL1急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_11,0,SL1急停,X101,X101
......
...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,4,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,4,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,, PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,, ,,,,,,,,,
,,,,,,,,, ,,,,,,,,,
DI,0,SL2急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_13,0,SL2急停,X141,X141 DI,0,SL2急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_13,0,SL2急停,X141,X141
......
...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,6,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,6,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,, PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,, ,,,,,,,,,
,,,,,,,,, ,,,,,,,,,
DI,0,SL3急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_15,0,SL3急停,X181,X181 DI,0,SL3急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_15,0,SL3急停,X181,X181
......
...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,8,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,8,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,, PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,, ,,,,,,,,,
,,,,,,,,, ,,,,,,,,,
DI,0,SL4急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_17,0,SL4急停,X221,X221 DI,0,SL4急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_17,0,SL4急停,X221,X221
......
...@@ -59,11 +59,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -59,11 +59,17 @@ namespace OnlineStore.DeviceLibrary
StopMove(); StopMove();
} }
} }
public bool MoveStop = false;
/// <summary> /// <summary>
/// 运动处理 /// 运动处理
/// </summary> /// </summary>
protected override void BusyMoveProcess() protected override void BusyMoveProcess()
{ {
if (MoveStop)
{
return;
}
switch (MoveInfo.MoveType) switch (MoveInfo.MoveType)
{ {
case LineMoveType.InStore: case LineMoveType.InStore:
......
...@@ -94,17 +94,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -94,17 +94,17 @@ namespace OnlineStore.DeviceLibrary
ResetClearData(); ResetClearData();
lineStatus = LineStatus.ResetMove; lineStatus = LineStatus.ResetMove;
IOMove(IO_Type.SL_HddLed, IO_VALUE.HIGH); IOMove(IO_Type.SL_HddLed, IO_VALUE.HIGH);
MoveInfo.NextMoveStep(LineMoveStep.FR_01_BatchAxisHome); MoveInfo.NextMoveStep(LineMoveStep.FR_01_MoveCylinder_Up);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":提升伺服回原点,升降伺服回原点,所有阻挡气缸上升"); LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":上料横移机构上升,所有阻挡气缸上升");
BatchAxis.HomeMove(MoveInfo); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
UpdownAxis.HomeMove(MoveInfo);
if (Config.SidesWayNum <= 0) if (Config.SidesWayNum <= 0)
{ {
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW); IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW);
//顶升气缸下降 //顶升气缸下降
CylinderMove(MoveInfo, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down);
}else if (LineManager.Line.runStatus <= LineRunStatus.Wait) }
else if (LineManager.Line.runStatus <= LineRunStatus.Wait)
{ {
CylinderMove(MoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
...@@ -136,7 +136,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -136,7 +136,13 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.Wait: case LineMoveStep.Wait:
StartReset(); StartReset();
break; break;
case LineMoveStep.FR_01_BatchAxisHome: case LineMoveStep.FR_01_MoveCylinder_Up:
MoveInfo.NextMoveStep(LineMoveStep.FR_02_BatchAxisHome);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":提升伺服回原点,升降伺服回原点,所有阻挡气缸上升");
BatchAxis.HomeMove(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
break;
case LineMoveStep.FR_02_BatchAxisHome:
LogInfo(MoveInfo.MoveType + ":FR_03_BatchAxisToP2:提升伺服下降到P2点,升降伺服上升到待机点"); LogInfo(MoveInfo.MoveType + ":FR_03_BatchAxisToP2:提升伺服下降到P2点,升降伺服上升到待机点");
MoveInfo.NextMoveStep(LineMoveStep.FR_03_BatchAxisToP2); MoveInfo.NextMoveStep(LineMoveStep.FR_03_BatchAxisToP2);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed); BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
...@@ -159,9 +165,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -159,9 +165,14 @@ namespace OnlineStore.DeviceLibrary
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed); BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
break; break;
case LineMoveStep.FR_06_BatchAxisToP1: case LineMoveStep.FR_06_BatchAxisToP1:
LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL"); // LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up); // MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); // CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
// break;
//case LineMoveStep.FR_07_MoveCylinder_Up:
// LogInfo(MoveInfo.MoveType + ":FR_08_MoveCylinder_Slack:上料气缸放松SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_08_MoveCylinder_Slack);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
break; break;
case LineMoveStep.FR_07_MoveCylinder_Up: case LineMoveStep.FR_07_MoveCylinder_Up:
LogInfo(MoveInfo.MoveType + ":FR_08_MoveCylinder_Slack:上料气缸放松SOL"); LogInfo(MoveInfo.MoveType + ":FR_08_MoveCylinder_Slack:上料气缸放松SOL");
...@@ -169,9 +180,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -169,9 +180,18 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
break; break;
case LineMoveStep.FR_08_MoveCylinder_Slack: case LineMoveStep.FR_08_MoveCylinder_Slack:
LogInfo(MoveInfo.MoveType + ":FR_09_MoveCylinder_Take: 上料横移气缸取料端SOL"); if (MoveCylineCanTakeOrGive())
MoveInfo.NextMoveStep(LineMoveStep.FR_09_MoveCylinder_Take); {
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); LogInfo(MoveInfo.MoveType + ":FR_09_MoveCylinder_Take: 上料横移气缸取料端SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_09_MoveCylinder_Take);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
break; break;
case LineMoveStep.FR_09_MoveCylinder_Take: case LineMoveStep.FR_09_MoveCylinder_Take:
LogInfo(MoveInfo.MoveType + ":FR_10_OutTopCylinder_Down: 出口顶升下降SOL"); LogInfo(MoveInfo.MoveType + ":FR_10_OutTopCylinder_Down: 出口顶升下降SOL");
...@@ -331,6 +351,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -331,6 +351,18 @@ namespace OnlineStore.DeviceLibrary
} }
} }
/// <summary>
/// 判断上料横移机构是否可以横移运动
/// </summary>
/// <returns></returns>
public bool MoveCylineCanTakeOrGive()
{
if (IOValue(IO_Type.SL_MoveCylinder_Down).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SL_MoveCylinder_Up).Equals(IO_VALUE.HIGH))
{
return true;
}
return false;
}
#region 提升轴匀速上升处理 #region 提升轴匀速上升处理
private System.Timers.Timer axisCheckTimer = null; private System.Timers.Timer axisCheckTimer = null;
......
...@@ -215,21 +215,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -215,21 +215,21 @@ namespace OnlineStore.DeviceLibrary
#region 不需要出出料,直接放行 #region 不需要出出料,直接放行
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_MoveOk)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_MoveOk))
{ {
//更新托盘条码信息 ////更新托盘条码信息
string code = CodeManager.ProcessCode(LastCodeList); //string code = CodeManager.ProcessCode(LastCodeList);
TrayManager.UpdateTrayCode(currTrayNum, code); //TrayManager.UpdateTrayCode(currTrayNum, code);
if (code.Equals("")) //if (code.Equals(""))
{ //{
TrayManager.UpdateInStoreNG(currTrayNum, true); // TrayManager.UpdateInStoreNG(currTrayNum, true);
} //}
//从服务器获取库位号 ////从服务器获取库位号
string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth); //string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
if (!result.Equals("")) //if (!result.Equals(""))
{ //{
TrayManager.UpdateInStoreNG(currTrayNum, true); // TrayManager.UpdateInStoreNG(currTrayNum, true);
LogUtil.error(result); // LogUtil.error(result);
} //}
InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降"); InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
...@@ -300,9 +300,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -300,9 +300,18 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_201_UpDownToP1) && MoveInfo.MoveStep >= (LineMoveStep.FO_07_LocationCylinder_Up)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_201_UpDownToP1) && MoveInfo.MoveStep >= (LineMoveStep.FO_07_LocationCylinder_Up))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_202_MoveCylinder_Give); if ( MoveCylineCanTakeOrGive())
InStoreLog(" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端"); {
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_202_MoveCylinder_Give);
InStoreLog(" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_202_MoveCylinder_Give)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_202_MoveCylinder_Give))
{ {
...@@ -340,9 +349,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -340,9 +349,19 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_207_MoveCylinder_Up)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_207_MoveCylinder_Up))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_208_MoveCylinder_Take); if (MoveCylineCanTakeOrGive())
InStoreLog(" MO_208_MoveCylinder_Take 紧急出料移栽:上料横移机构到取料端"); {
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_208_MoveCylinder_Take);
InStoreLog(" MO_208_MoveCylinder_Take 紧急出料移栽:上料横移机构到取料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up);
InStoreLog(" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_208_MoveCylinder_Take)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_208_MoveCylinder_Take))
{ {
...@@ -451,6 +470,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -451,6 +470,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
#region 入料:料架进入并开始检测托盘
if (MoveInfo.MoveStep.Equals(LineMoveStep.Wait)) if (MoveInfo.MoveStep.Equals(LineMoveStep.Wait))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After); MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
...@@ -462,7 +482,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -462,7 +482,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_02_LocationCylinder_Down); MoveInfo.NextMoveStep(LineMoveStep.FI_02_LocationCylinder_Down);
InStoreLog(" FI_02_LocationCylinder_Down 开始:定位气缸下降,提升伺服移动到P1"); InStoreLog(" FI_02_LocationCylinder_Down 开始:定位气缸下降,提升伺服移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down); CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(Config.BatchAxisP1, Config.BatchAxis_P1Speed); BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_02_LocationCylinder_Down)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_02_LocationCylinder_Down))
{ {
...@@ -489,125 +509,155 @@ namespace OnlineStore.DeviceLibrary ...@@ -489,125 +509,155 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_09_TrayLocation_Before)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_09_TrayLocation_Before))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_10_AxisUpMove); MoveInfo.NextMoveStep(LineMoveStep.FI_10_AxisUpMove);
InStoreLog(" FI_10_AxisUpMove 开始:上料轴开始慢速上升到P3点,等待测到料盘"); InStoreLog(" FI_10_AxisUpMove 开始:上料轴开始慢速上升到P3点,等待测到料盘");
BatchAxisToP3(); BatchAxisToP3();
} }
#endregion
#region 检测到托盘,扫码,取料并放入托盘
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_10_AxisUpMove)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_10_AxisUpMove))
{ {
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH)) CheckHasTray();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_11_MoveCylinder_Up))
{
FI_12_MoveCylinder_Give();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_12_MoveCylinder_Give))
{
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW))
{ {
//有料盘 MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
MoveInfo.NextMoveStep(LineMoveStep.FI_11_MoveCylinder_Take); InStoreLog(" FI_13_ScanCode 料盘移栽:开始扫码");
InStoreLog(" FI_11_MoveCylinder_Take 料盘移栽:检测到料盘,上料横移气缸到取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); LastCodeList = new List<string>();
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return LastCodeList;
});
} }
else else
{ {
//无料盘 FI_12_MoveCylinder_Give();
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
InStoreLog(" FI_31_BatchAxisToP2 料盘移栽:未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
} }
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_11_MoveCylinder_Take)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_ScanCode))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_12_MoveCylinder_Down); MoveInfo.NextMoveStep(LineMoveStep.FI_14_MoveCylinder_Take);
InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:上料横移机构下降"); InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_12_MoveCylinder_Down)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_MoveCylinder_Take))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_13_MoveCylinder_Tighten); MoveInfo.NextMoveStep(LineMoveStep.FI_15_UpdownAxisToP3);
InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:升降轴到P3");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP3, Config.UpdownAxis_P3Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_15_UpdownAxisToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_16_MoveCylinder_Tighten);
InStoreLog(" FI_13_MoveCylinder_Tighten 料盘移栽:上料横移机构夹紧"); InStoreLog(" FI_13_MoveCylinder_Tighten 料盘移栽:上料横移机构夹紧");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_MoveCylinder_Tighten)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_16_MoveCylinder_Tighten))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_14_MoveCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.FI_17_UpdownAxisToP1);
InStoreLog(" FI_14_MoveCylinder_Up 料盘移栽:上料横移机构上升,同时伺服运动到P3"); InStoreLog(" FI_14_MoveCylinder_Up 料盘移栽:升降伺服到P1点,同时伺服运动到P3");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
BatchAxisToP3(); BatchAxisToP3();
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_MoveCylinder_Up)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_UpdownAxisToP1))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_15_SaveSize); MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
LastHeight = GetHeight(); LastHeight = GetHeight();
LastWidth = GetWidth(); LastWidth = GetWidth();
InStoreLog(" FI_15_SaveSize 料盘移栽:记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】"); InStoreLog(" FI_15_SaveSize 料盘移栽:记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_15_SaveSize)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_SaveSize))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_16_MoveCylinder_Emptying); if (MoveCylineCanTakeOrGive())
InStoreLog(" FI_16_MoveCylinder_Emptying 料盘移栽:上料横移气缸放料SOL"); {
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Take); MoveInfo.NextMoveStep(LineMoveStep.FI_19_MoveCylinder_Emptying);
InStoreLog(" FI_16_MoveCylinder_Emptying 料盘移栽:上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
InStoreLog(" FI_15_SaveSize 料盘移栽:上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_16_MoveCylinder_Emptying)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_MoveCylinder_Emptying))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_17_WaitTray); MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray);
InStoreLog(" FI_17_WaitTray 料盘移栽:等待空托盘到达,并顶升上升,定位上升"); InStoreLog(" FI_17_WaitTray 料盘移栽:等待空托盘到达,并顶升上升,定位上升");
//TODO 此处需要等待空托盘 //TODO 此处需要等待空托盘
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_WaitTray) && SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))//TODO else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray) && SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))//TODO
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_18_MoveCylinder_Down); MoveInfo.NextMoveStep(LineMoveStep.FI_21_MoveCylinder_Down);
InStoreLog(" FI_18_MoveCylinder_Down 料盘移栽:上料机构下降"); InStoreLog(" FI_18_MoveCylinder_Down 料盘移栽:上料机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_MoveCylinder_Down)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_MoveCylinder_Down))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_19_UpdownAxisToP2); MoveInfo.NextMoveStep(LineMoveStep.FI_22_UpdownAxisToP2);
int targetPositon = Config.GetUpdownPositionP2(LastHeight); int targetPositon = Config.GetUpdownPositionP2(LastHeight);
InStoreLog(" FI_19_UpdownAxisToP2 料盘移栽:移栽伺服下降到指定位置:" + targetPositon); InStoreLog(" FI_19_UpdownAxisToP2 料盘移栽:移栽伺服下降到指定位置:" + targetPositon);
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed); UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_UpdownAxisToP2)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_UpdownAxisToP2))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_20_MoveCylinder_Slack); MoveInfo.NextMoveStep(LineMoveStep.FI_23_MoveCylinder_Slack);
InStoreLog(" FI_20_MoveCylinder_Slack 料盘移栽:上料气缸放松"); InStoreLog(" FI_20_MoveCylinder_Slack 料盘移栽:上料气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_MoveCylinder_Slack)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_MoveCylinder_Slack))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_21_UpDownAxisToP1); MoveInfo.NextMoveStep(LineMoveStep.FI_24_UpDownAxisToP1);
InStoreLog(" FI_21_UpDownAxisToP1 料盘移栽:升降伺服到P1点"); InStoreLog(" FI_21_UpDownAxisToP1 料盘移栽:升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_UpDownAxisToP1)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_UpDownAxisToP1))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_22_MoveCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.FI_25_MoveCylinder_Up);
InStoreLog(" FI_22_MoveCylinder_Up 料盘移栽:上料横移机构上升,记录托盘尺寸, 开始放行,"); InStoreLog(" FI_22_MoveCylinder_Up 料盘移栽:上料横移机构上升,记录托盘尺寸, 开始放行,");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
TrayManager.UpdateTrayInfo(currTrayNum, true, 1, "", "", LastHeight, LastWidth); TrayManager.UpdateTrayInfo(currTrayNum, true, 1, "", "", LastHeight, LastWidth);
LastCodeList = new List<string>(); //更新托盘条码信息
InStoreLog(" SecondStoreMove=MO_12_MoveOk 开始扫码"); string code = CodeManager.ProcessCode(LastCodeList);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode()); TrayManager.UpdateTrayCode(currTrayNum, code);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); if (code.Equals(""))
Task<List<string>> scanTask = Task.Factory.StartNew(delegate {
{ TrayManager.UpdateInStoreNG(currTrayNum, true);
LastCodeList = CodeManager.CameraScan(Config.GetCameraList()); }
if (LastCodeList.Count <= 0) //从服务器获取库位号
{ string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
LastCodeList = CodeManager.CameraScan(Config.GetCameraList()); if (!result.Equals(""))
} {
return LastCodeList; TrayManager.UpdateInStoreNG(currTrayNum, true);
}); LogUtil.error(result);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_MoveCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_MoveCylinder_Take);
InStoreLog(" FI_23_MoveCylinder_Take 料盘移栽:上料横移机构到取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_MoveCylinder_Take)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_MoveCylinder_Up))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2); CheckHasTray();
InStoreLog(" FI_31_BatchAxisToP2 上料完成:未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
} }
#endregion
#region 未检测到托盘或放料完成
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_31_BatchAxisToP2)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_31_BatchAxisToP2))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_32_TrayLocationCylinder_After); MoveInfo.NextMoveStep(LineMoveStep.FI_32_TrayLocationCylinder_After);
...@@ -680,8 +730,40 @@ namespace OnlineStore.DeviceLibrary ...@@ -680,8 +730,40 @@ namespace OnlineStore.DeviceLibrary
// MoveInfo.EndMove(); // MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing; // runStatus = LineRunStatus.Runing;
// LogUtil.info("空料架已送出,入料结束"); // LogUtil.info("空料架已送出,入料结束");
//} //}
#endregion
}
private void FI_12_MoveCylinder_Give()
{
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_12_MoveCylinder_Give);
InStoreLog(" FI_12_MoveCylinder_Up 料盘移栽:横移机构到放料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
//有料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_11_MoveCylinder_Up);
InStoreLog(" FI_11_MoveCylinder_Up 料盘移栽:检测到料盘,横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
} }
private void CheckHasTray()
{
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
FI_12_MoveCylinder_Give();
}
else
{
//无料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
InStoreLog(" FI_31_BatchAxisToP2 料盘移栽:未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
}
private void BatchAxisToP3() private void BatchAxisToP3()
{ {
MoveInfo.CanWhileCount = 0; MoveInfo.CanWhileCount = 0;
...@@ -689,7 +771,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -689,7 +771,7 @@ namespace OnlineStore.DeviceLibrary
StartMovePosition = BatchAxis.GetAclPosition(); StartMovePosition = BatchAxis.GetAclPosition();
MoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxis(Config.Batch_Axis, Config.BatchAxisP3, Config.BatchAxis_P3Speed)); MoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxis(Config.Batch_Axis, Config.BatchAxisP3, Config.BatchAxis_P3Speed));
Config.Batch_Axis.TargetPosition = Config.BatchAxisP3; Config.Batch_Axis.TargetPosition = Config.BatchAxisP3;
BatchAxis.AbsMove(Config.BatchAxisP3, Config.BatchAxis_P3Speed); BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP3, Config.BatchAxis_P3Speed);
//开始检测信号 //开始检测信号
BatchAxisStartCheck(); BatchAxisStartCheck();
} }
...@@ -783,7 +865,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -783,7 +865,7 @@ namespace OnlineStore.DeviceLibrary
if (!isFull && runStatus.Equals(LineRunStatus.Runing) && MoveInfo.MoveType.Equals(LineMoveType.InStore)) if (!isFull && runStatus.Equals(LineRunStatus.Runing) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{ {
//入料执行中, 且需要空托盘 //入料执行中, 且需要空托盘
if (MoveInfo.MoveStep >= LineMoveStep.FI_11_MoveCylinder_Take && MoveInfo.MoveStep <= LineMoveStep.FI_17_WaitTray) if (MoveInfo.MoveStep >= LineMoveStep.FI_11_MoveCylinder_Up && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
{ {
if (checkAndMove) if (checkAndMove)
{ {
...@@ -873,7 +955,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -873,7 +955,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FO_02_LocationCylinder_Down); MoveInfo.NextMoveStep(LineMoveStep.FO_02_LocationCylinder_Down);
InStoreLog(" FO_02_LocationCylinder_Down 开始:定位气缸下降,提升轴移动到P1"); InStoreLog(" FO_02_LocationCylinder_Down 开始:定位气缸下降,提升轴移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down); CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(Config.BatchAxisP1, Config.BatchAxis_P1Speed); BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_02_LocationCylinder_Down)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_02_LocationCylinder_Down))
{ {
......
...@@ -27,9 +27,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -27,9 +27,10 @@ namespace OnlineStore.DeviceLibrary
public static void CheckEnum(Type type) public static void CheckEnum(Type type)
{ {
if (type.IsEnum) if (type.IsEnum)
{ {
List<int> valueList = new List<int>(); List<int> valueList = new List<int>();
foreach (int item in Enum.GetValues(type)) Array array = Enum.GetValues(type);
foreach (int item in array)
{ {
if (valueList.Contains(item)) if (valueList.Contains(item))
{ {
......
...@@ -15,8 +15,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,8 +15,8 @@ namespace OnlineStore.DeviceLibrary
public partial class ACServerManager public partial class ACServerManager
{ {
public static bool IsShowMsg = false ; public static bool IsShowMsg = false ;
private static int SleepMSendons = 50; private static int SleepMSendons = 20;
private static int ReviceOutTimeMS = 200; private static int ReviceOutTimeMS = 100;
private static Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>(); private static Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
private static string mapObj = ""; private static string mapObj = "";
......
...@@ -98,10 +98,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -98,10 +98,10 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
int timeOut = ReviceOutTimeMS; int timeOut = ReviceOutTimeMS;
if (data[1].Equals((byte)10)) //if (data[1].Equals((byte)10))
{ //{
timeOut = 1000; // timeOut = 1000;
} //}
bool result = false; bool result = false;
byte[] returnData = SendCommand(portName, data, timeOut, 8, out result); byte[] returnData = SendCommand(portName, data, timeOut, 8, out result);
if (returnData != null) if (returnData != null)
......
...@@ -86,24 +86,34 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,24 +86,34 @@ namespace OnlineStore.DeviceLibrary
// rfidReader.LocalIP = "192.168.100.101"; // rfidReader.LocalIP = "192.168.100.101";
rfidReader.RemoteIP = rfid; rfidReader.RemoteIP = rfid;
string[] array = rfid.Split('.'); //string[] array = rfid.Split('.');
int index = Convert.ToInt32(array[3]); //int index = Convert.ToInt32(array[3]);
bool result = rfidReader.Connect(index); bool result = rfidReader.Connect();
if (result) if (result)
{ {
rfidReader.AutoScan(true); rfidReader.AutoScan(true);
LogUtil.info("连接 " + logName + " [" + index + "]成功"); LogUtil.info("连接 " + logName + "成功");
RFReaderMap.Add(rfid, rfidReader); RFReaderMap.Add(rfid, rfidReader);
if (RfIPList.Contains(rfid)) if (RfIPList.Contains(rfid))
{ {
RfIPList.Remove(rfid); RfIPList.Remove(rfid);
} }
return true; return true;
} }
else else
{ {
LogUtil.error("连接 " + logName + " [" + index + "] 失败" + ""); LogUtil.error("连接 " + logName + "失败" + "");
} }
Thread.Sleep(5); Thread.Sleep(5);
} }
......
...@@ -470,11 +470,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -470,11 +470,14 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 入料装置原点返回,10000开始 #region 入料装置原点返回,10000开始
/// <summary>
/// 横移装置上升
/// </summary>
FR_01_MoveCylinder_Up=10001,
/// <summary> /// <summary>
/// 提升伺服回原点,升降伺服回原点 /// 提升伺服回原点,升降伺服回原点
/// </summary> /// </summary>
FR_01_BatchAxisHome = 10001, FR_02_BatchAxisHome = 10002,
/// <summary> /// <summary>
/// 然后提升伺服下降到P2点,升降伺服上升到待机点 /// 然后提升伺服下降到P2点,升降伺服上升到待机点
...@@ -588,63 +591,77 @@ namespace OnlineStore.DeviceLibrary ...@@ -588,63 +591,77 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
FI_10_AxisUpMove = 11010, FI_10_AxisUpMove = 11010,
/// <summary>
/// 入料取料:横移机构先上升
/// </summary>
FI_11_MoveCylinder_Up=11011,
/// <summary>
/// 入料取料:上料机构到放料端
/// </summary>
FI_12_MoveCylinder_Give = 11012,
/// <summary>
/// 入料检测到料盘:扫码
/// </summary>
FI_13_ScanCode =11013,
/// <summary> /// <summary>
/// 料盘移栽:有料盘:上料横移机构取料 /// 料盘移栽:有料盘:上料横移机构取料
/// </summary> /// </summary>
FI_11_MoveCylinder_Take = 11011, FI_14_MoveCylinder_Take = 11014,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构下降 /// 料盘移栽:升降轴到P3
/// </summary> /// </summary>
FI_12_MoveCylinder_Down = 11012, FI_15_UpdownAxisToP3= 11015,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构夹紧 /// 料盘移栽:上料横移机构夹紧
/// </summary> /// </summary>
FI_13_MoveCylinder_Tighten = 11013, FI_16_MoveCylinder_Tighten = 11016,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构上升,同时伺服运动到P3 /// 料盘移栽:上料横移机构上升,同时伺服运动到P3
/// </summary> /// </summary>
FI_14_MoveCylinder_Up = 11014, FI_17_UpdownAxisToP1 ,
/// <summary> /// <summary>
/// 料盘移栽:记录高度尺寸 /// 料盘移栽:记录高度尺寸
/// </summary> /// </summary>
FI_15_SaveSize = 11015, FI_18_SaveSize ,
/// <summary> /// <summary>
/// 料盘移栽: 上料横移气缸放料SOL /// 料盘移栽: 上料横移气缸放料SOL
/// </summary> /// </summary>
FI_16_MoveCylinder_Emptying = 11016, FI_19_MoveCylinder_Emptying ,
/// <summary> /// <summary>
/// 料盘移栽:等待空托盘到达,并顶升上升,定位上升 /// 料盘移栽:等待空托盘到达,并顶升上升,定位上升
/// </summary> /// </summary>
FI_17_WaitTray = 11017, FI_20_WaitTray ,
/// <summary> /// <summary>
/// 料盘移栽: 上料机构下降 /// 料盘移栽: 上料机构下降
/// </summary> /// </summary>
FI_18_MoveCylinder_Down = 11018, FI_21_MoveCylinder_Down ,
/// <summary> /// <summary>
/// 料盘移栽: 移栽伺服下降到指定位置 /// 料盘移栽: 移栽伺服下降到指定位置
/// </summary> /// </summary>
FI_19_UpdownAxisToP2 = 11019, FI_22_UpdownAxisToP2 ,
/// <summary> /// <summary>
/// 料盘移栽: 上料气缸放松 /// 料盘移栽: 上料气缸放松
/// </summary> /// </summary>
FI_20_MoveCylinder_Slack = 11020, FI_23_MoveCylinder_Slack ,
/// <summary> /// <summary>
/// 料盘移栽:升降伺服到P1点 /// 料盘移栽:升降伺服到P1点
/// </summary> /// </summary>
FI_21_UpDownAxisToP1 = 11021, FI_24_UpDownAxisToP1 ,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构上升 /// 料盘移栽:上料横移机构上升
/// </summary> /// </summary>
FI_22_MoveCylinder_Up = 11022, FI_25_MoveCylinder_Up ,
/// <summary> ///// <summary>
/// 料盘移栽:上料横移机构到取料端 ///// 料盘移栽:上料横移机构到取料端
/// </summary> ///// </summary>
FI_23_MoveCylinder_Take = 11023, //FI_23_MoveCylinder_Take = 11023,
......
...@@ -135,11 +135,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -135,11 +135,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("Height_ChangeValue", true)] [ConfigProAttribute("Height_ChangeValue", true)]
public int Height_ChangeValue { get; set; } public int Height_ChangeValue { get; set; }
/// <summary>
/// PRO 0 提升上料轴在移栽上下降的位置 UpDownP2ListP2 0=180000
/// </summary>
[ConfigProAttribute("UpDownP2ListP2", true)]
public string UpDownP2ListP2 { get; set; }
/// <summary> /// <summary>
...@@ -153,6 +149,18 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -153,6 +149,18 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("UpDownAxisP1", true)] [ConfigProAttribute("UpDownAxisP1", true)]
public int UpDownAxisP1 { get; set; } public int UpDownAxisP1 { get; set; }
/// <summary> /// <summary>
/// PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
/// </summary>
[ConfigProAttribute("UpDownP2List", true)]
public string UpDownP2List { get; set; }
/// <summary>
/// PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
/// </summary>
[ConfigProAttribute("UpDownAxisP3", true)]
public int UpDownAxisP3 { get; set; }
/// <summary>
/// PRO 0 移栽上下轴目标速度 UpdownAxis_TargetSpeed 150 /// PRO 0 移栽上下轴目标速度 UpdownAxis_TargetSpeed 150
/// </summary> /// </summary>
[ConfigProAttribute("UpdownAxis_TargetSpeed", true)] [ConfigProAttribute("UpdownAxis_TargetSpeed", true)]
...@@ -196,6 +204,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -196,6 +204,11 @@ namespace OnlineStore.LoadCSVLibrary
public int UpdownAxis_P2Speed { get; set; } public int UpdownAxis_P2Speed { get; set; }
/// <summary> /// <summary>
/// PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
/// </summary>
[ConfigProAttribute("UpdownAxis_P3Speed", true)]
public int UpdownAxis_P3Speed { get; set; }
/// <summary>
/// PRO,0,是否是用来出料,IsCanOut,1,,,,, /// PRO,0,是否是用来出料,IsCanOut,1,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("IsCanOut", false)] [ConfigProAttribute("IsCanOut", false)]
...@@ -230,7 +243,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -230,7 +243,7 @@ namespace OnlineStore.LoadCSVLibrary
if (UpDownPositionP2Map == null) if (UpDownPositionP2Map == null)
{ {
UpDownPositionP2Map = new Dictionary<int, int>(); UpDownPositionP2Map = new Dictionary<int, int>();
string[] arrayList = UpDownP2ListP2.Split(';'); string[] arrayList = UpDownP2List.Split(';');
foreach (string str in arrayList) foreach (string str in arrayList)
{ {
string[] arrStr = str.Split('='); string[] arrStr = str.Split('=');
...@@ -257,7 +270,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -257,7 +270,7 @@ namespace OnlineStore.LoadCSVLibrary
return -1; return -1;
} }
public void UpdateUpdownPositon(int size, int sizePosition) public void UpdateUpdownP2(int size, int sizePosition)
{ {
string newPositionStr = ""; string newPositionStr = "";
if (UpDownPositionP2Map.ContainsKey(size)) if (UpDownPositionP2Map.ContainsKey(size))
...@@ -274,7 +287,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -274,7 +287,7 @@ namespace OnlineStore.LoadCSVLibrary
newPositionStr += key + "=" + UpDownPositionP2Map[key] + ";"; newPositionStr += key + "=" + UpDownPositionP2Map[key] + ";";
} }
newPositionStr = newPositionStr.Substring(0, newPositionStr.Length - 1); newPositionStr = newPositionStr.Substring(0, newPositionStr.Length - 1);
UpDownP2ListP2 = newPositionStr; UpDownP2List = newPositionStr;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!