Commit 5338ca7a 几米阳光

拿走料盘的过程中增加出库处理。

1 个父辈 35b5eb93
...@@ -10,22 +10,22 @@ ...@@ -10,22 +10,22 @@
<add key="Server_Log_Open" value="0" /> <add key="Server_Log_Open" value="0" />
<add key="scanner_start_command" value="S" /> <add key="scanner_start_command" value="S" />
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)--> <!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="4" /> <add key="StartBlowValue" value="0.5" />
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)--> <!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<add key="StopBlowValue" value="4" /> <add key="StopBlowValue" value="1" />
<!--Server address--> <!--Server address-->
<add key="http.server" value="" /> <!--<add key="http.server" value="" />-->
<!--<add key="http.server" value="http://192.168.1.187/myproject/" /> --> <add key="http.server" value="http://localhost/myproject/" />
<!--storeType--> <!--storeType-->
<add key="store_count" value="1" /> <add key="store_count" value="1" />
<!--start one store config--> <!--start one store config-->
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv" /> <add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv" />
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv" /> <add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv" />
<add key="Store_Type" value="AUTO_SA_Config" /> <add key="Store_Type" value="AUTO_SA_Config" />
<add key="Store_CID" value="nanrui1" /> <add key="Store_CID" value="auto1" />
<!--end one store config--> <!--end one store config-->
<!--摄像机名称列表配置,用#分割--> <!--摄像机名称列表配置,用#分割-->
<add key="CameraName" value="GigE:MV-CE100-30GC (00C69898477)" /> <add key="CameraName" value="GigE:MV-CE100-30GC (00C81915560)#GigE:MV-CE100-30GC (00C81915565)" />
<!--二维码类型列表配置,用#分割--> <!--二维码类型列表配置,用#分割-->
<add key="CodeType" value="QR Code" /> <add key="CodeType" value="QR Code" />
<!--<add key="CodeType" value="Data Matrix ECC 200#QR Code"/>--> <!--<add key="CodeType" value="Data Matrix ECC 200#QR Code"/>-->
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
<!--5000脉冲对应1mm--> <!--5000脉冲对应1mm-->
<add key="AxisChangeValue" value="5000" /> <add key="AxisChangeValue" value="5000" />
<!--压紧轴计量检测信号亮1次的脉冲值--> <!--压紧轴计量检测信号亮1次的脉冲值-->
<add key="ComAxisChangeValue" value="10000" /> <add key="ComAxisChangeValue" value="20000" />
<add key ="DebugPosId" value ="1#AC1_2_1_1"/> <add key="DebugPosId" value="1#AC2_2_1_1" />
<!--是否有门禁屏蔽功能,=1表示有此功能--> <!--是否有门禁屏蔽功能,=1表示有此功能-->
<add key ="HasDisableDoorControl" value ="0"/> <add key="HasDisableDoorControl" value="1" />
<add key ="ACBaudRate" value ="9600"/> <add key="ACBaudRate" value="9600" />
<add key="Default_Language" value="zh-CN" /> <add key="Default_Language" value="zh-CN" />
</appSettings> </appSettings>
<log4net> <log4net>
......
...@@ -130,7 +130,8 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,, ...@@ -130,7 +130,8 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
2.从料仓下方接盘时,压紧轴和升降轴一起运动。 2.从料仓下方接盘时,压紧轴和升降轴一起运动。
3.吸盘吸料后,等待入库的过程中增加超时报警。 3.吸盘吸料后,等待入库的过程中增加超时报警。
20190314修改:
拿走料盘的过程中增加出库处理。
......
...@@ -190,7 +190,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,7 +190,10 @@ namespace OnlineStore.DeviceLibrary
dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length); dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray); SendData(portName, dataArray);
} }
public static void SuddenStop(ConfigMoveAxis axis)
{
SuddenStop(axis.DeviceName, axis.GetAxisValue());
}
public static void SuddenStop(string portName, int slvAddr) public static void SuddenStop(string portName, int slvAddr)
{ {
// RunBlock(7); // RunBlock(7);
......
...@@ -15,7 +15,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,7 +15,8 @@ namespace OnlineStore.DeviceLibrary
private static bool IsStop = false; private static bool IsStop = false;
private static System.Timers.Timer checkTimer = null; private static System.Timers.Timer checkTimer = null;
public static bool StartCheck() private static string TargetIoType = IO_Type.TrayCheck_LoadMaterial;
public static bool StartCheck(string targetIo)
{ {
if (checkTimer == null) if (checkTimer == null)
{ {
...@@ -25,11 +26,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -25,11 +26,11 @@ namespace OnlineStore.DeviceLibrary
checkTimer.Elapsed += CheckTimer_Elapsed; checkTimer.Elapsed += CheckTimer_Elapsed;
checkTimer.Enabled = false; checkTimer.Enabled = false;
} }
TargetIoType = targetIo;
checkTimer.Start(); checkTimer.Start();
return true; return true;
} }
public static bool StopCheck() public static bool StopCheck()
{ {
if (!(checkTimer == null)) if (!(checkTimer == null))
...@@ -44,9 +45,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,9 +45,9 @@ namespace OnlineStore.DeviceLibrary
if (IsInProcess) { return; } if (IsInProcess) { return; }
IsInProcess = true; IsInProcess = true;
bool result = false; bool result = false;
if (KND.IOValue(LoadCSVLibrary.IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (KND.IOValue(TargetIoType).Equals(IO_VALUE.HIGH))
{ {
LogUtil.info("批量上料轴,检测到上料机构料盘信号,可以停止运动"); LogUtil.info("批量上料轴,检测到【" + TargetIoType + "】信号,可以停止运动");
result = true; result = true;
} }
//else if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1)) //else if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
...@@ -61,7 +62,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -61,7 +62,7 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.SuddenStop(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()); ACServerManager.SuddenStop(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
StopCheck(); StopCheck();
} }
IsInProcess = false ; IsInProcess = false;
} }
} }
} }
...@@ -180,8 +180,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -180,8 +180,6 @@ namespace OnlineStore.DeviceLibrary
} }
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10) else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{ {
//if ((Config.Batch_Axis.IsSameAxis(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue())) && wait.TargetPosition.Equals(Config.BatchAxis_P1))
//{
if (!wait.IsEnd) if (!wait.IsEnd)
{ {
wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait); wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait);
...@@ -403,7 +401,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -403,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库:SI_06 压紧轴压紧,压紧轴到P2,升降轴稍微下降【" + Config.UpDownAxis_DownValue + "】,目标位置【" + targetPosition + "】 "); InStoreLog("入库:SI_06 压紧轴压紧,压紧轴到P2,升降轴稍微下降【" + Config.UpDownAxis_DownValue + "】,目标位置【" + targetPosition + "】 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_CompressWork); StoreMove.NextMoveStep(StoreMoveStep.SI_06_CompressWork);
ComMoveToPosition(moveP.ComPress_P2, true); ComMoveToPosition(moveP.ComPress_P2, true);
ACAxisMove(Config.UpDown_Axis, targetPosition, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, targetPosition, Config.UpDownAxis_P4_Speed);
} }
else else
{ {
...@@ -832,10 +830,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -832,10 +830,15 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreMove.TimeOutSeconds = 120; StoreMove.TimeOutSeconds = 120;
//ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed); //ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(Config.Batch_Axis, Config.BatchAxis_P1)); StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(Config.Batch_Axis, Config.BatchAxis_P1, IO_Type.TrayCheck_LoadMaterial));
BatchAxisController.StartCheck(); BatchAxisController.StartCheck(IO_Type.TrayCheck_LoadMaterial);
Config.Batch_Axis.TargetPosition = Config.BatchAxis_P1; Config.Batch_Axis.TargetPosition = Config.BatchAxis_P1;
ACServerManager.AbsMove(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue(), Config.BatchAxis_P1, Config.BatchAxis_P1_Speed); int speed = Config.BatchAxis_P1_Speed;
if (AutomaticBaiting.BatchOutStoreHeight > 0)
{
speed = Config.BatchAxis_P1_Speed / 2;
}
ACServerManager.AbsMove(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue(), Config.BatchAxis_P1, speed);
OutStoreLog("出库:SO_02 批量上下料轴到P1点【"+Config.BatchAxis_P1+"】 "); OutStoreLog("出库:SO_02 批量上下料轴到P1点【"+Config.BatchAxis_P1+"】 ");
} }
} }
......
...@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveType.Equals(StoreMoveType.OutStore)) else if (StoreMove.MoveType.Equals(StoreMoveType.OutStore))
{ {
//OutStoreProcess(); OutStoreProcess();
} }
} }
}catch(Exception ex) }catch(Exception ex)
...@@ -245,13 +245,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -245,13 +245,15 @@ namespace OnlineStore.DeviceLibrary
default: break; default: break;
} }
} }
#region 入库流程
private static void IsNeedInstore() private static void IsNeedInstore()
{ {
if (IsNeedStartInout) if (IsNeedStartInout)
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome);
LogUtil.info(Name + "复位中:需要检测是否有料盘,批量轴匀速上升速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】"); LogUtil.info(Name + "复位中:需要检测是否有料盘,批量轴匀速上升速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed,IO_Type.TrayCheck_LoadMaterial);
} }
else else
{ {
...@@ -304,7 +306,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -304,7 +306,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
LogUtil.info(Name + " 入料 ,轴上升到检测到料盘,速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】"); LogUtil.info(Name + " 入料 ,轴上升到检测到料盘,速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed, IO_Type.TrayCheck_LoadMaterial);
} }
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_MoveToUp)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_MoveToUp))
...@@ -327,7 +329,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -327,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up);
LogUtil.info(Name + "入料: 吸盘上升" ); LogUtil.info(Name + "入料: 吸盘上升");
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false); CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW));
...@@ -339,7 +341,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -339,7 +341,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//TODO 报警 //TODO 报警
WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError,"吸盘吸料失败"); WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore); StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore);
LogUtil.error(WarnMsg, 103); LogUtil.error(WarnMsg, 103);
} }
...@@ -350,7 +352,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -350,7 +352,7 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I07_BatchAxisUp); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I07_BatchAxisUp);
LogUtil.info(Name + "入料: 批量上下料轴上升速度【" + StoreManager.Config.BatchAxis_SlowSpeed + "】"); LogUtil.info(Name + "入料: 批量上下料轴上升速度【" + StoreManager.Config.BatchAxis_SlowSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_SlowSpeed ); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true); CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
if (StoreManager.Config.Default_TrayWidth.Equals(7)) if (StoreManager.Config.Default_TrayWidth.Equals(7))
{ {
...@@ -371,7 +373,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -371,7 +373,7 @@ namespace OnlineStore.DeviceLibrary
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"); WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore); StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore);
LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败",105); LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败", 105);
} }
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I07_BatchAxisUp)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I07_BatchAxisUp))
...@@ -481,7 +483,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -481,7 +483,7 @@ namespace OnlineStore.DeviceLibrary
addHeight = StoreManager.Config.LastTrayAddHeight; addHeight = StoreManager.Config.LastTrayAddHeight;
} }
LastHeight += addHeight; LastHeight += addHeight;
LogUtil.info(Name + "入料: 计算盘高:上升前【" + StartMovePosition + "】实时【" + EndMovePosition + "】补充【"+addHeight+"】计算后高度【" + LastHeight + "】"); LogUtil.info(Name + "入料: 计算盘高:上升前【" + StartMovePosition + "】实时【" + EndMovePosition + "】补充【" + addHeight + "】计算后高度【" + LastHeight + "】");
if (LastHeight < 0) if (LastHeight < 0)
{ {
LastHeight = StoreManager.Config.GetDefaultHeight(); LastHeight = StoreManager.Config.GetDefaultHeight();
...@@ -588,6 +590,114 @@ namespace OnlineStore.DeviceLibrary ...@@ -588,6 +590,114 @@ namespace OnlineStore.DeviceLibrary
} }
} }
#endregion
#region 出库流程
public static string StartOut()
{
if ((!StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Runing)) ||
(!StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.None)))
{
LogUtil.error(Name + " 启动出料流程失败,料仓不在待机状态" + StoreManager.Store.storeRunStatus + ",MoveType" + StoreManager.Store.StoreMove.MoveType);
return "料仓不在待机状态" + StoreManager.Store.storeRunStatus + ",MoveType" + StoreManager.Store.StoreMove.MoveType;
}
if (AutoBaitingStatus == StoreRunStatus.Runing && StoreMove.MoveType.Equals(StoreMoveType.None))
{
AutoBaitingStatus = StoreRunStatus.Busy;
StoreMove.NewMove(StoreMoveType.OutStore);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O00_Wait);
LogUtil.info(Name + "启动出料");
return "";
}
else
{
LogUtil.error(Name + " 启动出料失败, Status=" + AutoBaitingStatus + ",MoveType=" + StoreMove.MoveType);
return "启动出料失败, Status = " + AutoBaitingStatus + ",MoveType = " + StoreMove.MoveType;
}
}
private static void OutStoreProcess()
{
if (StoreMove.IsInWait)
{
CheckWait();
}
if (StoreMove.IsInWait)
{
return;
}
if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O00_Wait))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O01_WaitDoorOpen);
LogUtil.info(Name + "出料: 等待门锁打开 ");
BatchDoorOpen(true);
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O01_WaitDoorOpen))
{
if (KND.IOValue(IO_Type.OutCheck).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O02_WaitOutSingleLow);
LogUtil.info(Name + " 出料 ,等待出料检测信号关闭");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutCheck, IO_VALUE.LOW));
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O03_SpeedMove);
LogUtil.info(Name + " 出料 ,轴上升到检测到出料信号,速度【" + StoreManager.Config.BatchAxis_SlowSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.OutCheck);
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O02_WaitOutSingleLow))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O03_SpeedMove);
LogUtil.info(Name + " 出料 ,轴上升到检测到出料信号,速度【" + StoreManager.Config.BatchAxis_SlowSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed, IO_Type.OutCheck);
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O03_SpeedMove))
{
//先判断极限是否亮
int value = ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis);
if (value.Equals(1))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O05_BackToP2);
LogUtil.info(Name + "出料:上料轴移动到p2点【" + StoreManager.Config.BatchAxis_P2 + "】");
ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
}
else
{
//等待出料信号亮
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O02_WaitOutSingleLow);
LogUtil.info(Name + " 出料 ,等待出料检测信号关闭");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutCheck, IO_VALUE.LOW));
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O05_BackToP2))
{
//TODO
LogUtil.info(Name + "出料:回到待机点完成,出料结束");
StoreMove.EndMove();
AutoBaitingStatus = StoreRunStatus.Runing;
}
else
{
LogUtil.error(Name + "未找到步骤:" + StoreMove.MoveType);
}
}
private static void StopOutProcess()
{
if (StoreMove.MoveType.Equals(StoreMoveType.OutStore))
{
LogUtil.error(Name+"正在出料中,停止出料流程");
ACServerManager.SuddenStop(StoreManager.Config.Batch_Axis);
StoreMove.EndMove();
AutoBaitingStatus = StoreRunStatus.Runing;
}
}
#endregion
public static bool DoorIsClose() public static bool DoorIsClose()
{ {
......
...@@ -15,14 +15,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,14 +15,14 @@ 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) private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, 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)); StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis,0, targetSingle));
BatchAxisController.StartCheck(); BatchAxisController.StartCheck(targetSingle);
ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed); ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed);
} }
...@@ -119,19 +119,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -119,19 +119,7 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
wait.IsEnd = wait.IoValue.Equals(value); wait.IsEnd = wait.IoValue.Equals(value);
} }
//else if (wait.WaitType == (int)Wait_Type.WaitHeight_7)
//{
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10) else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{ {
wait.IsEnd = BatchAxisIsEnd(wait); wait.IsEnd = BatchAxisIsEnd(wait);
...@@ -239,9 +227,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -239,9 +227,9 @@ namespace OnlineStore.DeviceLibrary
public static bool BatchAxisIsEnd(WaitResultInfo wait) public static bool BatchAxisIsEnd(WaitResultInfo wait)
{ {
bool result = false; bool result = false;
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (KND.IOValue(wait.IoType).Equals(IO_VALUE.HIGH))
{ {
LogUtil.info(wait.ToStr() + " 检测到上料机构料盘信号,可以停止运动"); LogUtil.info(wait.ToStr() + " 检测到【" + wait.IoType + "】信号,可以停止运动");
result = true; result = true;
} }
else if (ACServerManager.GetLimitPositiveSingle(wait.AxisInfo).Equals(1)) else if (ACServerManager.GetLimitPositiveSingle(wait.AxisInfo).Equals(1))
...@@ -477,7 +465,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -477,7 +465,7 @@ namespace OnlineStore.DeviceLibrary
map.Add(ParamDefine.closeLock, ParamDefine.disable); map.Add(ParamDefine.closeLock, ParamDefine.disable);
map.Add(ParamDefine.takeOutReel, ParamDefine.disable); map.Add(ParamDefine.takeOutReel, ParamDefine.disable);
map.Add(ParamDefine.confirmReelOut, ParamDefine.disable); map.Add(ParamDefine.confirmReelOut, ParamDefine.disable);
if (AutomaticBaiting.DoorStatus.Equals(2)) if ( DoorStatus.Equals(2))
{ {
map.Add(ParamDefine.doorStatus, ResourceControl.GetString(ResourceControl.doorClose, "Door lock close")); map.Add(ParamDefine.doorStatus, ResourceControl.GetString(ResourceControl.doorClose, "Door lock close"));
} }
...@@ -487,15 +475,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -487,15 +475,15 @@ namespace OnlineStore.DeviceLibrary
} }
if (AutomaticBaiting.IsWaitTragGo && (AutomaticBaiting.IsGetTrayGo.Equals(false))) if ( IsWaitTragGo && ( IsGetTrayGo.Equals(false)))
{ {
map[ParamDefine.confirmReelOut] = ParamDefine.enable; map[ParamDefine.confirmReelOut] = ParamDefine.enable;
} }
else if (AutomaticBaiting.CanOpenBatchDoor()) else if ( CanOpenBatchDoor())
{ {
if (AutomaticBaiting.DoorStatus.Equals(2)) if ( DoorStatus.Equals(2))
{ {
if (AutomaticBaiting.BatchOutStoreCount > 0) if ( BatchOutStoreCount > 0)
{ {
map[ParamDefine.takeOutReel] = ParamDefine.enable; map[ParamDefine.takeOutReel] = ParamDefine.enable;
} }
...@@ -515,10 +503,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -515,10 +503,10 @@ namespace OnlineStore.DeviceLibrary
public static string doOpenDoor() public static string doOpenDoor()
{ {
if (AutomaticBaiting.CanOpenBatchDoor()) if ( CanOpenBatchDoor())
{ {
AutomaticBaiting.BatchDoorOpen(false); BatchDoorOpen(false);
AutomaticBaiting.IsNeedStartInout = false; IsNeedStartInout = false;
return ""; return "";
} }
else else
...@@ -528,28 +516,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -528,28 +516,29 @@ namespace OnlineStore.DeviceLibrary
} }
public static string doStartBatchIn() public static string doStartBatchIn()
{ {
if (!AutomaticBaiting.DoorIsClose()) if (! DoorIsClose())
{ {
return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device"); return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device");
} }
if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
return ResourceControl.GetString(ResourceControl.batchInError2, "Batch storing Error: gripper full, check before restoring"); return ResourceControl.GetString(ResourceControl.batchInError2, "Batch storing Error: gripper full, check before restoring");
} }
AutomaticBaiting.BatchDoorClose(false); StopOutProcess();
AutomaticBaiting.Reset(false,true); BatchDoorClose(false);
Reset(false,true);
return ""; return "";
} }
public static string doTakeReel() public static string doTakeReel()
{ {
if (AutomaticBaiting.CanOpenBatchDoor()) if (CanOpenBatchDoor())
{ {
if (AutomaticBaiting.BatchOutStoreCount > 0 && AutomaticBaiting.BatchOutStoreHeight > 0) if (BatchOutStoreCount > 0 && BatchOutStoreHeight > 0)
{ {
AutomaticBaiting.BatchDoorOpen(false); BatchDoorOpen(false);
return ""; return StartOut();
//return "";
} }
else else
{ {
...@@ -563,19 +552,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -563,19 +552,23 @@ namespace OnlineStore.DeviceLibrary
} }
public static string doCloseDoor() public static string doCloseDoor()
{ {
if (!AutomaticBaiting.DoorIsClose()) if (! DoorIsClose())
{ {
return (ResourceControl.GetString(ResourceControl.CloseError, "Door lock Error: Close feeding device")); return (ResourceControl.GetString(ResourceControl.CloseError, "Door lock Error: Close feeding device"));
} }
AutomaticBaiting.BatchDoorClose(false); StopOutProcess();
AutomaticBaiting.Reset(false,false); BatchDoorClose(false);
Reset(false,false);
return ""; return "";
} }
public static bool doConfirmReelGo() public static bool doConfirmReelGo()
{ {
LogUtil.info(ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually")); LogUtil.info(ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually"));
AutomaticBaiting.IsWaitTragGo = false; IsWaitTragGo = false;
AutomaticBaiting.IsGetTrayGo = true; IsGetTrayGo = true;
return true; return true;
} }
} }
......
...@@ -488,29 +488,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -488,29 +488,28 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
//#region 自动上下料出料功能 #region 自动上下料出料功能
///// <summary>
///// 吸盘吸走料盘,同时上料轴开始上升
///// </summary>
//AUTO_O01_SuckingDisc_Work,
///// <summary>
///// 等待1秒后吸盘下降
///// </summary>
//AUTO_O02_WaitTimeDown,
///// <summary> AUTO_O00_Wait=1300,
///// 吸盘下降 /// <summary>
///// </summary> /// 等待门锁打开
//AUTO_O03_SuckingDisc_Down, /// </summary>
///// <summary> AUTO_O01_WaitDoorOpen =1301,
///// 放下料盘 /// <summary>
///// </summary> /// 等待出料检测信号关闭
//AUTO_O04_PutTrayDown, /// </summary>
///// <summary> AUTO_O02_WaitOutSingleLow=1302,
///// 吸盘上升 /// <summary>
///// </summary> /// 向上运动,等待DI12亮或者极限亮停止
//AUTO_O05_SuckingDisc_Up, /// </summary>
//#endregion AUTO_O03_SpeedMove=1303,
/// <summary>
/// 极限亮,返回P2点
/// </summary>
AUTO_O05_BackToP2=1304,
#endregion
} }
......
...@@ -277,7 +277,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -277,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
/// 10=等待批量上下料轴运动 停止 /// 10=等待批量上下料轴运动 停止
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis,int targetPosition) public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis,int targetPosition,string targetIoType)
{ {
WaitResultInfo wait = new WaitResultInfo(); WaitResultInfo wait = new WaitResultInfo();
wait.TargetPosition = targetPosition; wait.TargetPosition = targetPosition;
...@@ -286,6 +286,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -286,6 +286,7 @@ namespace OnlineStore.DeviceLibrary
wait.WaitType = (int)Wait_Type.BatchAxisMove_10; wait.WaitType = (int)Wait_Type.BatchAxisMove_10;
wait.IsHomeMove = true; wait.IsHomeMove = true;
wait.IsEnd = false; wait.IsEnd = false;
wait.IoType = targetIoType;
return wait; return wait;
} }
/// <summary> /// <summary>
...@@ -435,7 +436,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -435,7 +436,6 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public int HeightValue { get; set; } public int HeightValue { get; set; }
} }
public enum Wait_Type public enum Wait_Type
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!