Commit fb400ac6 LN

批量上料轴上升改为绝对运动

1 个父辈 692849d3
...@@ -14,7 +14,7 @@ namespace OnlineStore.Common ...@@ -14,7 +14,7 @@ namespace OnlineStore.Common
private static LogUtil instance = new LogUtil(); private static LogUtil instance = new LogUtil();
public delegate void ShowLog(string msg, Color color); public delegate void ShowLog(string msg, Color color);
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static readonly ILog AIOLog = LogManager.GetLogger("AIOBOXLog"); // public static readonly ILog AIOLog = LogManager.GetLogger("AIOBOX");
public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>(); public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null; public static System.Windows.Forms.RichTextBox logBox = null;
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.IOModule.AIOBOX"> <Reference Include="Asa.IOModule.AIOBOX, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath> <HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference> </Reference>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary">
......
...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary
{ {
checkTimer = new System.Timers.Timer(); checkTimer = new System.Timers.Timer();
checkTimer.AutoReset = true; checkTimer.AutoReset = true;
checkTimer.Interval += 20; checkTimer.Interval += 30;
checkTimer.Elapsed += CheckTimer_Elapsed; checkTimer.Elapsed += CheckTimer_Elapsed;
checkTimer.Enabled = false; checkTimer.Enabled = false;
} }
...@@ -53,11 +53,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -53,11 +53,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("批量上料轴,检测到 " + TargetIoType + "="+TargetIoValue+",可以停止运动"); LogUtil.info("批量上料轴,检测到 " + TargetIoType + "="+TargetIoValue+",可以停止运动");
result = true; result = true;
} }
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH)) //else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
{ //{
LogUtil.info("批量上料轴,检测到正极限信号,可以停止运动"); // LogUtil.info("批量上料轴,检测到正极限信号,可以停止运动");
result = true; // result = true;
} //}
if (result) if (result)
{ {
//AutoAxisIsMove = 0; //AutoAxisIsMove = 0;
......
...@@ -148,7 +148,6 @@ PRO,温湿度端口号,Humiture_Port,COM2,,,,,,, ...@@ -148,7 +148,6 @@ PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,800,,,,,,, PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,800,,,,,,,
PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,80,,,,,,,
PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,300,,,,,,, PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,300,,,,,,,
PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,300,,,,,,, PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,300,,,,,,,
PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20,,,,,,, PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20,,,,,,,
...@@ -156,12 +155,14 @@ PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,60,,,,,,, ...@@ -156,12 +155,14 @@ PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,2000,,,,,, , PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,2000,,,,,, ,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,1700000,,,,,, , PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,1700000,,,,,, ,
PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,30000,,,,,,, PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,30000,,,,,,,
PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,2000,,,,,,, PRO,(轴五)上料轴P3点(上料目标位置),BatchAxis_P3,1700000,,,,,,,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10,,,,,,, PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10,,,,,,,
PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,, PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,, PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,, PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,2000,,,,,,, PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,2000,,,,,,,
PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,2000,,,,,,,
PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,80,,,,,,,
PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,30000,,,,,,, PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,30000,,,,,,,
PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,150000,,,,,,, PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,150000,,,,,,,
PRO,(轴五)上料轴最最大料盘高度mm,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,, PRO,(轴五)上料轴最最大料盘高度mm,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,,
......
...@@ -208,16 +208,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,16 +208,16 @@ namespace OnlineStore.DeviceLibrary
{ {
wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait, span); wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait, span);
} }
if (!wait.IsEnd) //if (!wait.IsEnd)
{ //{
bool MoveEnd = ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0); // bool MoveEnd = ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0);
int outCount = ACServerManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); // int outCount = ACServerManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
int errorCount = Math.Abs(outCount - wait.TargetPosition); // int errorCount = Math.Abs(outCount - wait.TargetPosition);
if (MoveEnd && errorCount < wait.AxisInfo.CanErrorCountMax) // if (MoveEnd && errorCount < wait.AxisInfo.CanErrorCountMax)
{ // {
wait.IsEnd = true; // wait.IsEnd = true;
} // }
} //}
if (wait.IsEnd) if (wait.IsEnd)
{ {
BatchAxisController.StopCheck(); BatchAxisController.StopCheck();
......
...@@ -15,15 +15,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,15 +15,15 @@ namespace OnlineStore.DeviceLibrary
private static int StartMovePosition = 0; private static int StartMovePosition = 0;
private static int EndMovePosition = 0; private static int EndMovePosition = 0;
//public static int AutoAxisIsMove = 0; //public static int AutoAxisIsMove = 0;
private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, int targetSpeed,string targetSingle) private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis,int targetPosition, int targetSpeed,string targetSingle)
{ {
//AutoAxisIsMove = 1; //AutoAxisIsMove = 1;
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue()); StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
EndMovePosition = StartMovePosition; EndMovePosition = StartMovePosition;
LogUtil.debug("当前坐标:"+StartMovePosition+",批量上料轴开始匀速"+targetSpeed+"上升"); LogUtil.debug("当前坐标:"+StartMovePosition+",批量上料轴开始匀速"+targetSpeed+"上升");
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis,0, targetSingle)); StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis,targetPosition, targetSingle));
BatchAxisController.StartCheck(targetSingle); BatchAxisController.StartCheck(targetSingle);
ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition,targetSpeed);
} }
private static void ACAxisAbsMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed) private static void ACAxisAbsMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
...@@ -58,8 +58,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -58,8 +58,8 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
// msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; // msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
SetWarnMsgAndLog(ResourceControl.AxisHomeMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), outCount + ""); SetWarnMsgAndLog(ResourceControl.AxisHomeMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), outCount + "");
msg = WarnObj.WarnMsg; msg = WarnObj.WarnMsg;
LogUtil.error(msg, 100); LogUtil.error(msg, 100);
...@@ -67,10 +67,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -67,10 +67,11 @@ namespace OnlineStore.DeviceLibrary
} }
} }
return true; return true;
}else if ( IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH)) }
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
{ {
LogUtil.error("批量轴原点返回时BatchAxis_Limit=High ,停止运动",30); LogUtil.error("批量轴原点返回时BatchAxis_Limit=High ,停止运动", 30);
ACServerManager.SuddenStop(StoreManager.Config.Batch_Axis); ACServerManager.SuddenStop(StoreManager.Config.Batch_Axis);
} }
return false; return false;
} }
...@@ -281,22 +282,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -281,22 +282,26 @@ namespace OnlineStore.DeviceLibrary
bool result = false; bool result = false;
if (IOManager.IOValue(wait.IoType).Equals(wait.IoValue)) if (IOManager.IOValue(wait.IoType).Equals(wait.IoValue))
{ {
LogUtil.debug(wait.ToStr() + " 检测到 " + wait.IoType + "="+wait.IoValue+",可以停止运动"); LogUtil.debug(wait.ToStr() + " 检测到 " + wait.IoType + "=" + wait.IoValue + ",可以停止运动");
result = true;
}
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
{
LogUtil.debug(wait.ToStr() + " 检测到正极限信号,可以停止运动");
result = true; result = true;
} }
//else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
//{
// LogUtil.debug(wait.ToStr() + " 检测到正极限信号,可以停止运动");
// result = true;
//}
else if (wait.TargetPosition > 0) else if (wait.TargetPosition > 0)
{ {
bool MoveEnd = ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0); bool MoveEnd = ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0);
int outCount = ACServerManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
int errorCount = Math.Abs(outCount - wait.TargetPosition); if (MoveEnd)
if (MoveEnd && (errorCount < wait.AxisInfo.CanErrorCountMax))
{ {
result = true; int outCount = ACServerManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
int errorCount = Math.Abs(outCount - wait.TargetPosition);
if ((errorCount < wait.AxisInfo.CanErrorCountMax))
{
result = true;
}
} }
} }
if (result) if (result)
......
...@@ -706,6 +706,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -706,6 +706,12 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("BatchAxis_DownPosition2", false)] [ConfigProAttribute("BatchAxis_DownPosition2", false)]
public int BatchAxis_DownPosition2 { get; set; } public int BatchAxis_DownPosition2 { get; set; }
/// <summary>
/// PRO,(轴五) 上料轴P3点(上料目标位置),BatchAxis_P3,1700000,,,,,,,
/// </summary>
[ConfigProAttribute("BatchAxis_P3", false)]
public int BatchAxis_P3 { get; set; }
private Dictionary<string, string> CodeSizeMap = null; private Dictionary<string, string> CodeSizeMap = null;
private static char codeSpilt = '#'; private static char codeSpilt = '#';
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!