Commit 3c91b77f LN

提升轴待机点验证修改

1 个父辈 7dc49e34
...@@ -367,8 +367,16 @@ namespace OnlineStore.AssemblyLine ...@@ -367,8 +367,16 @@ namespace OnlineStore.AssemblyLine
private void btnBeforeAfterBefore_Click(object sender, EventArgs e) private void btnBeforeAfterBefore_Click(object sender, EventArgs e)
{ {
if (equipBean.CanBeforeAfter())
{
BtnMove(btnBeforeAfterBefore, "横移前进", "横移后退", IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before); BtnMove(btnBeforeAfterBefore, "横移前进", "横移后退", IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
} }
else
{
MessageBox.Show("升降气缸不在上升端 或 升降轴不在待机点P1", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnUpDownUp_Click(object sender, EventArgs e) private void btnUpDownUp_Click(object sender, EventArgs e)
{ {
BtnMove(btnUpDownUp, "升降上升", "升降下降", IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up); BtnMove(btnUpDownUp, "升降上升", "升降下降", IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
......
...@@ -336,8 +336,16 @@ namespace OnlineStore.AssemblyLine ...@@ -336,8 +336,16 @@ namespace OnlineStore.AssemblyLine
private void btnBeforeAfterBefore_Click(object sender, EventArgs e) private void btnBeforeAfterBefore_Click(object sender, EventArgs e)
{ {
if (equipBean.CanBeforeAfter())
{
BtnMove(btnBeforeAfterBefore, "横移前进", "横移后退", IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before); BtnMove(btnBeforeAfterBefore, "横移前进", "横移后退", IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
} }
else
{
MessageBox.Show("升降气缸不在上升端 或 升降轴不在待机点P1", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnUpDownUp_Click(object sender, EventArgs e) private void btnUpDownUp_Click(object sender, EventArgs e)
{ {
BtnMove(btnUpDownUp, "升降上升", "升降下降", IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up); BtnMove(btnUpDownUp, "升降上升", "升降下降", IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
......
...@@ -436,10 +436,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -436,10 +436,9 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
WarnMsg = Name + "TrayLCylinderAfter:提升轴当前不在待机点P2,不后退定位气缸"; WarnMsg = Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸";
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(Name + "TrayLCylinderAfter:提升轴当前不在待机点P2,不后退定位气缸"); LogUtil.error(Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸");
} }
if (moveinfo != null) if (moveinfo != null)
{ {
...@@ -454,11 +453,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -454,11 +453,11 @@ namespace OnlineStore.DeviceLibrary
{ {
int currP = BatchAxis.GetAclPosition(); int currP = BatchAxis.GetAclPosition();
int chaz = Config.BatchAxisP2 - currP; int chaz = Config.BatchAxisP2 - currP;
if ((Math.Abs(chaz) < Config.Height_ChangeValue * 2)) if ((Math.Abs(chaz) < Math.Abs(Config.Height_ChangeValue * 2)))
{ {
return true ; return true;
} }
return false ; return false;
} }
/// <summary> /// <summary>
/// 升降盘是否在后退端 /// 升降盘是否在后退端
......
...@@ -427,8 +427,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -427,8 +427,8 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After); MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
InLog("检测到料架, " + MoveInfo.MoveStep + " :升降盘定位气缸下降");
TrayLCylinderAfter(MoveInfo); TrayLCylinderAfter(MoveInfo);
InLog("检测到料架, "+MoveInfo.MoveStep+" :升降盘定位气缸下降");
} }
return true ; return true ;
} }
......
...@@ -100,8 +100,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -100,8 +100,8 @@ namespace OnlineStore.DeviceLibrary
if (IsTrayLCylinderAfter()) if (IsTrayLCylinderAfter())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After); MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
OutLog("准备出库料架, " + MoveInfo.SLog + " :升降盘定位气缸后退"); OutLog("准备出库料架, " + MoveInfo.SLog + " :升降盘定位气缸后退");
TrayLCylinderAfter(MoveInfo);
} }
else else
{ {
......
...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary
this.Config = config; this.Config = config;
baseConfig = config; baseConfig = config;
IsDebug = config.IsDebug.Equals(1); IsDebug = config.IsDebug.Equals(1);
Name = (" " + "_进仓_" + DeviceID.ToString().PadLeft(2,'0') + " ").ToUpper(); Name = (" " + "_进仓_" + DeviceID.ToString().PadLeft(2, '0') + " ").ToUpper();
Init(); Init();
...@@ -44,10 +44,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,10 +44,10 @@ namespace OnlineStore.DeviceLibrary
Config.UpDown_Axis.ServerOnDO = IO_Type.UpDownAxis_ServoOn; Config.UpDown_Axis.ServerOnDO = IO_Type.UpDownAxis_ServoOn;
Config.UpDown_Axis.BreakOnDO = IO_Type.UpDownAxis_BreakOn; Config.UpDown_Axis.BreakOnDO = IO_Type.UpDownAxis_BreakOn;
} }
UpdownAxis=new AxisBean (config.UpDown_Axis,Name); UpdownAxis = new AxisBean(config.UpDown_Axis, Name);
} }
public override bool StartRun(bool isDebug=false) public override bool StartRun(bool isDebug = false)
{ {
if (CanStartRun().Equals(false)) if (CanStartRun().Equals(false))
{ {
...@@ -66,7 +66,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,7 +66,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("开始原点返回: 上下气缸回原点,阻挡1气缸上升 "); LogInfo("开始原点返回: 上下气缸回原点,阻挡1气缸上升 ");
MoveInfo.NewMove(LineMoveType.ReturnHome); MoveInfo.NewMove(LineMoveType.ReturnHome);
StartReset(); StartReset();
if ( isDebug) if (isDebug)
{ {
mainTimer.Enabled = true; mainTimer.Enabled = true;
} }
...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
{ {
case LineMoveStep.MH_UpDownHomeMove: case LineMoveStep.MH_UpDownHomeMove:
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
DebugInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始"); DebugInfo(MoveInfo.MoveType + " : (上下轴原点返回完成,上下轴走到待机点 )开始");
UpdownUpMove(); UpdownUpMove();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break; break;
...@@ -264,6 +264,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -264,6 +264,29 @@ namespace OnlineStore.DeviceLibrary
waitOutStoreList.Enqueue(param); waitOutStoreList.Enqueue(param);
} }
} }
/// <summary>
/// 判断上料横移机构是否可以横移运动
/// </summary>
/// <returns></returns>
public bool CanBeforeAfter()
{
if (UseAxis)
{
int currPosition = UpdownAxis.GetAclPosition() - Config.UpDownAxisP1;
if (Math.Abs(currPosition) < Math.Abs(Config.UpDown_Axis.CanErrorCountMax * 10))
{
return true;
}
}
else
{
if (IOValue(IO_Type.UpDownCylinder_Down).Equals(IO_VALUE.LOW) && IOValue(IO_Type.UpDownCylinder_Up).Equals(IO_VALUE.HIGH))
{
return true;
}
}
return false;
}
#region 上下气缸伺服运动 #region 上下气缸伺服运动
...@@ -320,3 +343,4 @@ namespace OnlineStore.DeviceLibrary ...@@ -320,3 +343,4 @@ namespace OnlineStore.DeviceLibrary
} }
} }
...@@ -266,5 +266,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -266,5 +266,29 @@ namespace OnlineStore.DeviceLibrary
} }
} }
#endregion #endregion
/// <summary>
/// 判断上料横移机构是否可以横移运动
/// </summary>
/// <returns></returns>
public bool CanBeforeAfter()
{
if (UseAxis)
{
int currPosition = UpdownAxis.GetAclPosition() - Config.UpDownAxisP1;
if (Math.Abs(currPosition) < Math.Abs(Config.UpDown_Axis.CanErrorCountMax * 10))
{
return true;
}
}
else
{
if (IOValue(IO_Type.UpDownCylinder_Down).Equals(IO_VALUE.LOW) && IOValue(IO_Type.UpDownCylinder_Up).Equals(IO_VALUE.HIGH))
{
return true;
}
}
return false;
}
} }
} }
...@@ -106,7 +106,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -106,7 +106,7 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary> /// <summary>
/// 可以误差的脉冲范围的最大值 /// 可以误差的脉冲范围的最大值
/// </summary> /// </summary>
public int CanErrorCountMax = 500; public int CanErrorCountMax = 1000;
/// <summary> /// <summary>
/// 出入库目标值(只有出入库过程中才会有效) /// 出入库目标值(只有出入库过程中才会有效)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!