Commit e522a7cb LN

改成光栅遮挡时升降轴和旋转轴立即停止,流程暂停。恢复会自动继续

1 个父辈 9b6571e1
......@@ -65,34 +65,37 @@ namespace OnlineStore.DeviceLibrary
return;
}
if (MoveInfo.MoveType.Equals(MoveType.None))
{
if (Robot.MoveInfo.MoveType.Equals(MoveType.Reset) || Robot.MoveInfo.MoveType.Equals(MoveType.RHome))
{
}
else
if (!MoveStop)
{
if (MoveInfo.MoveType.Equals(MoveType.None))
{
if (Robot.AutoInput && Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
if (Robot.MoveInfo.MoveType.Equals(MoveType.Reset) || Robot.MoveInfo.MoveType.Equals(MoveType.RHome))
{
StartInstore(new InOutParam());
}
else if (Robot.AutoInput && Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH))
else
{
StartInstore(new InOutParam());
if (Robot.AutoInput && Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
{
StartInstore(new InOutParam());
}
else if (Robot.AutoInput && Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH))
{
StartInstore(new InOutParam());
}
}
}
}
else if (MoveInfo.MoveType.Equals(MoveType.Reset))
{
ResetProcess();
}
else if (MoveInfo.MoveType.Equals(MoveType.InStore))
{
InstoreProcess();
}
else if (MoveInfo.MoveType.Equals(MoveType.OutStore))
{
OutstoreProcess();
else if (MoveInfo.MoveType.Equals(MoveType.Reset))
{
ResetProcess();
}
else if (MoveInfo.MoveType.Equals(MoveType.InStore))
{
InstoreProcess();
}
else if (MoveInfo.MoveType.Equals(MoveType.OutStore))
{
OutstoreProcess();
}
}
......
......@@ -12,6 +12,7 @@ namespace OnlineStore.DeviceLibrary
{
partial class BatchMoveBean
{
public bool MoveStop = false;
public ShelfInfo CurrShelf = new ShelfInfo();
#region 入库
......
......@@ -371,46 +371,49 @@ namespace OnlineStore.DeviceLibrary
IOTimeOutProcess();
//判断流水线打开了才可以运行
List<BatchMoveBean> BatchMoveList = new List<BatchMoveBean>() { BatchMove_A, BatchMove_B };
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{
if (CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, IO_Type.UnderArea_Check_A, BatchMoveList))
{
if (!MoveStop)
{
}
else if (CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo,IO_Type.UnderArea_Check_B, BatchMoveList))
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{
if (CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, IO_Type.UnderArea_Check_A, BatchMoveList))
{
}
else
{
//如果有物料且不能放料,需要送一个料串离开
if (BufferDataManager.AOutStoreInfo != null)
}
else if (CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo, IO_Type.UnderArea_Check_B, BatchMoveList))
{
CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, IO_Type.UnderArea_Check_A,BatchMoveList, true);
}
else if (BufferDataManager.BOutStoreInfo != null)
else
{
CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo, IO_Type.UnderArea_Check_B, BatchMoveList, true);
//如果有物料且不能放料,需要送一个料串离开
if (BufferDataManager.AOutStoreInfo != null)
{
CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, IO_Type.UnderArea_Check_A, BatchMoveList, true);
}
else if (BufferDataManager.BOutStoreInfo != null)
{
CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo, IO_Type.UnderArea_Check_B, BatchMoveList, true);
}
}
}
}
}
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{
//若左侧或右侧在等待扫码结束的状态,需要开始去取料
foreach (BatchMoveBean moveBean in BatchMoveList)
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{
if (moveBean.MoveInfo.MoveType.Equals(MoveType.InStore) && moveBean.MoveInfo.IsStep(StepEnum.IB10_ScanOK))
//若左侧或右侧在等待扫码结束的状态,需要开始去取料
foreach (BatchMoveBean moveBean in BatchMoveList)
{
LogInfo(moveBean.Name + "开始取料:" + moveBean.GetInstoreParam().PosInfo.ToStr());
StartInstore(moveBean.GetInstoreParam());
break;
if (moveBean.MoveInfo.MoveType.Equals(MoveType.InStore) && moveBean.MoveInfo.IsStep(StepEnum.IB10_ScanOK))
{
LogInfo(moveBean.Name + "开始取料:" + moveBean.GetInstoreParam().PosInfo.ToStr());
StartInstore(moveBean.GetInstoreParam());
break;
}
}
}
}
}
foreach (BatchMoveBean moveBean in BatchMoveList)
{
moveBean.TimerProcess();
......@@ -727,11 +730,29 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
ConfigIO di = baseConfig.DIList[IO_Type.SafetyRasterSignal];
//ConfigIO di = baseConfig.DIList[IO_Type.SafetyRasterSignal];
LogUtil.info($"{Name }光栅被遮挡,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停");
SetWarnMsg("光栅被遮挡,报警急停");
Alarm(AlarmType.SuddenStop);
//LogUtil.info($"{Name }光栅被遮挡,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停");
//SetWarnMsg("光栅被遮挡,报警急停");
//Alarm(AlarmType.SuddenStop);
MoveStop = true;
BatchMove_A.MoveStop = true;
BatchMove_B.MoveStop = true;
string msg = "";
MiddleAxis.SuddenStop();
UpdownAxis.SuddenStop();
msg += $"停止轴{MiddleAxis.Config.Explain},{UpdownAxis.Config.Explain};";
if (MoveInfo.MoveType.Equals(MoveType.None))
{
SetWarnMsg("光栅被遮挡,暂停运动");
LogUtil.info($"{Name }光栅被遮挡,暂停运动,MoveStop={MoveStop},{msg},稍后复位");
}
else
{
SetWarnMsg("光栅被遮挡,暂停当前运动");
LogUtil.info($"{Name }光栅被遮挡,停止当前运动{MoveInfo.MoveType},{MoveInfo.MoveStep},{msg},稍后复位");
}
}
......@@ -742,14 +763,29 @@ namespace OnlineStore.DeviceLibrary
return;
}
CurrSecurityAccess = 0;
MoveStop = false;
MoveStop = false;
BatchMove_A.MoveStop = false;
BatchMove_B.MoveStop = false;
ConfigIO di = baseConfig.DIList[IO_Type.SafetyRasterSignal];
if (alarmType > (AlarmType.IoSingleTimeOut))
{
return;
}
//光栅恢复处理
//光栅恢复处理
if (WarnMsg.Contains("光栅被遮挡,暂停"))
{
SetWarnMsg("");
}
if (!MoveInfo.MoveType.Equals(MoveType.None))
{
MoveInfo.LastSetpTime = DateTime.Now;
LogUtil.info($"{Name }光栅已恢复,恢复当前运动{MoveInfo.MoveType},{MoveInfo.MoveStep} ");
}
else
{
LogUtil.info($"{Name }光栅已恢复,取消暂停运动");
}
}
}
......
......@@ -35,6 +35,7 @@
this.batchAxisP1 = new OnlineStore.XLRStore.useControl.AxisPointControl();
this.btnSave = new System.Windows.Forms.Button();
this.panBase = new System.Windows.Forms.Panel();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.btnResetShelf = new System.Windows.Forms.Button();
this.chbDebug = new System.Windows.Forms.CheckBox();
this.btnScanTest = new System.Windows.Forms.Button();
......@@ -42,9 +43,9 @@
this.btnShelfOut = new System.Windows.Forms.Button();
this.chbAutoOut = new System.Windows.Forms.CheckBox();
this.lblCurrInfo = new System.Windows.Forms.Label();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.btnReset = new System.Windows.Forms.Button();
this.axisMoveControl1 = new OnlineStore.XLRStore.AxisMoveControl();
this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.panel2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -76,6 +77,7 @@
this.panel2.Controls.Add(this.groupBox1);
this.panel2.Controls.Add(this.panBase);
this.panel2.Controls.Add(this.axisMoveControl1);
this.panel2.Controls.Add(this.chbAutoOut);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
......@@ -89,7 +91,7 @@
this.groupBox3.Controls.Add(this.Shelf_StopDown_A);
this.groupBox3.Controls.Add(this.Shelf_StopUp_A);
this.groupBox3.Controls.Add(this.LineStart_A);
this.groupBox3.Location = new System.Drawing.Point(499, 387);
this.groupBox3.Location = new System.Drawing.Point(499, 380);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(444, 120);
this.groupBox3.TabIndex = 281;
......@@ -166,7 +168,7 @@
this.groupBox2.Controls.Add(this.btnStartTest);
this.groupBox2.Controls.Add(this.lblTestMsg);
this.groupBox2.Controls.Add(this.btnTestStop);
this.groupBox2.Location = new System.Drawing.Point(499, 260);
this.groupBox2.Location = new System.Drawing.Point(499, 256);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(444, 123);
this.groupBox2.TabIndex = 280;
......@@ -273,13 +275,13 @@
// panBase
//
this.panBase.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panBase.Controls.Add(this.chbMoveStop);
this.panBase.Controls.Add(this.lblWarnMsg);
this.panBase.Controls.Add(this.btnResetShelf);
this.panBase.Controls.Add(this.chbDebug);
this.panBase.Controls.Add(this.btnScanTest);
this.panBase.Controls.Add(this.lblAgvInfo);
this.panBase.Controls.Add(this.btnShelfOut);
this.panBase.Controls.Add(this.chbAutoOut);
this.panBase.Controls.Add(this.lblCurrInfo);
this.panBase.Controls.Add(this.btnReset);
this.panBase.Location = new System.Drawing.Point(4, 4);
......@@ -287,6 +289,20 @@
this.panBase.Size = new System.Drawing.Size(940, 122);
this.panBase.TabIndex = 260;
//
// lblWarnMsg
//
this.lblWarnMsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblWarnMsg.Location = new System.Drawing.Point(114, 53);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(819, 23);
this.lblWarnMsg.TabIndex = 246;
this.lblWarnMsg.Text = "等待启动";
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnResetShelf
//
this.btnResetShelf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
......@@ -306,7 +322,7 @@
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
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.Location = new System.Drawing.Point(178, 86);
this.chbDebug.Location = new System.Drawing.Point(213, 86);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 325;
......@@ -359,7 +375,7 @@
this.chbAutoOut.Checked = true;
this.chbAutoOut.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAutoOut.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoOut.Location = new System.Drawing.Point(266, 86);
this.chbAutoOut.Location = new System.Drawing.Point(502, 510);
this.chbAutoOut.Name = "chbAutoOut";
this.chbAutoOut.Size = new System.Drawing.Size(168, 24);
this.chbAutoOut.TabIndex = 280;
......@@ -379,20 +395,6 @@
this.lblCurrInfo.TabIndex = 279;
this.lblCurrInfo.Text = "当前料盘:";
//
// lblWarnMsg
//
this.lblWarnMsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblWarnMsg.Location = new System.Drawing.Point(114, 53);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(819, 23);
this.lblWarnMsg.TabIndex = 246;
this.lblWarnMsg.Text = "等待启动";
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnReset
//
this.btnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
......@@ -414,6 +416,19 @@
this.axisMoveControl1.Size = new System.Drawing.Size(490, 398);
this.axisMoveControl1.TabIndex = 219;
//
// chbMoveStop
//
this.chbMoveStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
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(322, 86);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(84, 24);
this.chbMoveStop.TabIndex = 327;
this.chbMoveStop.Text = "暂停运动";
this.chbMoveStop.UseVisualStyleBackColor = true;
this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged);
//
// FrmBatchMove
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -429,6 +444,7 @@
this.Load += new System.EventHandler(this.FrmStoreIOStatus_Load);
this.Shown += new System.EventHandler(this.FrmIOStatus_Shown);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
......@@ -468,6 +484,7 @@
private System.Windows.Forms.Button LineStart_A;
protected System.Windows.Forms.CheckBox chbDebug;
protected System.Windows.Forms.Button btnResetShelf;
protected System.Windows.Forms.CheckBox chbMoveStop;
}
}
......@@ -292,6 +292,17 @@ namespace OnlineStore.XLRStore
moveBean.Reset(true);
LogUtil.info(moveBean.Name + "点击:" + btnResetShelf.Text);
}
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
moveBean.MoveStop = chbMoveStop.Checked;
LogUtil.info(moveBean.Name + "用户切换是否暂停: " + moveBean.MoveStop);
}
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!