Commit a88261c6 LN

增加压紧轴复位的配置

1 个父辈 3479aa35
...@@ -265,7 +265,9 @@ namespace OnlineStore.ACSingleStore ...@@ -265,7 +265,9 @@ namespace OnlineStore.ACSingleStore
{ {
btnComMove.BackColor = System.Drawing.SystemColors.Control; btnComMove.BackColor = System.Drawing.SystemColors.Control;
ShuoKeControls.SuddownStop(compress_Slv); ShuoKeControls.SuddownStop(compress_Slv);
ShuoKeControls.GetABSPosition(compress_Slv); // ShuoKeControls.GetABSPosition(compress_Slv);
txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
} }
} }
private void btnComMovej_MouseDown(object sender, MouseEventArgs e) private void btnComMovej_MouseDown(object sender, MouseEventArgs e)
...@@ -288,7 +290,8 @@ namespace OnlineStore.ACSingleStore ...@@ -288,7 +290,8 @@ namespace OnlineStore.ACSingleStore
{ {
btnComMovej.BackColor = System.Drawing.SystemColors.Control; btnComMovej.BackColor = System.Drawing.SystemColors.Control;
ShuoKeControls.SuddownStop(compress_Slv); ShuoKeControls.SuddownStop(compress_Slv);
ShuoKeControls.GetABSPosition(compress_Slv); // ShuoKeControls.GetABSPosition(compress_Slv);
txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
} }
} }
...@@ -310,14 +313,19 @@ namespace OnlineStore.ACSingleStore ...@@ -310,14 +313,19 @@ namespace OnlineStore.ACSingleStore
UpdateMiddlePosition(); UpdateMiddlePosition();
UpdateInOutPosition(); UpdateInOutPosition();
UpdateUpdownPosition(); UpdateUpdownPosition();
ShuoKeInfo info = ShuoKeControls.GetLastPosition(compress_Slv);
txtComPosition.Text = info.LastPosition.ToString(); txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
TimeSpan span = DateTime.Now - info.UpdateTime;
if (span.TotalSeconds > 1.5) //ShuoKeInfo info = ShuoKeControls.GetLastPosition(compress_Slv);
{ //if (info != null)
ShuoKeControls.GetABSPosition(compress_Slv); //{
} // txtComPosition.Text = info.LastPosition.ToString();
// TimeSpan span = DateTime.Now - info.UpdateTime;
// if (span.TotalSeconds > 1.5)
// {
// ShuoKeControls.GetABSPosition(compress_Slv);
// }
//}
} }
} }
......
...@@ -82,4 +82,8 @@ bug修改:压紧轴点动时实时坐标更新。 ...@@ -82,4 +82,8 @@ bug修改:压紧轴点动时实时坐标更新。
增加Y15 允许放料信号 增加Y15 允许放料信号
\ No newline at end of file \ No newline at end of file
20190830:
增加压紧轴复位的配置。
StoreConfig.csv增加:
PRO,出入库多少次自动复位压紧轴,Box_ResetCCount,3,,,,,,,
\ No newline at end of file \ No newline at end of file
...@@ -68,11 +68,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -68,11 +68,14 @@ namespace OnlineStore.DeviceLibrary
MBmaster.OnException += new AITcpClient.ExceptionData(MBmaster_OnException); MBmaster.OnException += new AITcpClient.ExceptionData(MBmaster_OnException);
MBmaster.autoConnectOfBreak = false; MBmaster.autoConnectOfBreak = false;
mastMap.Add(ioIp, MBmaster); mastMap.Add(ioIp, MBmaster);
LogUtil.info(LOGGER, "连接AI模块[" + ioIp + "]成功"); if (MBmaster.ISConnection())
Thread.Sleep(10); {
WriteAIScope(ioIp, 1); LogUtil.info(LOGGER, "连接AI模块[" + ioIp + "]成功");
Thread.Sleep(10); Thread.Sleep(10);
ReadAll(ioIp); WriteAIScope(ioIp, 1);
Thread.Sleep(10);
ReadAll(ioIp);
}
} }
catch (Exception error) catch (Exception error)
{ {
......
...@@ -91,6 +91,7 @@ PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,, ...@@ -91,6 +91,7 @@ PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,, PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,, PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,, PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,出入库多少次自动复位压紧轴,Box_ResetCCount,3,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,, PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, , PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,, PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
......
...@@ -223,6 +223,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -223,6 +223,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = ""; WarnMsg = "";
CurrInOutACount = 0; CurrInOutACount = 0;
CurrInOutCount = 0; CurrInOutCount = 0;
CurrInOutCCount = 0;
KNDIOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); KNDIOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
KNDIOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW); KNDIOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
...@@ -277,6 +278,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -277,6 +278,7 @@ namespace OnlineStore.DeviceLibrary
{ {
CurrInOutCount = 0; CurrInOutCount = 0;
CurrInOutACount = 0; CurrInOutACount = 0;
CurrInOutCCount = 0;
KNDIOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); KNDIOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
......
...@@ -38,6 +38,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -38,6 +38,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
private int CurrInOutCount = 0; private int CurrInOutCount = 0;
private int CurrInOutACount = 0; private int CurrInOutACount = 0;
private int CurrInOutCCount = 0;
private bool LoadParamPosition(InOutStoreParam param) private bool LoadParamPosition(InOutStoreParam param)
{ {
...@@ -101,7 +102,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,7 +102,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
ACAxisMove(Config.InOut_Axis, InOut_P1, Config.InOutAxis_P1_Speed); ACAxisMove(Config.InOut_Axis, InOut_P1, Config.InOutAxis_P1_Speed);
} }
//StoreMove.WaitList.Add(WaitResultInfo.WaitAxisOrg(Config.InOut_Axis,IO_VALUE.HIGH)); //StoreMove.WaitList.Add(WaitResultInfo.WaitAxisOrg(Config.InOut_Axis,IO_VALUE.HIGH));
} }
...@@ -316,10 +317,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -316,10 +317,14 @@ namespace OnlineStore.DeviceLibrary
} }
private void SI_02_Move(LineMoveP moveP) private void SI_02_Move(LineMoveP moveP)
{ {
InStoreLog("入库:SI_02_ 进出轴(叉子)动作至P1,打开舱门"); InStoreLog("入库:SI_02_ 进出轴(叉子)动作至P1,打开舱门,已出入库次数:"+ CurrInOutCCount);
StoreMove.NextMoveStep(StoreMoveStep.SI_02_InOutAxisHome); StoreMove.NextMoveStep(StoreMoveStep.SI_02_InOutAxisHome);
OpenDoorAndWait(); OpenDoorAndWait();
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
if (Config.Box_ResetCCount < CurrInOutCCount && IsHasCompress_Axis)
{
ComBeforeHomeMove();
}
} }
private void SI_05_DeviceToDoor() private void SI_05_DeviceToDoor()
{ {
...@@ -358,14 +363,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -358,14 +363,27 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_02_InOutAxisHome) else if (StoreMove.MoveStep == StoreMoveStep.SI_02_InOutAxisHome)
{ {
if (Config.Box_ResetCCount < CurrInOutCCount && IsHasCompress_Axis)
{
StoreMove.NextMoveStep(StoreMoveStep.SI_021_CompAxisHome);
OutStoreLog("出库:SI_021 已出入库" + CurrInOutCCount + "次,压紧轴需要原点返回");
CurrInOutCCount = 0;
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, 0, true));
ShuoKeControls.HomeMove(Config.CompressAxis_Slv, 1);
}
else
{
InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1,,轴4动作至P3");
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
ComMoveToPosition(moveP.ComPress_P3);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
}else if (StoreMove.MoveStep == StoreMoveStep.SI_021_CompAxisHome)
{
InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1,,轴4动作至P3"); InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1,,轴4动作至P3");
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome); StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
ComMoveToPosition(moveP.ComPress_P3); ComMoveToPosition(moveP.ComPress_P3);
//if (IsHasCompress_Axis)
//{
// ShuoKeControls.AbsMove(Config.CompressAxis_Slv, moveP.ComPress_P3);
// StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, moveP.ComPress_P3, false));
//}
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
} }
...@@ -559,10 +577,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -559,10 +577,14 @@ namespace OnlineStore.DeviceLibrary
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0)) if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_02_DeviceBack); StoreMove.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
OutStoreLog("出库:SO_02 叉子先运动到P1 ,打开舱门 开始"); OutStoreLog("出库:SO_02 叉子先运动到P1 ,打开舱门 ,已出入库次数:"+CurrInOutCCount);
//ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed); //ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1); InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1);
if (Config.Box_ResetCCount < CurrInOutCCount && IsHasCompress_Axis)
{
ComBeforeHomeMove();
}
//OpenDoorAndWait(); //OpenDoorAndWait();
} }
else else
...@@ -593,14 +615,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -593,14 +615,37 @@ namespace OnlineStore.DeviceLibrary
if (StoreMove.MoveStep == StoreMoveStep.SO_01_LocationCylinderDown) if (StoreMove.MoveStep == StoreMoveStep.SO_01_LocationCylinderDown)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_02_DeviceBack); StoreMove.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
OutStoreLog("出库:SO_02 叉子先运动到P1 "); OutStoreLog("出库:SO_02 叉子先运动到P1,已出入库次数:"+CurrInOutCCount);
InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1); InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1);
if (Config.Box_ResetCCount < CurrInOutCCount && IsHasCompress_Axis)
{
ComBeforeHomeMove();
}
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_02_DeviceBack) else if (StoreMove.MoveStep == StoreMoveStep.SO_02_DeviceBack)
{ {
if (Config.Box_ResetCCount < CurrInOutCCount && IsHasCompress_Axis)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_021_CompAxisHome);
OutStoreLog("出库:SO_021 已出入库" + CurrInOutCCount + "次,压紧轴需要原点返回");
CurrInOutCCount = 0;
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, 0, true));
ShuoKeControls.HomeMove(Config.CompressAxis_Slv, 1);
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition);
OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
ComMoveToPosition(moveP.ComPress_P3);
ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
}
}else if (StoreMove.MoveStep == StoreMoveStep.SO_021_CompAxisHome)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition); StoreMove.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition);
OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)"); OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
ComMoveToPosition(moveP.ComPress_P3); ComMoveToPosition(moveP.ComPress_P3);
ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed); ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed); ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
} }
...@@ -841,6 +886,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -841,6 +886,7 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
CurrInOutCCount++;
CurrInOutCount++; CurrInOutCount++;
CurrInOutACount++; CurrInOutACount++;
//是否自动进入出库状态 //是否自动进入出库状态
...@@ -850,7 +896,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -850,7 +896,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (storeMoveType.Equals(StoreMoveType.InStore)) if (storeMoveType.Equals(StoreMoveType.InStore))
{ {
int newIndex = autoPositionIndex; int newIndex = autoPositionIndex;
if (newIndex < 0) if (newIndex < 0)
{ {
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count) if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
...@@ -869,12 +915,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -869,12 +915,12 @@ namespace OnlineStore.DeviceLibrary
{ {
autoPositionIndex = newIndex; autoPositionIndex = newIndex;
string posid = PositionNumList[autoPositionIndex]; string posid = PositionNumList[autoPositionIndex];
StartNewOut(posid); StartNewOut(posid);
} }
} }
else if (storeMoveType.Equals(StoreMoveType.OutStore)) else if (storeMoveType.Equals(StoreMoveType.OutStore))
{ {
int newIndex = autoPositionIndex - autoJiange; int newIndex = autoPositionIndex - autoJiange;
if (newIndex < 0) if (newIndex < 0)
{ {
...@@ -896,13 +942,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -896,13 +942,14 @@ namespace OnlineStore.DeviceLibrary
if (AutoOnlyOut) if (AutoOnlyOut)
{ {
StartNewOut(posid); StartNewOut(posid);
}else }
else
{ {
LogUtil.info(LOGGER, StoreName + "自动入库:posid=" + posid); LogUtil.info(LOGGER, StoreName + "自动入库:posid=" + posid);
autoMsg = "自动入库:" + posid; autoMsg = "自动入库:" + posid;
StartInStoreMove(new InOutStoreParam("AAAA", posid)); StartInStoreMove(new InOutStoreParam("AAAA", posid));
} }
} }
} }
} }
......
...@@ -219,6 +219,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -219,6 +219,10 @@ namespace OnlineStore.DeviceLibrary
///料仓出库:叉子先运动到P1 ///料仓出库:叉子先运动到P1
/// </summary> /// </summary>
SO_02_DeviceBack = 102, SO_02_DeviceBack = 102,
/// <summary>
/// 料仓出库,,压紧轴原点返回
/// </summary>
SO_021_CompAxisHome = 120,
/// <summary> /// <summary>
/// 料仓出库,,所有轴运行到库位, 轴4( 压紧) 至P3(压紧前点) ,轴1( 转盘) 至P2( 库位点),轴2(上下) 至P5(库位出库前点) /// 料仓出库,,所有轴运行到库位, 轴4( 压紧) 至P3(压紧前点) ,轴1( 转盘) 至P2( 库位点),轴2(上下) 至P5(库位出库前点)
...@@ -302,6 +306,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -302,6 +306,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SI_02_InOutAxisHome = 202, SI_02_InOutAxisHome = 202,
/// <summary> /// <summary>
/// 入库。。压紧轴原点返回
/// </summary>
SI_021_CompAxisHome=220,
/// <summary>
/// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3 /// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
/// </summary> /// </summary>
SI_03_ReturnHome = 203, SI_03_ReturnHome = 203,
......
...@@ -289,7 +289,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -289,7 +289,12 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("Box_ResetACount")] [ConfigProAttribute("Box_ResetACount")]
public int Box_ResetACount { get; set; } public int Box_ResetACount { get; set; }
/// <summary>
/// PRO,出入库多少次自动复位压紧轴,Box_ResetCCount,1000,,,,,,,
/// </summary>
[ConfigProAttribute("Box_ResetCCount")]
public int Box_ResetCCount { get; set; }
/// <summary> /// <summary>
/// PRO IO信号超时时间(毫秒) IOSingle_TimerOut 5000 /// PRO IO信号超时时间(毫秒) IOSingle_TimerOut 5000
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!