Commit 599f085c LN

夹爪使用修改:

1.设备复位时夹爪需要回原点,然后到放松状态。
2.夹爪放松改为绝对位置运动方式,默认位置为1
3.夹爪调试界面增加位置和出力显示。
1 个父辈 842f751e
......@@ -749,7 +749,7 @@
//
this.clampJawControl1.Location = new System.Drawing.Point(462, 422);
this.clampJawControl1.Name = "clampJawControl1";
this.clampJawControl1.Size = new System.Drawing.Size(239, 167);
this.clampJawControl1.Size = new System.Drawing.Size(507, 167);
this.clampJawControl1.TabIndex = 280;
//
// tabPage2
......
......@@ -104,6 +104,7 @@ namespace OnlineStore.AssemblyLine
{
return;
}
clampJawControl1.UpdateSta();
ReadIOList();
ReadBtnDO();
BatchTimerPro();
......
......@@ -86,7 +86,7 @@ namespace OnlineStore.AssemblyLine
foreach (ConfigIO ioValue in equipBean.Config.DIList.Values)
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName,220);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
DIControlList.Add(ioValue.ProName, control);
......@@ -98,7 +98,7 @@ namespace OnlineStore.AssemblyLine
foreach (ConfigIO ioValue in equipBean.Config.DOList.Values)
{
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName,220);
control.Click += Control_Click;
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
roleindex++;
......@@ -134,7 +134,7 @@ namespace OnlineStore.AssemblyLine
ReadIOList();
ReadBtnDO();
clampJawControl1.UpdateSta();
lblName.BackColor = equipBean.GetShowColor();
if (equipBean.runStatus > LineRunStatus.Wait)
{
......
......@@ -31,10 +31,13 @@ namespace OnlineStore.AssemblyLine.useControl
{
this.groupClamp = new System.Windows.Forms.GroupBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.chbEmpty = new System.Windows.Forms.CheckBox();
this.chbPosition = new System.Windows.Forms.CheckBox();
this.btnClampWork = new System.Windows.Forms.Button();
this.btnClampRelax = new System.Windows.Forms.Button();
this.lblForce = new System.Windows.Forms.Label();
this.lblPosition = new System.Windows.Forms.Label();
this.lblMoveOk = new System.Windows.Forms.Label();
this.btnHome = new System.Windows.Forms.Button();
this.lblEmpty = new System.Windows.Forms.Label();
this.groupClamp.SuspendLayout();
this.SuspendLayout();
//
......@@ -43,15 +46,18 @@ namespace OnlineStore.AssemblyLine.useControl
this.groupClamp.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.groupClamp.Controls.Add(this.lblEmpty);
this.groupClamp.Controls.Add(this.btnHome);
this.groupClamp.Controls.Add(this.lblMoveOk);
this.groupClamp.Controls.Add(this.lblPosition);
this.groupClamp.Controls.Add(this.lblForce);
this.groupClamp.Controls.Add(this.linkLabel1);
this.groupClamp.Controls.Add(this.chbEmpty);
this.groupClamp.Controls.Add(this.chbPosition);
this.groupClamp.Controls.Add(this.btnClampWork);
this.groupClamp.Controls.Add(this.btnClampRelax);
this.groupClamp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupClamp.Location = new System.Drawing.Point(7, 4);
this.groupClamp.Name = "groupClamp";
this.groupClamp.Size = new System.Drawing.Size(218, 158);
this.groupClamp.Size = new System.Drawing.Size(266, 146);
this.groupClamp.TabIndex = 283;
this.groupClamp.TabStop = false;
this.groupClamp.Text = "夹爪操作";
......@@ -60,7 +66,7 @@ namespace OnlineStore.AssemblyLine.useControl
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linkLabel1.Location = new System.Drawing.Point(167, 121);
this.linkLabel1.Location = new System.Drawing.Point(159, 115);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(37, 20);
this.linkLabel1.TabIndex = 285;
......@@ -68,36 +74,14 @@ namespace OnlineStore.AssemblyLine.useControl
this.linkLabel1.Text = "查询";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// chbEmpty
//
this.chbEmpty.AutoSize = true;
this.chbEmpty.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbEmpty.Location = new System.Drawing.Point(102, 120);
this.chbEmpty.Name = "chbEmpty";
this.chbEmpty.Size = new System.Drawing.Size(56, 24);
this.chbEmpty.TabIndex = 284;
this.chbEmpty.Text = "空抓";
this.chbEmpty.UseVisualStyleBackColor = true;
//
// chbPosition
//
this.chbPosition.AutoSize = true;
this.chbPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbPosition.Location = new System.Drawing.Point(9, 120);
this.chbPosition.Name = "chbPosition";
this.chbPosition.Size = new System.Drawing.Size(84, 24);
this.chbPosition.TabIndex = 283;
this.chbPosition.Text = "运动到位";
this.chbPosition.UseVisualStyleBackColor = true;
//
// 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(29, 69);
this.btnClampWork.Location = new System.Drawing.Point(18, 104);
this.btnClampWork.Name = "btnClampWork";
this.btnClampWork.Size = new System.Drawing.Size(140, 34);
this.btnClampWork.Size = new System.Drawing.Size(120, 34);
this.btnClampWork.TabIndex = 282;
this.btnClampWork.Text = "夹料气缸夹紧";
this.btnClampWork.UseVisualStyleBackColor = false;
......@@ -108,20 +92,69 @@ namespace OnlineStore.AssemblyLine.useControl
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(29, 27);
this.btnClampRelax.Location = new System.Drawing.Point(18, 64);
this.btnClampRelax.Name = "btnClampRelax";
this.btnClampRelax.Size = new System.Drawing.Size(140, 34);
this.btnClampRelax.Size = new System.Drawing.Size(120, 34);
this.btnClampRelax.TabIndex = 281;
this.btnClampRelax.Text = "夹料气缸放松";
this.btnClampRelax.UseVisualStyleBackColor = false;
this.btnClampRelax.Click += new System.EventHandler(this.btnClampRelax_Click);
//
// lblForce
//
this.lblForce.AutoSize = true;
this.lblForce.Location = new System.Drawing.Point(159, 19);
this.lblForce.Name = "lblForce";
this.lblForce.Size = new System.Drawing.Size(68, 17);
this.lblForce.TabIndex = 286;
this.lblForce.Text = "实时出力:";
//
// lblPosition
//
this.lblPosition.AutoSize = true;
this.lblPosition.Location = new System.Drawing.Point(159, 43);
this.lblPosition.Name = "lblPosition";
this.lblPosition.Size = new System.Drawing.Size(68, 17);
this.lblPosition.TabIndex = 287;
this.lblPosition.Text = "实时位置:";
//
// lblMoveOk
//
this.lblMoveOk.AutoSize = true;
this.lblMoveOk.Location = new System.Drawing.Point(159, 91);
this.lblMoveOk.Name = "lblMoveOk";
this.lblMoveOk.Size = new System.Drawing.Size(68, 17);
this.lblMoveOk.TabIndex = 288;
this.lblMoveOk.Text = "运动到位?";
//
// btnHome
//
this.btnHome.BackColor = System.Drawing.Color.White;
this.btnHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHome.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHome.Location = new System.Drawing.Point(18, 24);
this.btnHome.Name = "btnHome";
this.btnHome.Size = new System.Drawing.Size(120, 34);
this.btnHome.TabIndex = 289;
this.btnHome.Text = "夹爪回原点";
this.btnHome.UseVisualStyleBackColor = false;
this.btnHome.Click += new System.EventHandler(this.btnHome_Click);
//
// lblEmpty
//
this.lblEmpty.AutoSize = true;
this.lblEmpty.Location = new System.Drawing.Point(159, 67);
this.lblEmpty.Name = "lblEmpty";
this.lblEmpty.Size = new System.Drawing.Size(44, 17);
this.lblEmpty.TabIndex = 290;
this.lblEmpty.Text = "有料?";
//
// ClampJawControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.groupClamp);
this.Name = "ClampJawControl";
this.Size = new System.Drawing.Size(231, 167);
this.Size = new System.Drawing.Size(279, 155);
this.Load += new System.EventHandler(this.ClampJawControl_Load);
this.groupClamp.ResumeLayout(false);
this.groupClamp.PerformLayout();
......@@ -134,8 +167,11 @@ namespace OnlineStore.AssemblyLine.useControl
private System.Windows.Forms.GroupBox groupClamp;
private System.Windows.Forms.Button btnClampWork;
private System.Windows.Forms.Button btnClampRelax;
private System.Windows.Forms.CheckBox chbEmpty;
private System.Windows.Forms.CheckBox chbPosition;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Label lblPosition;
private System.Windows.Forms.Label lblForce;
private System.Windows.Forms.Label lblMoveOk;
private System.Windows.Forms.Button btnHome;
private System.Windows.Forms.Label lblEmpty;
}
}
......@@ -35,8 +35,30 @@ namespace OnlineStore.AssemblyLine.useControl
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
chbPosition.Checked = clampJaw.IsReached();
chbEmpty.Checked =! clampJaw.HasReel();
UpdateSta();
}
public void UpdateSta()
{
if (clampJaw.IsReached())
{
lblMoveOk.Text = "运动到位 ✔";
}
else
{
lblMoveOk.Text = " ";
}
if (clampJaw.HasReel())
{
lblEmpty.Text = "有料 ✔";
}
else
{
lblEmpty.Text = "无料";
}
lblPosition.Text = "实时位置:" + clampJaw.GetPosition();
lblForce.Text = "实时出力:" + clampJaw.GetTorque();
}
private void btnClampRelax_Click(object sender, EventArgs e)
......@@ -50,5 +72,11 @@ namespace OnlineStore.AssemblyLine.useControl
LogUtil.info(JName + "界面点击:" + btnClampRelax.Text);
clampJaw.Push();
}
private void btnHome_Click(object sender, EventArgs e)
{
LogUtil.info(JName + "界面点击:" + btnHome.Text);
clampJaw.GoHome();
}
}
}
......@@ -132,7 +132,7 @@ namespace OnlineStore.DeviceLibrary
//夹紧气缸放松
//CylinderMove(null, IO_Type.SL_ClampCylinder_Work, IO_Type.SL_ClampCylinder_Relax);
ClampJwa.Relax();
ClampJwa.GoHome();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW));
......@@ -164,7 +164,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(time));
//线体开始转动
AllLineMove(IO_VALUE.HIGH);
ClampJwa.Relax();
break;
case LineMoveStep.FR_02_LineRun:
MoveInfo.NextMoveStep(LineMoveStep.FR_03_CylinderUp);
......
......@@ -120,8 +120,9 @@ namespace OnlineStore.DeviceLibrary
{
case LineMoveStep.MH_01_UpDownHome:
MoveInfo.NextMoveStep(LineMoveStep.MH_02_CylinderUp);
DebugInfo(MoveInfo.MoveType + " : 升降轴走到待机点");
DebugInfo(MoveInfo.MoveType + " : 升降轴走到待机点,夹爪回原点");
UpdownUpMove();
ClampJwa.GoHome(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case LineMoveStep.MH_02_CylinderUp:
......
......@@ -35,7 +35,7 @@ namespace OnlineStore.DeviceLibrary
bool result = rmaxis.OpenPort(config.PortName, config.AxisNo);
if (!result)
{
LogUtil.error(Name + " OpenPort 失败:"+rmaxis.ErrorCode );
LogUtil.error(Name + " OpenPort 失败");
}
}
return rmaxis.IsPortOpen;
......@@ -86,7 +86,18 @@ namespace OnlineStore.DeviceLibrary
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.GoHome( );
rmaxis.MoveAbsolute(1);
}
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached(1));
}
}
public void GoHome(LineMoveInfo moveInfo = null)
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.GoHome();
}
if (moveInfo != null)
{
......@@ -94,5 +105,20 @@ namespace OnlineStore.DeviceLibrary
}
}
public float GetPosition()
{
return rmaxis.GetPosition();
}
public float GetTorque()
{
return rmaxis.GetTorque();
}
public void PushTest(float force, float distance)
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.Push(force, distance, config.Velocity);
}
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!