Commit 181d32e7 LN

出入库逻辑

1 个父辈 c1af307d
......@@ -109,6 +109,7 @@ namespace OnlineStore.DUOStore
this.btnStoreStart = new System.Windows.Forms.Button();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label();
this.lblCanOut = new System.Windows.Forms.Label();
this.groupBox4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
......@@ -1238,6 +1239,7 @@ namespace OnlineStore.DUOStore
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.lblCanOut);
this.groupBox3.Controls.Add(this.lblMoveEquipInfo);
this.groupBox3.Controls.Add(this.btnSotreReset);
this.groupBox3.Controls.Add(this.btnStoreStop);
......@@ -1303,7 +1305,7 @@ namespace OnlineStore.DUOStore
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(407, 14);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(662, 84);
this.lblWarnMsg.Size = new System.Drawing.Size(662, 50);
this.lblWarnMsg.TabIndex = 224;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......@@ -1318,6 +1320,17 @@ namespace OnlineStore.DUOStore
this.lblThisSta.TabIndex = 216;
this.lblThisSta.Text = "等待启动";
//
// lblCanOut
//
this.lblCanOut.AutoSize = true;
this.lblCanOut.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCanOut.ForeColor = System.Drawing.Color.Green;
this.lblCanOut.Location = new System.Drawing.Point(949, 74);
this.lblCanOut.Name = "lblCanOut";
this.lblCanOut.Size = new System.Drawing.Size(51, 19);
this.lblCanOut.TabIndex = 273;
this.lblCanOut.Text = "可出库";
//
// FrmBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -1442,6 +1455,7 @@ namespace OnlineStore.DUOStore
public System.Windows.Forms.Button btnUpDownP4;
private System.Windows.Forms.Button btnSingleOut;
private System.Windows.Forms.Button btnNgPro;
private System.Windows.Forms.Label lblCanOut;
}
}
......@@ -132,6 +132,7 @@ namespace OnlineStore.DUOStore
lblMoveEquipInfo.Text = "";
// lblMoveEquipInfo.Text = "";
}
lblCanOut.Text = StoreManager.Store.CanOut() ? "可出库" : "不可出库";
//ReadPosistion();
if (BoxBean.runStatus > StoreRunStatus.Wait)
{
......@@ -660,9 +661,9 @@ namespace OnlineStore.DUOStore
private void btnSelTemp_Click(object sender, EventArgs e)
{
// HumitureParam param = BoxBean.humBean.QueryData();
// txtTemp.Text = param.Temperate.ToString();
// txtHum.Text = param.Humidity.ToString();
HumitureParam param = BoxBean.humBean.QueryData();
txtTemp.Text = param.Temperate.ToString();
txtHum.Text = param.Humidity.ToString();
}
internal void DebugStatus(bool isDebug)
......
多料仓软件。
有温湿度传感器,不需要吹氮气。
......
......@@ -16,19 +16,15 @@ namespace OnlineStore.DeviceLibrary
{
public partial class BoxBean : EquipBase
{
private bool IsIntSlvBlock = false;
public AutoInoutInfo AutoInout = new AutoInoutInfo();
public string CID = "";
public BOX_Config Config;
public string lastPosId = "";
public StoreStatus lastPosIdStatus = StoreStatus.StoreOnline;
public List<ConfigMoveAxis> moveAxisList = new List<ConfigMoveAxis>();
private List<ConfigMoveAxis> moveAxisList = new List<ConfigMoveAxis>();
public List<string> PositionNumList = new List<string>();
public HumitureBean humBean = null;
public AxisBean UpdownAxis = null;
public AxisBean MiddleAxis = null;
public AxisBean ComAxis = null;
......@@ -94,7 +90,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
public void MoveAxisConfig()
internal void MoveAxisConfig()
{
Config.UpDown_Axis.BreakOnDO = IO_Type.UpdownAxis_Break;
moveAxisList = new List<ConfigMoveAxis>();
......@@ -103,6 +99,8 @@ namespace OnlineStore.DeviceLibrary
moveAxisList.Add(Config.InOut_Axis);
moveAxisList.Add(Config.Comp_Axis);
}
public override bool StartRun(bool isDebug = false)
{
if (!StoreManager.Store.canStart)
......@@ -281,6 +279,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - StartTime;
LogInfo(",停止运行,总运行时间:" + span.ToString());
}
public override void Alarm(AlarmType alarmType, string alarmDetial = "", string alarmMsg = "", MoveType storeMoveType = MoveType.None)
{
base.Alarm(alarmType, alarmDetial, alarmMsg, storeMoveType);
......
......@@ -131,9 +131,19 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(StoreMoveStep.SI_02_AxisBack))
{
if (StoreManager.Store.BoxDoorFree(ID))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_InoutToP2);
InOutStoreLog(outType + "进出轴到P2["+ moveP.InOut_P2 + "] ");
InOutStoreLog(outType + "进出轴到P2[" + moveP.InOut_P2 + "] ");
InoutAxis.AbsMove(MoveInfo, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
ClearTimeoutAlarm("进出轴可以到P2");
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 进出轴可以到P2 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.IsStep(StoreMoveStep.SI_03_InoutToP2))
{
......@@ -153,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveParam.TargetPosition.Equals(0))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_06_ToPos);
InOutStoreLog(outType + "移动到库位点,旋转轴到P2( 库位点),升降轴到P3(库位入库前点) ");
InOutStoreLog(outType + "移动到库位点,旋转轴到P2["+ moveP.Middle_P2 + "],升降轴到P3 ["+ moveP.UpDown_P3 + "] ");
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
}
......@@ -171,7 +181,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.SI_06_ToPos))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_07_InoutToP3);
InOutStoreLog(outType + "进出轴到P3(库位取放料点) ");
InOutStoreLog(outType + "进出轴到P3 ["+ moveP.InOut_P3 + "] ");
InoutAxis.AbsMove(MoveInfo, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.SI_07_InoutToP3))
......@@ -194,7 +204,7 @@ namespace OnlineStore.DeviceLibrary
InOutBackToP1(moveP.InOut_P1);
OutDoorReelType = 2;
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_09_InoutToP1)
else if (MoveInfo.IsStep( StoreMoveStep.SI_09_InoutToP1))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_10_GoBack);
InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "],");
......@@ -276,7 +286,7 @@ namespace OnlineStore.DeviceLibrary
private void StartExecuctOut(InOutParam param)
{
bool result = false;
if (StoreManager.Store.CanOut())
if (StoreManager.Store.CanOut(true))
{
result = StartOutStoreMove(param);
}
......@@ -338,7 +348,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.IsStep(StoreMoveStep.SO_01_InoutBack))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_02_ToPosition);
InOutStoreLog(outType + "压紧轴到压紧前点P3["+ moveP.ComPress_P3 + "] ,旋转轴到库位点P2["+ moveP.Middle_P2 + "],升降轴到P5 ["+ moveP.UpDown_P5 + "] ");
InOutStoreLog(outType + "压紧轴到压紧前点P3[" + moveP.ComPress_P3 + "] ,旋转轴到库位点P2[" + moveP.Middle_P2 + "],升降轴到P5 [" + moveP.UpDown_P5 + "] ");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
......@@ -352,14 +362,14 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.SO_03_InoutToP3))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_04_GetReel);
InOutStoreLog(outType + "升降轴到P6["+ moveP.UpDown_P6 + "],压紧轴到P2["+moveP.ComPress_P2+"]");
InOutStoreLog(outType + "升降轴到P6[" + moveP.UpDown_P6 + "],压紧轴到P2[" + moveP.ComPress_P2 + "]");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P2, Config.CompAxis_P2_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P6, Config.UpDownAxis_P6_Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_04_GetReel))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_05_InoutBack);
InOutStoreLog(outType + "进出轴返回P1["+ moveP.InOut_P1 + "]");
InOutStoreLog(outType + "进出轴返回P1[" + moveP.InOut_P1 + "]");
InOutBackToP1(moveP.InOut_P1);
//把库位的物品放到取到叉子上之后是出仓完成
string posId = MoveInfo.MoveParam.PosID;
......@@ -373,14 +383,14 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveParam.TargetPosition.Equals(0))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_06_ToDoor);
InOutStoreLog(outType + "旋转轴 至P2["+ moveP.Middle_P2 + "],升降轴到P3"+ moveP.UpDown_P3 + " ");
InOutStoreLog(outType + "旋转轴 至P2[" + moveP.Middle_P2 + "],升降轴到P3" + moveP.UpDown_P3 + " ");
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
}
else
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_21_ToOutDoor);
InOutStoreLog(outType + "移动到出料口,旋转轴到P11["+ Config.MiddleAxis_P11 + "],升降轴到P12高点["+Config.UpDownAxis_P12 + "] ");
InOutStoreLog(outType + "移动到出料口,旋转轴到P11[" + Config.MiddleAxis_P11 + "],升降轴到P12高点[" + Config.UpDownAxis_P12 + "] ");
MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P11, Config.MiddleAxis_P11_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P12, Config.UpDownAxis_P12_Speed);
}
......@@ -389,27 +399,37 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.SO_06_ToDoor))
{
if (StoreManager.Store.BoxDoorFree(ID))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_07_InoutToP2);
InOutStoreLog(outType + "进出轴到P2 ["+ moveP.InOut_P2 + "]");
InOutStoreLog(outType + "进出轴到P2 [" + moveP.InOut_P2 + "]");
InoutAxis.AbsMove(MoveInfo, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
ClearTimeoutAlarm("进出轴可以到P2");
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 进出轴可以到P2 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_07_InoutToP2))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_PutReel);
InOutStoreLog(outType + "放下物品 升降轴至P1["+ moveP.UpDown_P1 + "],压紧轴到P3 ["+ moveP.ComPress_P3 + "]");
InOutStoreLog(outType + "放下物品 升降轴至P1[" + moveP.UpDown_P1 + "],压紧轴到P3 [" + moveP.ComPress_P3 + "]");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_08_PutReel))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_09_InoutBack);
InOutStoreLog(outType + "进出轴返回P1["+ moveP.InOut_P1 + "]");
InOutStoreLog(outType + "进出轴返回P1[" + moveP.InOut_P1 + "]");
InOutBackToP1(moveP.InOut_P1);
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_09_InoutBack))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_10_GoBack);
InOutStoreLog(outType + "升降轴到P1["+ moveP.UpDown_P1 + "],旋转轴到P1["+ moveP.Middle_P1 + "] ,压紧轴到P1["+ moveP.ComPress_P1 + "] ");
InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "] ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
......@@ -425,21 +445,22 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_11_WaitTrayGo);
InOutStoreLog(outType + "等待提升机构拿走料盘 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.InDoor_Check,IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.InDoor_Check, IO_VALUE.LOW));
ClearTimeoutAlarm("提升机构夹爪开始取料");
ClearTimeoutAlarm("提升机构夹爪可以取料");
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 提升机构夹爪开始取料 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 提升机构夹爪开始取料 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 提升机构夹爪可以取料 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 提升机构夹爪可以取料 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut);
}
......@@ -467,14 +488,14 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.SO_22_OpenOutDoor))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_23_InoutToP11);
InOutStoreLog(outType + "进出轴到_P11-出料口取放料点 ["+ Config.InOutAxis_P11 + "] ");
InOutStoreLog(outType + "进出轴到_P11-出料口取放料点 [" + Config.InOutAxis_P11 + "] ");
InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P11, Config.InOutAxis_P11_Speed);
//关闭舱门
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_23_InoutToP11))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_24_PurReel);
InOutStoreLog(outType + "升降轴到_P11-出料口-低点["+ Config.UpDownAxis_P11 + "],压紧轴到压紧前点P3 ["+ moveP.ComPress_P3 + "]");
InOutStoreLog(outType + "升降轴到_P11-出料口-低点[" + Config.UpDownAxis_P11 + "],压紧轴到压紧前点P3 [" + moveP.ComPress_P3 + "]");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P11, Config.UpDownAxis_P11_Speed);
......@@ -482,13 +503,13 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.SO_24_PurReel))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_25_InoutToP1);
InOutStoreLog(outType + "进出轴返回待机点P1 ["+ moveP.InOut_P1 + "] ");
InOutStoreLog(outType + "进出轴返回待机点P1 [" + moveP.InOut_P1 + "] ");
InOutBackToP1(moveP.InOut_P1);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_25_InoutToP1)
else if (MoveInfo.IsStep( StoreMoveStep.SO_25_InoutToP1))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_26_GoBack);
InOutStoreLog(outType + "升降轴到P1["+ moveP.UpDown_P1 + "],旋转轴到P1["+ moveP.Middle_P1 + "],压紧轴到P1["+ moveP.ComPress_P1 + "],关闭出料口门");
InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "],压紧轴到P1[" + moveP.ComPress_P1 + "],关闭出料口门");
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
......
......@@ -34,15 +34,26 @@ namespace OnlineStore.DeviceLibrary
lastConTime = DateTime.Now;
try
{
//HumitureController.QueryData();
humBean.HumidityProcess(this);
if (StoreManager.IsConnectServer)
{
SendLineStatus();
}
//出料口状态灯处理
OutDoorLedProcess();
}
catch (Exception ex)
{
LogUtil.error(Name + "定时SendLineStatus出错:" + ex.ToString());
}
finally
{
isInProcess = false;
}
}
private void OutDoorLedProcess()
{
if (OutDoorReelType.Equals(1))
{
IOMove(IO_Type.DoorLed_Red, IO_VALUE.LOW, true);
......@@ -73,15 +84,6 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DoorLed_Red, IO_VALUE.LOW, true);
}
}
catch (Exception ex)
{
LogUtil.error(Name + "定时SendLineStatus出错:" + ex.ToString());
}
finally
{
isInProcess = false;
}
}
/// <summary>
/// 获取整个料仓的状态
......
......@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
{
public partial class DUOStoreBean : EquipBase
{
public Dictionary<int, BOX_Config> BoxConfigMap { get; set; }
internal Dictionary<int, BOX_Config> BoxConfigMap { get; set; }
public Dictionary<int, BoxBean> BoxMap = new Dictionary<int, BoxBean>();
public Store_Config Config { get; set; }
......@@ -149,11 +149,9 @@ namespace OnlineStore.DeviceLibrary
//停止运动
MoveInfo.EndMove();
runStatus = StoreRunStatus.Reset;
StartResetMove();
foreach (BoxBean equip in BoxMap.Values)
{
if (!equip.alarmType.Equals(AlarmType.None))
......@@ -188,7 +186,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop2_Work, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop3_Buffer, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop4_Out, IO_VALUE.LOW));
}
protected override void ResetProcess()
......@@ -221,7 +218,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LR_03_BatchAxisHome))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_04_BatchToP1);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :提升轴到P1点,上下轴到待机点P2");
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :提升轴到P1点["+ Config.BatchAxis_P1 + "],上下轴到待机点P2["+ Config.UpdownAxis_P2 + "]");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P1Speed);
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P2, Config.UpdownAxis_P2Speed);
......@@ -238,10 +235,10 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LR_05_Hoister_Back))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_06_TopDown);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :顶升气缸下降,旋转轴到待机点P1");
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :顶升气缸下降,旋转轴到待机点P1["+ Config.MiddleAxis_P1 + "]");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P2, Config.MiddleAxis_P2Speed);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_06_TopDown))
{
......@@ -329,7 +326,7 @@ namespace OnlineStore.DeviceLibrary
DateTime time = DateTime.Now;
bool isNeedAlarmLed = false;
bool isInOut = false;
StoreRunStatus runs = StoreRunStatus.Wait;
bool isReset = false;
foreach (BoxBean box in BoxMap.Values)
{
......@@ -341,14 +338,14 @@ namespace OnlineStore.DeviceLibrary
{
isInOut = true;
}
if (box.runStatus > runs)
if (box.runStatus.Equals(StoreRunStatus.HomeMoving) || box.runStatus.Equals(StoreRunStatus.Reset))
{
runs = box.runStatus;
isReset = true;
}
}
//黄灯
if (runs.Equals(StoreRunStatus.HomeMoving) || runs.Equals(StoreRunStatus.Reset))
//复位过程中黄灯闪烁
if (runStatus.Equals(StoreRunStatus.HomeMoving) || runStatus.Equals(StoreRunStatus.Reset)||isReset )
{
//开机执行中时黄灯闪烁
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
......@@ -367,10 +364,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
}
if (alarmType.Equals(AlarmType.None).Equals(false) || isNoAirCheck || isInSuddenDown )
{
isNeedAlarmLed = true;
}
//忙碌中,判断是否有移栽在出入库执行,绿灯闪烁
if (isInOut)
{
......@@ -389,6 +383,10 @@ namespace OnlineStore.DeviceLibrary
}
//报警中 ,红灯闪烁
if (alarmType.Equals(AlarmType.None).Equals(false) || isNoAirCheck || isInSuddenDown )
{
isNeedAlarmLed = true;
}
if (isNeedAlarmLed)
{
if (IsDoValue(IO_Type.Alarm_HddLed, IO_VALUE.LOW))
......@@ -420,7 +418,6 @@ namespace OnlineStore.DeviceLibrary
private IO_VALUE preAirValue = IO_VALUE.HIGH;
private void AirCheckProcess()
{
IO_VALUE currAirValue = IOValue(IO_Type.Airpressure_Check);
if (isInSuddenDown)
{
......@@ -545,22 +542,20 @@ namespace OnlineStore.DeviceLibrary
ShowTimeLog("IOTimeOutProcess");
//判断是否需要处理料架入库
StartInStoreP();
}
//检查运动轴报警
if (runStatus > StoreRunStatus.Wait && (!isInSuddenDown) && (!isNoAirCheck))
{
ShowTimeLog("开始检测轴报警");
CheckAxisAlarm(new AxisBean[] { T1_BatchAxis,T2_MiddleAxis,T3_UpdownAxis});
CheckAxisAlarm(new AxisBean[] { T1_BatchAxis, T2_MiddleAxis, T3_UpdownAxis });
ShowTimeLog("轴报警检测完成");
}
if (runStatus.Equals(StoreRunStatus.Runing) || runStatus.Equals(StoreRunStatus.Busy))
{
ShelfOutProcess();
ShowTimeLog("ShelfOutProcess");
}
}
catch (Exception ex)
......
......@@ -78,23 +78,34 @@ namespace OnlineStore.DeviceLibrary
#region 料架出料
public int outStoreCount = 0;
public bool CanOut()
public bool CanOut(bool IsStart = false)
{
if (isInSuddenDown || isNoAirCheck)
{
return false;
}
if (runStatus <= StoreRunStatus.Wait)
{
return false;
}
if (MoveInfo.MoveType.Equals(MoveType.OutStore))
{
return true;
}
else if (MoveInfo.MoveType.Equals(MoveType.None))
{
if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH) )
if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
{
if (CurrShelfNum >= 0 && (CurrShelfType.Equals(0) || CurrShelfType.Equals(2)))
{
StartOutStoreMove(new InOutParam(MoveType.OutStore));
if (IsStart)
{
return StartOutStoreMove(new InOutParam(MoveType.OutStore));
}
else
{
return true;
}
}
}
}
......@@ -111,6 +122,7 @@ namespace OnlineStore.DeviceLibrary
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.OutStoreExecute;
MoveInfo.NewMove(MoveType.OutStore, new InOutParam(MoveType.OutStore));
LogUtil.info(Name + " 当前料架["+CurrShelfNum+"]["+CurrShelfType+"],开始出库");
UpdateShelfNum(CurrShelfNum, 2);
L_05_WaitTime(StoreMoveStep.LO_05_WaitTime);
return true;
......@@ -121,14 +133,14 @@ namespace OnlineStore.DeviceLibrary
}
public bool StartTrayOut(InOutParam outParam)
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_11_BatchAxisDown);
InOutStoreLog("取料:批量轴下降指定的高度");
if (outParam == null || outParam.PosID == null || outParam.PosID.Equals(""))
{
LogUtil.error(Name + " StartTrayOut 出库失败,参数不完整:");
LogUtil.error(outParam.ToStr());
return false;
}
//MoveInfo.NextMoveStep(StoreMoveStep.LO_11_BatchAxisDown);
//InOutStoreLog("取料:批量轴下降指定的高度");
if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveStep.Equals(StoreMoveStep.LO_09_WaitOut))
{
MoveInfo.NewMove(MoveType.OutStore, outParam);
......@@ -140,13 +152,13 @@ namespace OnlineStore.DeviceLibrary
{
targetPosition = Config.BatchAxis_P1;
}
InOutStoreLog("出库移栽:"+outParam.ToStr() +" 提升伺服下降" + height + "mm,目标:" + targetPosition);
InOutStoreLog(" StartTrayOut 出库移栽:" + outParam.ToStr() +" 提升伺服下降" + height + "mm,目标:" + targetPosition);
T1_BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
return true;
}
else
{
LogUtil.error(Name + "出库" + outParam.ToStr() + "失败,未准备好料架");
LogUtil.error(Name + "StartTrayOut 出库" + outParam.ToStr() + "失败,未准备好料架");
return false;
}
}
......@@ -180,26 +192,28 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LO_07_HoisterForward))
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_08_AxisUpToP2);
InOutStoreLog("料架出库:上料轴开始慢速上升到P2点,等待检测到料盘");
InOutStoreLog("料架出库:上料轴开始慢速上升到P2点["+Config.BatchAxis_P2+"],等待检测到料盘");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
BatchAxisToP2(true);
}
else if (MoveInfo.IsStep(StoreMoveStep.LO_08_AxisUpToP2))
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_09_WaitOut);
InOutStoreLog("料架出库:料架准备完成,等待料盘出库");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
}
else if (MoveInfo.IsStep(StoreMoveStep.LO_09_WaitOut))
{
if (OutstoreEndSendShelf && outStoreCount > 0)
{
InOutStoreLog("料架出库:OutstoreEndSendShelf=true,开始送出料架");
InOutStoreLog("料架出库:OutstoreEndSendShelf=true,已出库盘数["+outStoreCount+"],开始送出料架");
LO_31_BatchAxisToP1();
}
else
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_09_WaitOut);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
InOutStoreLog(" 等待料盘出库");
//InOutStoreLog(" 等待料盘出库");
}
}
#endregion
......@@ -212,13 +226,13 @@ namespace OnlineStore.DeviceLibrary
if (LastPosParam.TargetBox.Equals(1))
{
InOutStoreLog("取料, BOX " + LastPosParam.TargetBox + " 升降轴到料门口高点[" + Config.UpdownAxis_P4 + "],旋转轴到料仓门口 [" + Config.MiddleAxis_P2 + "]");
InOutStoreLog("取料, BOX1 升降轴到料门口高点[" + Config.UpdownAxis_P4 + "],旋转轴到料仓门口 P2 [" + Config.MiddleAxis_P2 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P2, Config.MiddleAxis_P2Speed);
}
else
{
InOutStoreLog("取料, BOX " + LastPosParam.TargetBox + " 升降轴到料门口高点[" + Config.UpdownAxis_P6 + "],旋转轴到料仓门口 [" + Config.MiddleAxis_P3 + "]");
InOutStoreLog("取料, BOX2 升降轴到料门口高点[" + Config.UpdownAxis_P6 + "],旋转轴到料仓门口 P3 [" + Config.MiddleAxis_P3 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P6, Config.UpdownAxis_P6Speed);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P3, Config.MiddleAxis_P3Speed);
}
......@@ -228,12 +242,12 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.LO_13_UpdownDown);
if (LastPosParam.TargetBox.Equals(1))
{
InOutStoreLog("取料:升降轴下降到料门口低点[" + Config.UpdownAxis_P3 + "]");
InOutStoreLog("取料:BOX1 升降轴到料门口低点P3[" + Config.UpdownAxis_P3 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P3, Config.UpdownAxis_P3Speed);
}
else
{
InOutStoreLog("取料:升降轴下降到料门口低点[" + Config.UpdownAxis_P5 + "]");
InOutStoreLog("取料:BOX2 升降轴到料门口低点P5[" + Config.UpdownAxis_P5 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P5, Config.UpdownAxis_P5Speed);
}
}
......@@ -248,31 +262,31 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.LO_15_UpdownUp);
if (LastPosParam.TargetBox.Equals(1))
{
InOutStoreLog("取料:升降轴上升到料门口高点[" + Config.UpdownAxis_P4 + "]");
InOutStoreLog("取料:BOX1 升降轴上升到料门口高点P4 [" + Config.UpdownAxis_P4 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed);
}
else
{
InOutStoreLog("取料:升降轴上升到料门口高点[" + Config.UpdownAxis_P6 + "]");
InOutStoreLog("取料:BOX2 升降轴上升到料门口高点P6 [" + Config.UpdownAxis_P6 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P6, Config.UpdownAxis_P6Speed);
}
}
else if (MoveInfo.IsStep(StoreMoveStep.LO_15_UpdownUp))
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_16_MiddleToP1);
InOutStoreLog("取料:旋转轴到料仓位置P1,");
InOutStoreLog("取料:旋转轴到料串位置P1 ["+Config.MiddleAxis_P1+"]");
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LO_16_MiddleToP1))
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_17_UpdownToP2);
InOutStoreLog("取料:升降轴到料串高点P2");
InOutStoreLog("取料:升降轴到料串高点P2 ["+ Config.UpdownAxis_P2 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P2, Config.UpdownAxis_P2Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LO_17_UpdownToP2))
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_18_UpdownDown);
InOutStoreLog("取料:升降轴到料串放料低点");
InOutStoreLog("取料:升降轴到料串放料低点P1 ["+ Config.UpdownAxis_P1 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LO_18_UpdownDown))
......@@ -381,7 +395,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StoreMoveStep.LO_31_BatchAxisToP1);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
InOutStoreLog("出库 :" + msg + "开始送出料架,提升伺服到P1点 ");
InOutStoreLog("出库 :" + msg + "开始送出料架,提升伺服到P1点 ["+ Config.BatchAxis_P1 + "] ");
UpdateShelfNum(CurrShelfNum, 0);
T1_BatchAxis.SuddenStop();
T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P2Speed);
......@@ -1115,5 +1129,36 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
#region MyRegion
internal bool BoxDoorFree(int id)
{
if (MoveInfo.MoveType.Equals(MoveType.InStore))
{
if (MoveInfo.MoveStep >= StoreMoveStep.LO_13_UpdownDown && MoveInfo.MoveStep <= StoreMoveStep.LO_16_MiddleToP1)
{
if (MoveInfo.MoveParam.TargetBox.Equals(id))
{
return false;
}
}
}else if (MoveInfo.MoveType.Equals(MoveType.OutStore))
{
if (MoveInfo.MoveStep >= StoreMoveStep.LI_23_UpdownDown && MoveInfo.MoveStep <= StoreMoveStep.LI_26_AxisToWait)
{
if (MoveInfo.MoveParam.TargetBox.Equals(id))
{
return false;
}
}
}
return true ;
}
#endregion
}
}
......@@ -69,32 +69,29 @@ namespace OnlineStore.DeviceLibrary
public string currTempStr = "";
internal void HumidityProcess(BoxBean box)
{
//try
//{
// if ((DateTime.Now - preLogTime).TotalSeconds > 10)
// {
// preLogTime = DateTime.Now;
// //用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
// //温湿度
// //ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
// HumitureParam param = QueryData();
// double humidity = 0;
// double temp = 0;
// if (param != null)
// {
// humidity = param.Humidity;
// temp = param.Temperate;
// currTempStr = Name + ("湿度:" + humidity.ToString() + ",温度:" + temp);
// }
// //double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
// double currMaxHumidity = param.Humidity;
// float startBlowHumidity = Max_Humidity - StartBlowValue;
// float stopBlowHumidity = Max_Humidity - StopBlowValue;
try
{
if ((DateTime.Now - preLogTime).TotalSeconds > 10)
{
preLogTime = DateTime.Now;
HumitureParam param = QueryData();
double humidity = 0;
double temp = 0;
if (param != null)
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr = Name + ("湿度:" + humidity.ToString() + ",温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
float stopBlowHumidity = Max_Humidity - StopBlowValue;
// //判断是否需要吹气
// if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
// {
////判断是否需要吹气
//if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
//{
// //判断是否距离上次结束指定的时间
// TimeSpan span = DateTime.Now - LastEndBlowTime;
// if (span.TotalMinutes > StoreManager.Config.BlowAir_Interval)
......@@ -106,17 +103,17 @@ namespace OnlineStore.DeviceLibrary
// LastBeginBlowTime = DateTime.Now;
// LastEndBlowTime = DateTime.Now;
// }
// }
//}
// if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
// {
//if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
//{
// LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",停止吹气湿度:" + stopBlowHumidity + ",停止吹气!");
// IsInBlowing = false;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
// }
// if (IsInBlowing)
// {
//}
//if (IsInBlowing)
//{
// //判断是否需要结束吹气
// TimeSpan span = DateTime.Now - LastBeginBlowTime;
// if (span.TotalMinutes > StoreManager.Config.BlowAir_Time)
......@@ -127,44 +124,42 @@ namespace OnlineStore.DeviceLibrary
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
// }
// }
// bool needAlarm = false;
// //如果开始吹气并且当前达到报警值
// if (IsInBlowing && humidity > Max_Humidity)
// {
// needAlarm = true;
// }
// else if (temp > Max_Temperature && Max_Temperature > 0)
// {
// LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
// needAlarm = true;
// //Thread.Sleep(100);
//}
bool needAlarm = false;
//如果开始吹气并且当前达到报警值
if (IsInBlowing && humidity > Max_Humidity)
{
needAlarm = true;
}
else if (temp > Max_Temperature && Max_Temperature > 0)
{
LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
needAlarm = true;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// }
// else if (temp < Max_Temperature)
// {
// if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
// {
// LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
// TempOrHumidityIsAlarm = false;
// //Thread.Sleep(100);
}
else if (temp < Max_Temperature)
{
if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
{
LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
TempOrHumidityIsAlarm = false;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// }
// }
// else
// {
// TempOrHumidityIsAlarm = false;
// }
// if (needAlarm)
// {
// HTAlarm();
// }
// }
//}
//catch (Exception ex)
//{
// LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
//}
}
}
else
{
TempOrHumidityIsAlarm = false;
}
if (needAlarm)
{
HTAlarm();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private void HTAlarm()
{
......
......@@ -75,9 +75,7 @@ namespace OnlineStore.DeviceLibrary
positionIndex = newIndex;
string posid = boxBean.PositionNumList[positionIndex];
InOutParam param = new InOutParam(MoveType.OutStore, "AutoOut", posid);
//param.NeedOutShelf = false;
//param.NeedEnterShelf = false;
InOutParam param = new InOutParam(MoveType.OutStore, "AutoOut", posid,1);
//判断是否需要重置
if (CurrInOutACount >= StoreManager.Config.Box_ResetACount)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!