Commit 5e426b78 几米阳光

修改BUG:轴报警后复位失败

1 个父辈 32bf3491
......@@ -67,6 +67,9 @@
this.label49 = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.axis_1_Alarm = new UserFromControl.IOStatusControl();
this.axis_3_Alarm = new UserFromControl.IOStatusControl();
this.axis_2_Alarm = new UserFromControl.IOStatusControl();
this.label38 = new System.Windows.Forms.Label();
this.txtMiddleTarget = new System.Windows.Forms.TextBox();
this.txtInoutTarget = new System.Windows.Forms.TextBox();
......@@ -84,6 +87,7 @@
this.label43 = new System.Windows.Forms.Label();
this.label42 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblTemp = new System.Windows.Forms.Label();
this.btnClearLog = new System.Windows.Forms.Button();
this.lblMsg = new System.Windows.Forms.Label();
this.btnSavePosition = new System.Windows.Forms.Button();
......@@ -151,10 +155,6 @@
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.btnOpenWCF = new System.Windows.Forms.Button();
this.btnCloseWCF = new System.Windows.Forms.Button();
this.lblTemp = new System.Windows.Forms.Label();
this.axis_1_Alarm = new UserFromControl.IOStatusControl();
this.axis_3_Alarm = new UserFromControl.IOStatusControl();
this.axis_2_Alarm = new UserFromControl.IOStatusControl();
this.groupBox5.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -705,6 +705,36 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
//
// axis_1_Alarm
//
this.axis_1_Alarm.IOName = "";
this.axis_1_Alarm.IOValue = 0;
this.axis_1_Alarm.isCanClick = false;
this.axis_1_Alarm.Location = new System.Drawing.Point(127, 49);
this.axis_1_Alarm.Name = "axis_1_Alarm";
this.axis_1_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_1_Alarm.TabIndex = 264;
//
// axis_3_Alarm
//
this.axis_3_Alarm.IOName = "";
this.axis_3_Alarm.IOValue = 0;
this.axis_3_Alarm.isCanClick = false;
this.axis_3_Alarm.Location = new System.Drawing.Point(329, 49);
this.axis_3_Alarm.Name = "axis_3_Alarm";
this.axis_3_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_3_Alarm.TabIndex = 266;
//
// axis_2_Alarm
//
this.axis_2_Alarm.IOName = "";
this.axis_2_Alarm.IOValue = 0;
this.axis_2_Alarm.isCanClick = false;
this.axis_2_Alarm.Location = new System.Drawing.Point(224, 49);
this.axis_2_Alarm.Name = "axis_2_Alarm";
this.axis_2_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_2_Alarm.TabIndex = 265;
//
// label38
//
this.label38.AutoSize = true;
......@@ -899,6 +929,17 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "料仓操作";
//
// lblTemp
//
this.lblTemp.AutoSize = true;
this.lblTemp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTemp.ForeColor = System.Drawing.Color.Black;
this.lblTemp.Location = new System.Drawing.Point(11, 396);
this.lblTemp.Name = "lblTemp";
this.lblTemp.Size = new System.Drawing.Size(159, 20);
this.lblTemp.TabIndex = 270;
this.lblTemp.Text = "当前温度--,当前湿度--";
//
// btnClearLog
//
this.btnClearLog.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -1752,47 +1793,6 @@
this.btnCloseWCF.UseVisualStyleBackColor = true;
this.btnCloseWCF.Click += new System.EventHandler(this.btnCloseWCF_Click);
//
// lblTemp
//
this.lblTemp.AutoSize = true;
this.lblTemp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTemp.ForeColor = System.Drawing.Color.Black;
this.lblTemp.Location = new System.Drawing.Point(11, 396);
this.lblTemp.Name = "lblTemp";
this.lblTemp.Size = new System.Drawing.Size(159, 20);
this.lblTemp.TabIndex = 270;
this.lblTemp.Text = "当前温度--,当前湿度--";
//
// axis_1_Alarm
//
this.axis_1_Alarm.IOName = "";
this.axis_1_Alarm.IOValue = 0;
this.axis_1_Alarm.isCanClick = false;
this.axis_1_Alarm.Location = new System.Drawing.Point(127, 49);
this.axis_1_Alarm.Name = "axis_1_Alarm";
this.axis_1_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_1_Alarm.TabIndex = 264;
//
// axis_3_Alarm
//
this.axis_3_Alarm.IOName = "";
this.axis_3_Alarm.IOValue = 0;
this.axis_3_Alarm.isCanClick = false;
this.axis_3_Alarm.Location = new System.Drawing.Point(329, 49);
this.axis_3_Alarm.Name = "axis_3_Alarm";
this.axis_3_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_3_Alarm.TabIndex = 266;
//
// axis_2_Alarm
//
this.axis_2_Alarm.IOName = "";
this.axis_2_Alarm.IOValue = 0;
this.axis_2_Alarm.isCanClick = false;
this.axis_2_Alarm.Location = new System.Drawing.Point(224, 49);
this.axis_2_Alarm.Name = "axis_2_Alarm";
this.axis_2_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_2_Alarm.TabIndex = 265;
//
// FrmStoreBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......
......@@ -124,7 +124,7 @@
<value>107, 16</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>78</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
......
......@@ -32,7 +32,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 轴报警信息
/// </summary>
private Dictionary<ConfigMoveAxis, AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<ConfigMoveAxis, AxisAlarmInfo>();
private Dictionary<string , AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<string , AxisAlarmInfo>();
/// <summary>
/// 是否有压紧轴
......@@ -231,10 +231,10 @@ namespace OnlineStore.DeviceLibrary
moveAxisList.Add(Config.Middle_Axis);
moveAxisList.Add(Config.UpDown_Axis);
moveAxisList.Add(Config.InOut_Axis);
this.AxisAlarmCodeMap = new Dictionary<ConfigMoveAxis, AxisAlarmInfo>();
this.AxisAlarmCodeMap.Add(Config.UpDown_Axis, new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(Config.InOut_Axis, new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(this.Config.Middle_Axis, new AxisAlarmInfo());
this.AxisAlarmCodeMap = new Dictionary<string , AxisAlarmInfo>();
this.AxisAlarmCodeMap.Add(Config.UpDown_Axis.DeviceName, new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(Config.InOut_Axis.DeviceName, new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(this.Config.Middle_Axis.DeviceName, new AxisAlarmInfo());
}
......@@ -392,8 +392,7 @@ namespace OnlineStore.DeviceLibrary
// 复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_LocationCylinderBack);
LocationDownAndWait();
}
InProcess = false;
}
isInPro = false;
}
......@@ -414,31 +413,29 @@ namespace OnlineStore.DeviceLibrary
{
case StoreMoveStep.BOX_H_LocationCylinderBack:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogUtil.info(LOGGER, StoreName + "复位:进出轴回原点");
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info(LOGGER, StoreName + "复位中:进出轴回原点。。");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "复位:进出轴走到P1,关闭舱门");
LogUtil.info(LOGGER, StoreName + "复位中:进出轴到待机点P1,关闭舱门");
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis);
AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//判断叉子没有料盘
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_H_InOutToP1:
//如果此时轴三还在报警,需要提示错误并等待
//如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!");
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil.info(LOGGER, StoreName + "复位: 压紧轴,旋转轴,上下轴开始 原点返回");
LogUtil.info(LOGGER, StoreName + "复位: 压紧轴,旋转轴,上下轴开始 原点返回");
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
if (IsHasCompress_Axis)
{
......@@ -530,13 +527,14 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴回原点");
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴已经回原点, 进出轴退回P1点,关闭仓门,检测叉子没有料盘");
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴退回P1点,关闭仓门,检测叉子没有料盘");
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis);
AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//判断叉子没有料盘
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
......@@ -732,7 +730,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, StoreName + " 报警,报警类型:" + alarmType);
this.alarmType = alarmType;
if (alarmType == StoreAlarmType.AxisAlarm)
if (alarmType.Equals(StoreAlarmType.AxisAlarm) | alarmType.Equals(StoreAlarmType.AxisMoveError))
{
LogUtil.error(LOGGER, StoreName + "轴报警,关闭轴,打开报警灯");
StopMove();
......@@ -743,7 +741,7 @@ namespace OnlineStore.DeviceLibrary
isInSuddenDown = true;
LogUtil.error(LOGGER, StoreName + "收到急停信号,关闭所有轴卡,关闭所有IO,停止所有运动");
StopMove();
CloseAllAxis();
CloseAllAxis();
StoreMove.EndMove();
storeStatus = StoreStatus.SuddenStop;
}
......@@ -752,7 +750,7 @@ namespace OnlineStore.DeviceLibrary
isNoAirCheck = true;
LogUtil.error(LOGGER, StoreName + " 未检测到气压信号 ,关闭所有轴卡,关闭所有IO,停止所有运动");
StopMove();
CloseAllAxis();
CloseAllAxis();
StoreMove.EndMove();
storeStatus = StoreStatus.SuddenStop;
}
......@@ -933,7 +931,7 @@ namespace OnlineStore.DeviceLibrary
}
//检查运动轴报警
if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown))
if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown) )
{
CheckAxisAlarm();
}
......@@ -956,7 +954,7 @@ namespace OnlineStore.DeviceLibrary
scanSocket.ConnectScanner(Config.Scanner_Ip,Config.Scanner_Port);
}
//判断是否需要出入库
if (StoreMove.MoveType.Equals(StoreMoveType.None))
if (StoreMove.MoveType.Equals(StoreMoveType.None)&&alarmType.Equals(StoreAlarmType.None))
{
IO_VALUE checkIO = KNDIOValue(IO_Type.TrayCheck_Door);
......@@ -1110,6 +1108,10 @@ namespace OnlineStore.DeviceLibrary
private DateTime checkAlarmTime = DateTime.Now;
public bool CheckAxisAlarm()
{
if (alarmType.Equals(StoreAlarmType.AxisAlarm) || alarmType.Equals(StoreAlarmType.AxisMoveError))
{
return true;
}
TimeSpan span = DateTime.Now - checkAlarmTime;
//在回原点,复位,出入库时,检测报警间隔减小
if (storeRunStatus.Equals(StoreRunStatus.Busy) || storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset))
......@@ -1132,21 +1134,16 @@ namespace OnlineStore.DeviceLibrary
foreach (ConfigMoveAxis axisInfo in moveAxisList)
{
AxisAlarmInfo info = AxisAlarmCodeMap[axisInfo];
short axis = axisInfo.GetAxisValue();
string deviceName = axisInfo.DeviceName;
int alarmIo = ACServerManager.GetAlarmStatus(deviceName, axis);
AxisAlarmInfo info = AxisAlarmCodeMap[deviceName];
int alarmIo = ACServerManager.GetAlarmStatus(deviceName, axis);
if (alarmIo == 1)
{
WarnMsg = StoreName + " 运动轴" + axisInfo.Explain + "报警";
if (!info.AlarmIoValue.Equals( alarmIo))
{
LogUtil.error(LOGGER, WarnMsg);
int alarmCode = GetAlarmCodeByAxis(axisInfo);
info.AlarmIoValue = alarmIo;
//TODO 记录报警状态,不能出入库
}
info.AlarmIoValue = alarmIo;
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None);
isInAlarm = true;
}
......@@ -1156,9 +1153,9 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error(LOGGER, StoreName + " 运动轴 " + axisInfo.Explain + ",报警已解除!");
info.AlarmIoValue = alarmIo;
//TODO 更改为正常联机状态
}
}
AxisAlarmCodeMap[deviceName] = info;
}
//判断报警状态
return isInAlarm;
......@@ -1491,7 +1488,7 @@ namespace OnlineStore.DeviceLibrary
}
boxStatus.msg = WarnMsg;
lineOperation.msg = WarnMsg;
WarnMsg = "";
//WarnMsg = "";
//状态
boxStatus.status = (int)storeStatus;
if (IsDebug)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!