Commit 3c91b77f LN

提升轴待机点验证修改

1 个父辈 7dc49e34
...@@ -367,7 +367,15 @@ namespace OnlineStore.AssemblyLine ...@@ -367,7 +367,15 @@ namespace OnlineStore.AssemblyLine
private void btnBeforeAfterBefore_Click(object sender, EventArgs e) private void btnBeforeAfterBefore_Click(object sender, EventArgs e)
{ {
BtnMove(btnBeforeAfterBefore, "横移前进", "横移后退", IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before); if (equipBean.CanBeforeAfter())
{
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)
{ {
......
...@@ -336,7 +336,15 @@ namespace OnlineStore.AssemblyLine ...@@ -336,7 +336,15 @@ namespace OnlineStore.AssemblyLine
private void btnBeforeAfterBefore_Click(object sender, EventArgs e) private void btnBeforeAfterBefore_Click(object sender, EventArgs e)
{ {
BtnMove(btnBeforeAfterBefore, "横移前进", "横移后退", IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before); if (equipBean.CanBeforeAfter())
{
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)
{ {
......
...@@ -428,7 +428,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -428,7 +428,7 @@ namespace OnlineStore.DeviceLibrary
/// 升降盘定位气缸后退 /// 升降盘定位气缸后退
/// </summary> /// </summary>
public void TrayLCylinderAfter(LineMoveInfo moveinfo = null) public void TrayLCylinderAfter(LineMoveInfo moveinfo = null)
{ {
if (TrayLCylinderCanAfter()) if (TrayLCylinderCanAfter())
{ {
IOMove(IO_Type.SL_TrayLocation_After, IO_VALUE.HIGH); IOMove(IO_Type.SL_TrayLocation_After, IO_VALUE.HIGH);
...@@ -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
{ {
......
...@@ -14,17 +14,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -14,17 +14,17 @@ namespace OnlineStore.DeviceLibrary
/// 流水线自动料仓-进仓装置类 /// 流水线自动料仓-进仓装置类
/// </summary> /// </summary>
public partial class MoveEquip : EquipBase public partial class MoveEquip : EquipBase
{ {
public MoveEquip_Config Config; public MoveEquip_Config Config;
public MoveEquip(string cid, MoveEquip_Config config) public MoveEquip(string cid, MoveEquip_Config config)
{ {
this.DeviceID = config.Id; this.DeviceID = config.Id;
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))
{ {
...@@ -61,31 +61,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -61,31 +61,31 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = false; mainTimer.Enabled = false;
MoveInfo.EndMove(); MoveInfo.EndMove();
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
runStatus = LineRunStatus.HomeMoving; runStatus = LineRunStatus.HomeMoving;
LogInfo("开始原点返回: 上下气缸回原点,阻挡1气缸上升 "); LogInfo("开始原点返回: 上下气缸回原点,阻挡1气缸上升 ");
MoveInfo.NewMove(LineMoveType.ReturnHome); MoveInfo.NewMove(LineMoveType.ReturnHome);
StartReset(); StartReset();
if ( isDebug) if (isDebug)
{ {
mainTimer.Enabled = true; mainTimer.Enabled = true;
} }
return true; return true;
} }
public override bool Reset() public override bool Reset()
{ {
StopMove(); StopMove();
if (!RunAxis(true, UpdownAxis)) if (!RunAxis(true, UpdownAxis))
{ {
return false; return false;
} }
LogInfo("开始重置: 上下气缸回原点,阻挡1气缸上升 "); LogInfo("开始重置: 上下气缸回原点,阻挡1气缸上升 ");
runStatus = LineRunStatus.Reset; runStatus = LineRunStatus.Reset;
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
MoveInfo.NewMove(LineMoveType.Reset); MoveInfo.NewMove(LineMoveType.Reset);
StartReset(); StartReset();
return true; return true;
} }
...@@ -103,13 +103,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,13 +103,13 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
} }
else else
{ {
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
} }
isInPro = false; isInPro = false;
} }
protected override void ResetProcess() protected override void ResetProcess()
{ {
if (MoveInfo.IsInWait) if (MoveInfo.IsInWait)
...@@ -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;
...@@ -155,15 +155,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -155,15 +155,15 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.Debugging; lineStatus = LineStatus.Debugging;
} }
else else
{ {
lineStatus = LineStatus.StoreOnline; lineStatus = LineStatus.StoreOnline;
} }
break; break;
default: break; default: break;
} }
} }
} }
/// <summary> /// <summary>
/// 停止运动 /// 停止运动
/// </summary> /// </summary>
...@@ -181,16 +181,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -181,16 +181,16 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
LogInfo("停止运动:上下气缸上升端,阻挡气缸上升 ,开始 "); LogInfo("停止运动:上下气缸上升端,阻挡气缸上升 ,开始 ");
UpdownUpMove(); UpdownUpMove();
CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW); IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
} }
public override void StopRun() public override void StopRun()
{ {
if (mainTimer != null) if (mainTimer != null)
{ {
mainTimer.Enabled = false; mainTimer.Enabled = false;
...@@ -252,7 +252,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -252,7 +252,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public void AddWaitOutInfo(InOutParam param) public void AddWaitOutInfo(InOutParam param)
{ {
//判断是否已经加入,不重复加 //判断是否已经加入,不重复加
List<InOutParam> paramList = (from m in waitOutStoreList where m.PosId.Equals(param.PosId) select m).ToList<InOutParam>(); List<InOutParam> paramList = (from m in waitOutStoreList where m.PosId.Equals(param.PosId) select m).ToList<InOutParam>();
if (paramList.Count > 0) if (paramList.Count > 0)
...@@ -262,7 +262,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -262,7 +262,30 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
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 上下气缸伺服运动
...@@ -271,7 +294,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -271,7 +294,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (UseAxis) if (UseAxis)
{ {
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
} }
else else
{ {
...@@ -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!