Commit 3c91b77f LN

提升轴待机点验证修改

1 个父辈 7dc49e34
......@@ -367,7 +367,15 @@ namespace OnlineStore.AssemblyLine
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)
{
......
......@@ -336,7 +336,15 @@ namespace OnlineStore.AssemblyLine
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)
{
......
......@@ -428,7 +428,7 @@ namespace OnlineStore.DeviceLibrary
/// 升降盘定位气缸后退
/// </summary>
public void TrayLCylinderAfter(LineMoveInfo moveinfo = null)
{
{
if (TrayLCylinderCanAfter())
{
IOMove(IO_Type.SL_TrayLocation_After, IO_VALUE.HIGH);
......@@ -436,10 +436,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
WarnMsg = Name + "TrayLCylinderAfter:提升轴当前不在待机点P2,不后退定位气缸";
WarnMsg = Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸";
Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(Name + "TrayLCylinderAfter:提升轴当前不在待机点P2,不后退定位气缸");
LogUtil.error(Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸");
}
if (moveinfo != null)
{
......@@ -454,11 +453,11 @@ namespace OnlineStore.DeviceLibrary
{
int currP = BatchAxis.GetAclPosition();
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>
/// 升降盘是否在后退端
......
......@@ -427,8 +427,8 @@ namespace OnlineStore.DeviceLibrary
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
InLog("检测到料架, " + MoveInfo.MoveStep + " :升降盘定位气缸下降");
TrayLCylinderAfter(MoveInfo);
InLog("检测到料架, "+MoveInfo.MoveStep+" :升降盘定位气缸下降");
}
return true ;
}
......
......@@ -100,8 +100,8 @@ namespace OnlineStore.DeviceLibrary
if (IsTrayLCylinderAfter())
{
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
OutLog("准备出库料架, " + MoveInfo.SLog + " :升降盘定位气缸后退");
TrayLCylinderAfter(MoveInfo);
}
else
{
......
......@@ -14,17 +14,17 @@ namespace OnlineStore.DeviceLibrary
/// 流水线自动料仓-进仓装置类
/// </summary>
public partial class MoveEquip : EquipBase
{
{
public MoveEquip_Config Config;
public MoveEquip(string cid, MoveEquip_Config config)
{
this.DeviceID = config.Id;
this.Config = config;
baseConfig = config;
IsDebug = config.IsDebug.Equals(1);
Name = (" " + "_进仓_" + DeviceID.ToString().PadLeft(2,'0') + " ").ToUpper();
Name = (" " + "_进仓_" + DeviceID.ToString().PadLeft(2, '0') + " ").ToUpper();
Init();
......@@ -44,10 +44,10 @@ namespace OnlineStore.DeviceLibrary
Config.UpDown_Axis.ServerOnDO = IO_Type.UpDownAxis_ServoOn;
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))
{
......@@ -61,31 +61,31 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = false;
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
runStatus = LineRunStatus.HomeMoving;
SecondMoveInfo.EndMove();
runStatus = LineRunStatus.HomeMoving;
LogInfo("开始原点返回: 上下气缸回原点,阻挡1气缸上升 ");
MoveInfo.NewMove(LineMoveType.ReturnHome);
StartReset();
if ( isDebug)
if (isDebug)
{
mainTimer.Enabled = true;
}
return true;
}
public override bool Reset()
{
{
StopMove();
if (!RunAxis(true, UpdownAxis))
{
return false;
}
}
LogInfo("开始重置: 上下气缸回原点,阻挡1气缸上升 ");
runStatus = LineRunStatus.Reset;
SecondMoveInfo.EndMove();
MoveInfo.NewMove(LineMoveType.Reset);
MoveInfo.NewMove(LineMoveType.Reset);
StartReset();
return true;
}
......@@ -103,13 +103,13 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
}
else
{
{
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
}
isInPro = false;
}
protected override void ResetProcess()
{
if (MoveInfo.IsInWait)
......@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
{
case LineMoveStep.MH_UpDownHomeMove:
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
DebugInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始");
DebugInfo(MoveInfo.MoveType + " : (上下轴原点返回完成,上下轴走到待机点 )开始");
UpdownUpMove();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
......@@ -155,15 +155,15 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.Debugging;
}
else
{
{
lineStatus = LineStatus.StoreOnline;
}
break;
break;
default: break;
}
}
}
/// <summary>
/// 停止运动
/// </summary>
......@@ -181,16 +181,16 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.EndMove();
LogInfo("停止运动:上下气缸上升端,阻挡气缸上升 ,开始 ");
UpdownUpMove();
CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
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()
{
{
if (mainTimer != null)
{
mainTimer.Enabled = false;
......@@ -252,7 +252,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public void AddWaitOutInfo(InOutParam param)
{
{
//判断是否已经加入,不重复加
List<InOutParam> paramList = (from m in waitOutStoreList where m.PosId.Equals(param.PosId) select m).ToList<InOutParam>();
if (paramList.Count > 0)
......@@ -262,7 +262,30 @@ namespace OnlineStore.DeviceLibrary
else
{
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 上下气缸伺服运动
......@@ -271,7 +294,7 @@ namespace OnlineStore.DeviceLibrary
{
if (UseAxis)
{
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else
{
......@@ -320,3 +343,4 @@ namespace OnlineStore.DeviceLibrary
}
}
......@@ -266,5 +266,29 @@ namespace OnlineStore.DeviceLibrary
}
}
#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
/// <summary>
/// 可以误差的脉冲范围的最大值
/// </summary>
public int CanErrorCountMax = 500;
public int CanErrorCountMax = 1000;
/// <summary>
/// 出入库目标值(只有出入库过程中才会有效)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!