Commit 32e27e46 LN

入料机构增加吸盘代码,使用吸盘或夹爪可配置。

1 个父辈 501af144
...@@ -127,7 +127,7 @@ DO,1,A料口电机启动,LineStart_A,41,HC,Y41,,,,,,,,,,,, ...@@ -127,7 +127,7 @@ DO,1,A料口电机启动,LineStart_A,41,HC,Y41,,,,,,,,,,,,
DO,1,A料口电机反转指令,LineBack_A,42,HC,Y42,,,,,,,,,,,, DO,1,A料口电机反转指令,LineBack_A,42,HC,Y42,,,,,,,,,,,,
DO,1,B料口电机启动,LineStart_B,43,HC,Y43,,,,,,,,,,,, DO,1,B料口电机启动,LineStart_B,43,HC,Y43,,,,,,,,,,,,
DO,1,B料口电机反转指令,LineBack_B,44,HC,Y44,,,,,,,,,,,, DO,1,B料口电机反转指令,LineBack_B,44,HC,Y44,,,,,,,,,,,,
,,,,45,HC,Y45,,,,,,,,,,,, DO,1,吸盘工作信号,ClampWork,45,HC,Y45,,,,,,,,,,,,
,,,,46,HC,Y46,,,,,,,,,,,, ,,,,46,HC,Y46,,,,,,,,,,,,
,,,,47,HC,Y47,,,,,,,,,,,, ,,,,47,HC,Y47,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,
......
...@@ -325,6 +325,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -325,6 +325,11 @@ namespace OnlineStore.DeviceLibrary
{ {
ClampJaw.GoHome(MoveInfo); ClampJaw.GoHome(MoveInfo);
} }
else
{
//吸盘放松
IOManager.IOMove(IO_Type.ClampWork, IO_VALUE.LOW);
}
} }
private void IR04_MiddleToP1() private void IR04_MiddleToP1()
...@@ -533,7 +538,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -533,7 +538,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private void ClampWork(DeviceMoveInfo moveInfo, bool isCheck, params string[] codes) public void ClampWork(DeviceMoveInfo moveInfo, bool isCheck, params string[] codes)
{ {
if (Config.UseClampJaw.Equals(1)) if (Config.UseClampJaw.Equals(1))
{ {
...@@ -541,11 +546,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -541,11 +546,17 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
//吸盘工作
IOManager.IOMove(IO_Type.ClampWork, IO_VALUE.HIGH);
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampWork, IO_VALUE.HIGH));
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
} }
} }
private void ClampRelax(DeviceMoveInfo moveInfo, params string[] codes) public void ClampRelax(DeviceMoveInfo moveInfo, params string[] codes)
{ {
if (Config.UseClampJaw.Equals(1)) if (Config.UseClampJaw.Equals(1))
{ {
...@@ -553,7 +564,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -553,7 +564,13 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
//吸盘放松
IOManager.IOMove(IO_Type.ClampWork, IO_VALUE.LOW);
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampWork, IO_VALUE.LOW));
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
} }
} }
......
...@@ -317,6 +317,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -317,6 +317,11 @@ namespace OnlineStore.LoadCSVLibrary
/// DO,1,B料口电机反转指令,LineBack_B,44,HC,Y44,,,,,,,,,,,, /// DO,1,B料口电机反转指令,LineBack_B,44,HC,Y44,,,,,,,,,,,,
/// </summary> /// </summary>
public static string LineBack_B = "LineBack_B"; public static string LineBack_B = "LineBack_B";
/// <summary>
/// DO,1,吸盘工作信号,ClampWork,45,HC,Y45,,,,,,,,,,,,
/// </summary>
public static string ClampWork = "ClampWork";
} }
public enum IO_VALUE public enum IO_VALUE
{ {
......
...@@ -56,6 +56,8 @@ namespace OnlineStore.XLRStore ...@@ -56,6 +56,8 @@ namespace OnlineStore.XLRStore
this.axisMoveControl1 = new OnlineStore.XLRStore.useControl.AxisMoveRectControl(); this.axisMoveControl1 = new OnlineStore.XLRStore.useControl.AxisMoveRectControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupDO = new System.Windows.Forms.GroupBox(); this.groupDO = new System.Windows.Forms.GroupBox();
this.btnClampRelax = new System.Windows.Forms.Button();
this.btnClampWork = new System.Windows.Forms.Button();
this.LineStop_B = new System.Windows.Forms.Button(); this.LineStop_B = new System.Windows.Forms.Button();
this.LineBack_B = new System.Windows.Forms.Button(); this.LineBack_B = new System.Windows.Forms.Button();
this.LineStart_B = new System.Windows.Forms.Button(); this.LineStart_B = new System.Windows.Forms.Button();
...@@ -92,8 +94,8 @@ namespace OnlineStore.XLRStore ...@@ -92,8 +94,8 @@ namespace OnlineStore.XLRStore
this.btnStart = new System.Windows.Forms.Button(); this.btnStart = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button(); this.btnStop = new System.Windows.Forms.Button();
this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox6 = new System.Windows.Forms.GroupBox();
this.groupBox12 = new System.Windows.Forms.GroupBox();
this.checkBox1 = new System.Windows.Forms.CheckBox(); this.checkBox1 = new System.Windows.Forms.CheckBox();
this.groupBox12 = new System.Windows.Forms.GroupBox();
this.cmbOutstorePos = new System.Windows.Forms.ComboBox(); this.cmbOutstorePos = new System.Windows.Forms.ComboBox();
this.cmbInstorePos = new System.Windows.Forms.ComboBox(); this.cmbInstorePos = new System.Windows.Forms.ComboBox();
this.btnOutStoreTest = new System.Windows.Forms.Button(); this.btnOutStoreTest = new System.Windows.Forms.Button();
...@@ -561,6 +563,8 @@ namespace OnlineStore.XLRStore ...@@ -561,6 +563,8 @@ namespace OnlineStore.XLRStore
// //
// groupDO // groupDO
// //
this.groupDO.Controls.Add(this.btnClampRelax);
this.groupDO.Controls.Add(this.btnClampWork);
this.groupDO.Controls.Add(this.LineStop_B); this.groupDO.Controls.Add(this.LineStop_B);
this.groupDO.Controls.Add(this.LineBack_B); this.groupDO.Controls.Add(this.LineBack_B);
this.groupDO.Controls.Add(this.LineStart_B); this.groupDO.Controls.Add(this.LineStart_B);
...@@ -574,11 +578,37 @@ namespace OnlineStore.XLRStore ...@@ -574,11 +578,37 @@ namespace OnlineStore.XLRStore
this.groupDO.Controls.Add(this.btnCloseAll); this.groupDO.Controls.Add(this.btnCloseAll);
this.groupDO.Location = new System.Drawing.Point(480, 119); this.groupDO.Location = new System.Drawing.Point(480, 119);
this.groupDO.Name = "groupDO"; this.groupDO.Name = "groupDO";
this.groupDO.Size = new System.Drawing.Size(466, 195); this.groupDO.Size = new System.Drawing.Size(466, 230);
this.groupDO.TabIndex = 255; this.groupDO.TabIndex = 255;
this.groupDO.TabStop = false; this.groupDO.TabStop = false;
this.groupDO.Text = "IO操作测试"; this.groupDO.Text = "IO操作测试";
// //
// btnClampRelax
//
this.btnClampRelax.BackColor = System.Drawing.Color.White;
this.btnClampRelax.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClampRelax.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClampRelax.Location = new System.Drawing.Point(162, 185);
this.btnClampRelax.Name = "btnClampRelax";
this.btnClampRelax.Size = new System.Drawing.Size(135, 34);
this.btnClampRelax.TabIndex = 288;
this.btnClampRelax.Text = "吸盘放料";
this.btnClampRelax.UseVisualStyleBackColor = false;
this.btnClampRelax.Click += new System.EventHandler(this.btnClampRelax_Click);
//
// btnClampWork
//
this.btnClampWork.BackColor = System.Drawing.Color.White;
this.btnClampWork.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClampWork.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClampWork.Location = new System.Drawing.Point(162, 145);
this.btnClampWork.Name = "btnClampWork";
this.btnClampWork.Size = new System.Drawing.Size(135, 34);
this.btnClampWork.TabIndex = 287;
this.btnClampWork.Text = "吸盘抓料";
this.btnClampWork.UseVisualStyleBackColor = false;
this.btnClampWork.Click += new System.EventHandler(this.btnClampWork_Click);
//
// LineStop_B // LineStop_B
// //
this.LineStop_B.BackColor = System.Drawing.Color.White; this.LineStop_B.BackColor = System.Drawing.Color.White;
...@@ -724,9 +754,9 @@ namespace OnlineStore.XLRStore ...@@ -724,9 +754,9 @@ namespace OnlineStore.XLRStore
// //
// clampJawControl1 // clampJawControl1
// //
this.clampJawControl1.Location = new System.Drawing.Point(480, 320); this.clampJawControl1.Location = new System.Drawing.Point(478, 352);
this.clampJawControl1.Name = "clampJawControl1"; this.clampJawControl1.Name = "clampJawControl1";
this.clampJawControl1.Size = new System.Drawing.Size(466, 216); this.clampJawControl1.Size = new System.Drawing.Size(469, 192);
this.clampJawControl1.TabIndex = 280; this.clampJawControl1.TabIndex = 280;
// //
// groupBox1 // groupBox1
...@@ -1049,6 +1079,18 @@ namespace OnlineStore.XLRStore ...@@ -1049,6 +1079,18 @@ namespace OnlineStore.XLRStore
this.groupBox6.TabStop = false; this.groupBox6.TabStop = false;
this.groupBox6.Text = "消息"; this.groupBox6.Text = "消息";
// //
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.checkBox1.Location = new System.Drawing.Point(10, 328);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(154, 24);
this.checkBox1.TabIndex = 291;
this.checkBox1.Text = "检测到料串自动入库";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// groupBox12 // groupBox12
// //
this.groupBox12.Controls.Add(this.cmbOutstorePos); this.groupBox12.Controls.Add(this.cmbOutstorePos);
...@@ -1068,18 +1110,6 @@ namespace OnlineStore.XLRStore ...@@ -1068,18 +1110,6 @@ namespace OnlineStore.XLRStore
this.groupBox12.TabStop = false; this.groupBox12.TabStop = false;
this.groupBox12.Text = "取料机构测试"; this.groupBox12.Text = "取料机构测试";
// //
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.checkBox1.Location = new System.Drawing.Point(10, 328);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(154, 24);
this.checkBox1.TabIndex = 291;
this.checkBox1.Text = "检测到料串自动入库";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// cmbOutstorePos // cmbOutstorePos
// //
this.cmbOutstorePos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbOutstorePos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
...@@ -1386,6 +1416,8 @@ namespace OnlineStore.XLRStore ...@@ -1386,6 +1416,8 @@ namespace OnlineStore.XLRStore
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox cmbOutShelf; private System.Windows.Forms.ComboBox cmbOutShelf;
protected System.Windows.Forms.CheckBox checkBox1; protected System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Button btnClampRelax;
private System.Windows.Forms.Button btnClampWork;
} }
} }
...@@ -319,9 +319,14 @@ namespace OnlineStore.XLRStore ...@@ -319,9 +319,14 @@ namespace OnlineStore.XLRStore
if (inputEquip.ClampJaw == null) if (inputEquip.ClampJaw == null)
{ {
clampJawControl1.Visible = false; clampJawControl1.Visible = false;
btnClampRelax.Visible = true;
btnClampWork.Visible = true;
} }
else else
{ {
clampJawControl1.Visible = true;
btnClampRelax.Visible = false;
btnClampWork.Visible = false;
clampJawControl1.clampJaw = inputEquip.ClampJaw; clampJawControl1.clampJaw = inputEquip.ClampJaw;
clampJawControl1.ShowData(); clampJawControl1.ShowData();
} }
...@@ -750,6 +755,16 @@ namespace OnlineStore.XLRStore ...@@ -750,6 +755,16 @@ namespace OnlineStore.XLRStore
} }
} }
} }
private void btnClampWork_Click(object sender, EventArgs e)
{
inputEquip.ClampWork(null, false);
}
private void btnClampRelax_Click(object sender, EventArgs e)
{
inputEquip.ClampRelax(null);
}
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!