Commit 602d04fd LN

一键检查料叉功能。出库未检测到物料时自动禁用库位。

1 个父辈 c58170bf
...@@ -808,10 +808,10 @@ namespace DeviceLibrary ...@@ -808,10 +808,10 @@ namespace DeviceLibrary
string msg = ""; string msg = "";
try try
{ {
if (String.IsNullOrEmpty(barcode)) //if (String.IsNullOrEmpty(barcode))
{ //{
return msg; // return msg;
} //}
Dictionary<string, string> paramMap = new Dictionary<string, string> Dictionary<string, string> paramMap = new Dictionary<string, string>
{ {
{ "posId", poid },//posId:库位号 { "posId", poid },//posId:库位号
...@@ -819,7 +819,7 @@ namespace DeviceLibrary ...@@ -819,7 +819,7 @@ namespace DeviceLibrary
{ "msg", reason } { "msg", reason }
}; };
string server = GetAddr(Addr_cancelPutInTask, paramMap); string server = GetAddr(Addr_disabledPos, paramMap);
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "",3000); string resultStr = HttpHelper.Post(server, "",3000);
LogUtil.info(deviceName + "DisablePos " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】"); LogUtil.info(deviceName + "DisablePos " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
......
...@@ -54,17 +54,18 @@ namespace DeviceLibrary ...@@ -54,17 +54,18 @@ namespace DeviceLibrary
string WareCode = ""; string WareCode = "";
int plateH = 0; int plateH = 0;
bool PreMove = false; bool PreMove = false;
private bool AlarmNeedDisPos = false;
/// <summary> /// <summary>
/// 料盘放置在校准库位是否正常 /// 料盘放置在校准库位是否正常
/// </summary> /// </summary>
bool reelStatusInFix = true; bool reelStatusInFix = true;
public bool Start(BoxStorePosition from, BoxStorePosition to, StoreMoveType _storeMoveType, bool premove = false) public bool Start(BoxStorePosition from, BoxStorePosition to, StoreMoveType _storeMoveType, bool premove = false,bool needDisPos=false )
{ {
if (MoveInfo.MoveStep != MoveStep.Wait) if (MoveInfo.MoveStep != MoveStep.Wait)
return false; return false;
AlarmNeedDisPos = needDisPos;
storeMoveType = _storeMoveType; storeMoveType = _storeMoveType;
PreMove = premove; PreMove = premove;
if (from == null) if (from == null)
...@@ -73,7 +74,7 @@ namespace DeviceLibrary ...@@ -73,7 +74,7 @@ namespace DeviceLibrary
plateH = 32; plateH = 32;
To = to.clone(); To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS10); MoveInfo.NewMove(MoveStep.StoreTS10);
MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}"); MoveInfo.log($"{storeMoveType}:开始运输料盘{WareCode},直接到:{to.posid}, AlarmNeedDisPos=" + AlarmNeedDisPos);
MoveInfo.MoveParam.PosID = $"NA=>{To.posid}"; MoveInfo.MoveParam.PosID = $"NA=>{To.posid}";
} }
else else
...@@ -84,7 +85,7 @@ namespace DeviceLibrary ...@@ -84,7 +85,7 @@ namespace DeviceLibrary
To = to.clone(); To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS01); MoveInfo.NewMove(MoveStep.StoreTS01);
MoveInfo.log($"{storeMoveType}:开始运输料盘,从:{from.posid},到:{to.posid}"); MoveInfo.log($"{storeMoveType}:开始运输料盘{WareCode},从:{from.posid},到:{to.posid},AlarmNeedDisPos=" + AlarmNeedDisPos);
MoveInfo.MoveParam.PosID = $"{From.posid}=>{To.posid}"; MoveInfo.MoveParam.PosID = $"{From.posid}=>{To.posid}";
} }
if (To.posid == BoxStorePosition.strings) if (To.posid == BoxStorePosition.strings)
...@@ -106,7 +107,7 @@ namespace DeviceLibrary ...@@ -106,7 +107,7 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.StoreTS06); MoveInfo.NextMoveStep(MoveStep.StoreTS06);
return true; return true;
} }
private bool isWaitIgnoreX09 = false; private bool disPos = false;
public bool Process() public bool Process()
{ {
if (mainMachine.CheckWait(MoveInfo)) if (mainMachine.CheckWait(MoveInfo))
...@@ -176,29 +177,32 @@ namespace DeviceLibrary ...@@ -176,29 +177,32 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.StoreTS09); MoveInfo.NextMoveStep(MoveStep.StoreTS09);
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
IgnoreX09 = false; IgnoreX09 = false;
isWaitIgnoreX09 = false; disPos = false;
MoveInfo.log($"{storeMoveType}:进出轴去待机点P1【{Config.InOut_P1}】【{Config.InOut_P1_speed}】,设置 isWaitIgnoreX09="+ isWaitIgnoreX09); MoveInfo.log($"{storeMoveType}:进出轴去待机点P1【{Config.InOut_P1}】【{Config.InOut_P1_speed}】,设置 IgnoreX09=" + IgnoreX09);
break; break;
case MoveStep.StoreTS09: case MoveStep.StoreTS09:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut)); RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut));
if (!IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) if (!IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{ {
isWaitIgnoreX09 = true;
Msg.add(crc.GetString(L.out_store_not_detect_material, "取料后料叉X30没有检测到有物料无法继续,请检查."), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect); Msg.add(crc.GetString(L.out_store_not_detect_material, "取料后料叉X30没有检测到有物料无法继续,请检查."), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
if (!disPos && storeMoveType.Equals(StoreMoveType.OutStore) && AlarmNeedDisPos )
{
disPos = true;
//屏蔽库位
string pos = From.posid;
MoveInfo.log($"{storeMoveType}:取到料后未检测到物料,AlarmNeedDisPos={AlarmNeedDisPos},需要屏蔽库位:{pos}, WareCode={WareCode}" );
ServerCommunication.DisablePos(Setting_Init.App_CID, WareCode, pos, "IgnoreX09");
}
//RobotManage.UserPause(crc.GetString(L.out_store_not_detect_material, "取料前料叉X30没有检测到有物料无法继续,请检查.")); //RobotManage.UserPause(crc.GetString(L.out_store_not_detect_material, "取料前料叉X30没有检测到有物料无法继续,请检查."));
} }
else else
{ {
if (isWaitIgnoreX09 && IgnoreX09&& storeMoveType.Equals(StoreMoveType.OutStore))
{ //屏蔽库位
string pos = From.posid;
MoveInfo.log($"{storeMoveType}:取到料后未检测到物料,点忽略信号继续,需要屏蔽库位:"+pos);
ServerCommunication.DisablePos(Setting_Init.App_CID, WareCode, pos, "IgnoreX09");
}
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
isWaitIgnoreX09 = false; disPos = false;
if (To.posid == BoxStorePosition.strings && Setting_Init.Enable_Fixpos && Fix != null) if (To.posid == BoxStorePosition.strings && Setting_Init.Enable_Fixpos && Fix != null)
MoveInfo.NextMoveStep(MoveStep.StoreFIX01); MoveInfo.NextMoveStep(MoveStep.StoreFIX01);
else else
......
...@@ -442,7 +442,7 @@ namespace DeviceLibrary ...@@ -442,7 +442,7 @@ namespace DeviceLibrary
} }
} }
StringDoorClose(null); StringDoorClose(null);
break; break;
case MoveStep.H02_HomeReset_01: case MoveStep.H02_HomeReset_01:
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
...@@ -500,7 +500,7 @@ namespace DeviceLibrary ...@@ -500,7 +500,7 @@ namespace DeviceLibrary
{ {
ResetMoveInfo.NextMoveStep(MoveStep.H12_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H12_HomeReset);
ResetMoveInfo.log("反转托盘上有料盘,送到NG口"); ResetMoveInfo.log("反转托盘上有料盘,送到NG口");
} }
else else
{ {
if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
...@@ -508,7 +508,7 @@ namespace DeviceLibrary ...@@ -508,7 +508,7 @@ namespace DeviceLibrary
ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
ResetMoveInfo.log("叉子上有料,不去进行超声感应器检测"); ResetMoveInfo.log("叉子上有料,不去进行超声感应器检测");
} }
else if (RobotManage.NeedSensorPro()) else if (RobotManage.NeedSensorPro())
{ {
ResetMoveInfo.NextMoveStep(MoveStep.H21_HomeStartCheck); ResetMoveInfo.NextMoveStep(MoveStep.H21_HomeStartCheck);
ResetMoveInfo.log("夹爪上没有料盘,开始去进行超声感应器检测"); ResetMoveInfo.log("夹爪上没有料盘,开始去进行超声感应器检测");
...@@ -584,7 +584,7 @@ namespace DeviceLibrary ...@@ -584,7 +584,7 @@ namespace DeviceLibrary
} }
else else
{ {
RobotManage.UserPause($"系统启动检测到有无信息料盘,等待取走单料口料盘"); RobotManage.UserPause($"系统启动检测到有无信息料盘,等待取走单料口料盘");
} }
} }
else else
...@@ -638,10 +638,10 @@ namespace DeviceLibrary ...@@ -638,10 +638,10 @@ namespace DeviceLibrary
#region 声波传感器检测 #region 声波传感器检测
case MoveStep.H21_HomeStartCheck: case MoveStep.H21_HomeStartCheck:
FixPos = BoxStorePosition.GetFixPos(Config, new ReelParam("",7,8)); FixPos = BoxStorePosition.GetFixPos(Config, new ReelParam("", 7, 8));
if (FixPos == null) if (FixPos == null)
{ {
ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
ResetMoveInfo.log("未找到校准库位,不进行声波传感器检测"); ResetMoveInfo.log("未找到校准库位,不进行声波传感器检测");
} }
...@@ -651,22 +651,22 @@ namespace DeviceLibrary ...@@ -651,22 +651,22 @@ namespace DeviceLibrary
Middle_Axis.AbsMove(ResetMoveInfo, FixPos.Middle_P2, Config.Middle_P2_speed); Middle_Axis.AbsMove(ResetMoveInfo, FixPos.Middle_P2, Config.Middle_P2_speed);
ResetMoveInfo.log($"{FixPos.posid} 旋转轴去取料点P2【{FixPos.Middle_P2}】【{Config.Middle_P2_speed}】"); ResetMoveInfo.log($"{FixPos.posid} 旋转轴去取料点P2【{FixPos.Middle_P2}】【{Config.Middle_P2_speed}】");
UpDown_Axis.AbsMove(ResetMoveInfo, FixPos.UpDown_PH, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(ResetMoveInfo, FixPos.UpDown_PH, Config.UpDown_P1_speed);
ResetMoveInfo.log($" {FixPos.posid}升降轴去取料高点【{FixPos.UpDown_PH}】【{Config.UpDown_P1_speed}】"); ResetMoveInfo.log($" {FixPos.posid}升降轴去取料高点【{FixPos.UpDown_PH}】【{Config.UpDown_P1_speed}】");
Comp_Axis.AbsMove(ResetMoveInfo, FixPos.Comp_PL, Config.Comp_P2_speed); Comp_Axis.AbsMove(ResetMoveInfo, FixPos.Comp_PL, Config.Comp_P2_speed);
ResetMoveInfo.log($"{FixPos.posid}:压紧轴去压紧低点【{FixPos.Comp_PL}】【{Config.Comp_P2_speed}】"); ResetMoveInfo.log($"{FixPos.posid}:压紧轴去压紧低点【{FixPos.Comp_PL}】【{Config.Comp_P2_speed}】");
} }
break; break;
case MoveStep.H22_HomeCheck: case MoveStep.H22_HomeCheck:
ResetMoveInfo.NextMoveStep(MoveStep.H23_HomeCheck); ResetMoveInfo.NextMoveStep(MoveStep.H23_HomeCheck);
InOut_Axis.AbsMove(ResetMoveInfo, FixPos.InOut_P2, Config.InOut_P2_speed); InOut_Axis.AbsMove(ResetMoveInfo, FixPos.InOut_P2, Config.InOut_P2_speed);
InOut_Axis.SensorDetection(Setting_Init.Device_WeightSensor_MaxValue); InOut_Axis.SensorDetection(Setting_Init.Device_WeightSensor_MaxValue);
ResetMoveInfo.log($"{FixPos.posid}:进出轴去取料点【{FixPos.InOut_P2}】【{Config.InOut_P2_speed}】"); ResetMoveInfo.log($"{FixPos.posid}:进出轴去取料点【{FixPos.InOut_P2}】【{Config.InOut_P2_speed}】");
break; break;
case MoveStep.H23_HomeCheck: case MoveStep.H23_HomeCheck:
ResetMoveInfo.NextMoveStep(MoveStep.H24_HomeCheck); ResetMoveInfo.NextMoveStep(MoveStep.H24_HomeCheck);
Comp_Axis.AbsMove(ResetMoveInfo, FixPos.Comp_PH, Config.Comp_P2_speed); Comp_Axis.AbsMove(ResetMoveInfo, FixPos.Comp_PH, Config.Comp_P2_speed);
ResetMoveInfo.log($"{FixPos.posid}:压紧轴去压紧高点【{FixPos.Comp_PH}】【{Config.Comp_P2_speed}】"); ResetMoveInfo.log($"{FixPos.posid}:压紧轴去压紧高点【{FixPos.Comp_PH}】【{Config.Comp_P2_speed}】");
UpDown_Axis.AbsMove(ResetMoveInfo, FixPos.UpDown_PL, Config.UpDown_P3_speed / 2); UpDown_Axis.AbsMove(ResetMoveInfo, FixPos.UpDown_PL, Config.UpDown_P3_speed / 2);
...@@ -679,7 +679,7 @@ namespace DeviceLibrary ...@@ -679,7 +679,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.H25_HomeCheck: case MoveStep.H25_HomeCheck:
bool checkOk= RobotManage.SensorProcess(); bool checkOk = RobotManage.SensorProcess();
if (checkOk) if (checkOk)
{ {
ResetMoveInfo.NextMoveStep(MoveStep.H27_HomeCheck); ResetMoveInfo.NextMoveStep(MoveStep.H27_HomeCheck);
...@@ -700,7 +700,7 @@ namespace DeviceLibrary ...@@ -700,7 +700,7 @@ namespace DeviceLibrary
ResetMoveInfo.log("旋转轴,升降轴,压紧轴,到P1待机点"); ResetMoveInfo.log("旋转轴,升降轴,压紧轴,到P1待机点");
Middle_Axis.AbsMove(ResetMoveInfo, Config.Middle_P1, Config.Middle_P1_speed); Middle_Axis.AbsMove(ResetMoveInfo, Config.Middle_P1, Config.Middle_P1_speed);
UpDown_Axis.AbsMove(ResetMoveInfo, Config.UpDown_P1, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(ResetMoveInfo, Config.UpDown_P1, Config.UpDown_P1_speed);
Comp_Axis.AbsMove(ResetMoveInfo,Config.Comp_P1,Config.Comp_P1_speed); Comp_Axis.AbsMove(ResetMoveInfo, Config.Comp_P1, Config.Comp_P1_speed);
break; break;
case MoveStep.H28_HomeCheck: case MoveStep.H28_HomeCheck:
...@@ -713,14 +713,14 @@ namespace DeviceLibrary ...@@ -713,14 +713,14 @@ namespace DeviceLibrary
Msg.add(crc.GetString("shengboError", "声波传感器误差过大,请检查后重新复位"), MsgLevel.alarm); Msg.add(crc.GetString("shengboError", "声波传感器误差过大,请检查后重新复位"), MsgLevel.alarm);
ResetMoveInfo.log(crc.GetString("shengboError", "声波传感器误差过大,请检查后重新复位")); ResetMoveInfo.log(crc.GetString("shengboError", "声波传感器误差过大,请检查后重新复位"));
break; break;
// H22_HomeCheck,//旋转轴到校准为止,升降轴到高点,压紧轴压紧 // H22_HomeCheck,//旋转轴到校准为止,升降轴到高点,压紧轴压紧
//H23_HomeCheck,//进出轴进入 //H23_HomeCheck,//进出轴进入
//H24_HomeCheck,//升降轴下降,压紧轴放松 //H24_HomeCheck,//升降轴下降,压紧轴放松
//H25_HomeCheck,//等待500毫秒 //H25_HomeCheck,//等待500毫秒
//H26_HomeCheck,//开始检测 //H26_HomeCheck,//开始检测
//H27_HomeCheck,//进出轴返回待机点 //H27_HomeCheck,//进出轴返回待机点
//H28_HomeCheck,//旋转轴升降轴到待机点 //H28_HomeCheck,//旋转轴升降轴到待机点
//H31_HomeError,//检测错误,报警 //H31_HomeError,//检测错误,报警
#endregion #endregion
case MoveStep.HEND_HomeReset: case MoveStep.HEND_HomeReset:
...@@ -766,8 +766,80 @@ namespace DeviceLibrary ...@@ -766,8 +766,80 @@ namespace DeviceLibrary
runStatus = RunStatus.Running; runStatus = RunStatus.Running;
ServerCM.storeStatus = StoreStatus.StoreOnline; ServerCM.storeStatus = StoreStatus.StoreOnline;
break; break;
#region 交叉检查处理
case MoveStep.CH01_StartTo:
ResetMoveInfo.NextMoveStep(MoveStep.CH02_InoutToP1);
ResetMoveInfo.log($"料叉检查:进出轴返回待机点P1 {Config.InOut_P1}");
InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
break;
case MoveStep.CH02_InoutToP1:
ResetMoveInfo.NextMoveStep(MoveStep.CH03_ToTarget);
ResetMoveInfo.log($"料叉检查:旋转轴到P2 {Config.Middle_P2} ,升降轴到P2:{Config.UpDown_P2}");
Middle_Axis.AbsMove(ResetMoveInfo, Config.Middle_P2, Config.Middle_P2_speed);
UpDown_Axis.AbsMove(ResetMoveInfo, Config.UpDown_P2, Config.UpDown_P2_speed);
break;
case MoveStep.CH03_ToTarget:
ResetMoveInfo.NextMoveStep(MoveStep.CH04_OpenDoor);
ResetMoveInfo.log($"料叉检查:打开NG门 ");
OpenSingleDoor(ResetMoveInfo);
break;
case MoveStep.CH04_OpenDoor:
ResetMoveInfo.NextMoveStep(MoveStep.CH05_InoutToP2);
ResetMoveInfo.log($"料叉检查:进出轴去P2 {Config.InOut_P2}");
InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P2, Config.InOut_P2_speed);
break;
case MoveStep.CH05_InoutToP2:
ResetMoveInfo.NextMoveStep(MoveStep.CH06_WaitCheck);
ResetMoveInfo.log($"料叉检查:进出轴已到位,请检查料叉 ");
Msg.add(crc.GetString("CH06_WaitCheck", "料叉已到位,请检查"), MsgLevel.warning);
break;
case MoveStep.CH06_WaitCheck:
ResetMoveInfo.NextMoveStep(MoveStep.CH06_WaitCheck);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
Msg.add(crc.GetString("CH06_WaitCheck", "料叉已到位,请检查"), MsgLevel.warning);
break;
case MoveStep.CH07_CheckOk:
ResetMoveInfo.NextMoveStep(MoveStep.CH08_InoutBack);
ResetMoveInfo.log($"料叉检查:检查完成,进出轴返回待机点P1 {Config.InOut_P1}");
InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
break;
case MoveStep.CH08_InoutBack:
ResetMoveInfo.NextMoveStep(MoveStep.CH09_CloseDoor);
ResetMoveInfo.log($"料叉检查:检查完成,关闭门");
CloseSingleDoor(ResetMoveInfo);
break;
case MoveStep.CH09_CloseDoor:
ResetMoveInfo.log("检查完成");
ResetMoveInfo.EndMove();
runStatus = RunStatus.Running;
ServerCM.storeStatus = StoreStatus.StoreOnline;
break;
#endregion
} }
} }
public bool CheckOk()
{
if (ResetMoveInfo.IsStep(MoveStep.CH06_WaitCheck))
{
ResetMoveInfo.NextMoveStep(MoveStep.CH07_CheckOk);
ResetMoveInfo.log($"确认检测完成 ");
return true;
}
return false;
}
public void StartToCheck( )
{
runStatus = RunStatus.HomeReset;
ServerCM.storeStatus = StoreStatus.ResetMove;
ResetMoveInfo.NewMove(MoveStep.CH01_StartTo);
ResetMoveInfo.log("开始料叉检查");
RobotManage.LastResetTime = DateTime.Now;
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
private BoxStorePosition FixPos = null; private BoxStorePosition FixPos = null;
//bool _IgnoreSafecheck = false; //bool _IgnoreSafecheck = false;
public bool IgnoreSafecheck public bool IgnoreSafecheck
......
...@@ -183,8 +183,8 @@ namespace DeviceLibrary ...@@ -183,8 +183,8 @@ namespace DeviceLibrary
outTo = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam); outTo = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam);
else else
outTo = new BoxStorePosition(Config, StoreSide.String, StoreMoveInfo.MoveParam); outTo = new BoxStorePosition(Config, StoreSide.String, StoreMoveInfo.MoveParam);
boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore); boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore,false,true);
StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}"); StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}, 未检测到物料时需要屏蔽库位");
break; break;
case MoveStep.StoreOut11: case MoveStep.StoreOut11:
...@@ -266,5 +266,18 @@ namespace DeviceLibrary ...@@ -266,5 +266,18 @@ namespace DeviceLibrary
return state; return state;
} }
public bool isInBusy()
{
//出入库 绿闪 黄闪
if (ClampMoveInfo.MoveStep > MoveStep.Wait
|| StoreMoveInfo.MoveStep > MoveStep.Wait
|| (StringMoveInfo.MoveStep > MoveStep.Wait && StringMoveInfo.MoveStep != MoveStep.StringReadyPut && StringMoveInfo.MoveStep <= MoveStep.StringOut_01))
{
return true;
}
return false;
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -52,6 +52,49 @@ namespace DeviceLibrary ...@@ -52,6 +52,49 @@ namespace DeviceLibrary
HEND_HomeReset, HEND_HomeReset,
/// <summary>
/// 料叉检查功能:进出轴返回待机点P1
/// </summary>
CH01_StartTo,
/// <summary>
/// 料叉检查功能:进出轴返回待机点P1
/// </summary>
CH02_InoutToP1,
/// <summary>
/// 料叉检查功能:旋转轴到NG门位置,升降轴到NG门位置
/// </summary>
CH03_ToTarget,
/// <summary>
/// 料叉检查功能:打开NG门
/// </summary>
CH04_OpenDoor,
/// <summary>
/// 料叉检查功能:进出轴前进
/// </summary>
CH05_InoutToP2,
/// <summary>
/// 料叉检查功能:等待检查,检查完成必须复位
/// </summary>
CH06_WaitCheck,
/// <summary>
/// 料叉检查功能:检查完成
/// </summary>
CH07_CheckOk,
/// <summary>
/// 料叉检查功能: ,进出轴返回待机点
/// </summary>
CH08_InoutBack,
/// <summary>
/// 料叉检查功能: ,NG关闭
/// </summary>
CH09_CloseDoor,
StringLoad_01, StringLoad_01,
StringLoad_01a, StringLoad_01a,
StringLoad_02, StringLoad_02,
......
...@@ -31,6 +31,7 @@ namespace TheMachine ...@@ -31,6 +31,7 @@ namespace TheMachine
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.btnCheck = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.btnChangeColor = new System.Windows.Forms.Button(); this.btnChangeColor = new System.Windows.Forms.Button();
this.btnGree = new System.Windows.Forms.Button(); this.btnGree = new System.Windows.Forms.Button();
...@@ -44,12 +45,15 @@ namespace TheMachine ...@@ -44,12 +45,15 @@ namespace TheMachine
this.configControl1 = new TheMachine.ConfigControl(); this.configControl1 = new TheMachine.ConfigControl();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.colorDialog1 = new System.Windows.Forms.ColorDialog(); this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.btnCheckOk = new System.Windows.Forms.Button();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// panel1 // panel1
// //
this.panel1.AutoScroll = true; this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.btnCheckOk);
this.panel1.Controls.Add(this.btnCheck);
this.panel1.Controls.Add(this.button1); this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.btnChangeColor); this.panel1.Controls.Add(this.btnChangeColor);
this.panel1.Controls.Add(this.btnGree); this.panel1.Controls.Add(this.btnGree);
...@@ -67,9 +71,23 @@ namespace TheMachine ...@@ -67,9 +71,23 @@ namespace TheMachine
this.panel1.Size = new System.Drawing.Size(1234, 924); this.panel1.Size = new System.Drawing.Size(1234, 924);
this.panel1.TabIndex = 2; this.panel1.TabIndex = 2;
// //
// btnCheck
//
this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCheck.Location = new System.Drawing.Point(16, 453);
this.btnCheck.Name = "btnCheck";
this.btnCheck.Size = new System.Drawing.Size(155, 31);
this.btnCheck.TabIndex = 21;
this.btnCheck.Text = "启动料叉检测";
this.btnCheck.UseVisualStyleBackColor = true;
this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click);
//
// button1 // button1
// //
this.button1.Location = new System.Drawing.Point(211, 578); this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(211, 624);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(155, 31); this.button1.Size = new System.Drawing.Size(155, 31);
this.button1.TabIndex = 20; this.button1.TabIndex = 20;
...@@ -79,7 +97,9 @@ namespace TheMachine ...@@ -79,7 +97,9 @@ namespace TheMachine
// //
// btnChangeColor // btnChangeColor
// //
this.btnChangeColor.Location = new System.Drawing.Point(211, 541); this.btnChangeColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnChangeColor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnChangeColor.Location = new System.Drawing.Point(211, 587);
this.btnChangeColor.Name = "btnChangeColor"; this.btnChangeColor.Name = "btnChangeColor";
this.btnChangeColor.Size = new System.Drawing.Size(155, 31); this.btnChangeColor.Size = new System.Drawing.Size(155, 31);
this.btnChangeColor.TabIndex = 19; this.btnChangeColor.TabIndex = 19;
...@@ -89,7 +109,9 @@ namespace TheMachine ...@@ -89,7 +109,9 @@ namespace TheMachine
// //
// btnGree // btnGree
// //
this.btnGree.Location = new System.Drawing.Point(25, 578); this.btnGree.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGree.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGree.Location = new System.Drawing.Point(25, 624);
this.btnGree.Name = "btnGree"; this.btnGree.Name = "btnGree";
this.btnGree.Size = new System.Drawing.Size(155, 31); this.btnGree.Size = new System.Drawing.Size(155, 31);
this.btnGree.TabIndex = 18; this.btnGree.TabIndex = 18;
...@@ -99,7 +121,9 @@ namespace TheMachine ...@@ -99,7 +121,9 @@ namespace TheMachine
// //
// btnYellow // btnYellow
// //
this.btnYellow.Location = new System.Drawing.Point(25, 541); this.btnYellow.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnYellow.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnYellow.Location = new System.Drawing.Point(25, 587);
this.btnYellow.Name = "btnYellow"; this.btnYellow.Name = "btnYellow";
this.btnYellow.Size = new System.Drawing.Size(155, 31); this.btnYellow.Size = new System.Drawing.Size(155, 31);
this.btnYellow.TabIndex = 17; this.btnYellow.TabIndex = 17;
...@@ -110,7 +134,7 @@ namespace TheMachine ...@@ -110,7 +134,7 @@ namespace TheMachine
// lblLed // lblLed
// //
this.lblLed.AutoSize = true; this.lblLed.AutoSize = true;
this.lblLed.Location = new System.Drawing.Point(23, 508); this.lblLed.Location = new System.Drawing.Point(23, 554);
this.lblLed.Name = "lblLed"; this.lblLed.Name = "lblLed";
this.lblLed.Size = new System.Drawing.Size(41, 12); this.lblLed.Size = new System.Drawing.Size(41, 12);
this.lblLed.TabIndex = 16; this.lblLed.TabIndex = 16;
...@@ -119,7 +143,7 @@ namespace TheMachine ...@@ -119,7 +143,7 @@ namespace TheMachine
// lblOkValue // lblOkValue
// //
this.lblOkValue.AutoSize = true; this.lblOkValue.AutoSize = true;
this.lblOkValue.Location = new System.Drawing.Point(23, 482); this.lblOkValue.Location = new System.Drawing.Point(23, 528);
this.lblOkValue.Name = "lblOkValue"; this.lblOkValue.Name = "lblOkValue";
this.lblOkValue.Size = new System.Drawing.Size(65, 12); this.lblOkValue.Size = new System.Drawing.Size(65, 12);
this.lblOkValue.TabIndex = 15; this.lblOkValue.TabIndex = 15;
...@@ -128,7 +152,7 @@ namespace TheMachine ...@@ -128,7 +152,7 @@ namespace TheMachine
// lblSensor // lblSensor
// //
this.lblSensor.AutoSize = true; this.lblSensor.AutoSize = true;
this.lblSensor.Location = new System.Drawing.Point(23, 456); this.lblSensor.Location = new System.Drawing.Point(23, 502);
this.lblSensor.Name = "lblSensor"; this.lblSensor.Name = "lblSensor";
this.lblSensor.Size = new System.Drawing.Size(65, 12); this.lblSensor.Size = new System.Drawing.Size(65, 12);
this.lblSensor.TabIndex = 14; this.lblSensor.TabIndex = 14;
...@@ -136,7 +160,9 @@ namespace TheMachine ...@@ -136,7 +160,9 @@ namespace TheMachine
// //
// btnAxisRStop // btnAxisRStop
// //
this.btnAxisRStop.Location = new System.Drawing.Point(397, 495); this.btnAxisRStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisRStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisRStop.Location = new System.Drawing.Point(397, 541);
this.btnAxisRStop.Name = "btnAxisRStop"; this.btnAxisRStop.Name = "btnAxisRStop";
this.btnAxisRStop.Size = new System.Drawing.Size(155, 31); this.btnAxisRStop.Size = new System.Drawing.Size(155, 31);
this.btnAxisRStop.TabIndex = 13; this.btnAxisRStop.TabIndex = 13;
...@@ -146,7 +172,9 @@ namespace TheMachine ...@@ -146,7 +172,9 @@ namespace TheMachine
// //
// btnAxisRTest // btnAxisRTest
// //
this.btnAxisRTest.Location = new System.Drawing.Point(397, 453); this.btnAxisRTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisRTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisRTest.Location = new System.Drawing.Point(397, 499);
this.btnAxisRTest.Name = "btnAxisRTest"; this.btnAxisRTest.Name = "btnAxisRTest";
this.btnAxisRTest.Size = new System.Drawing.Size(155, 31); this.btnAxisRTest.Size = new System.Drawing.Size(155, 31);
this.btnAxisRTest.TabIndex = 12; this.btnAxisRTest.TabIndex = 12;
...@@ -176,6 +204,18 @@ namespace TheMachine ...@@ -176,6 +204,18 @@ namespace TheMachine
this.timer1.Interval = 1000; this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// btnCheckOk
//
this.btnCheckOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCheckOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCheckOk.Location = new System.Drawing.Point(211, 453);
this.btnCheckOk.Name = "btnCheckOk";
this.btnCheckOk.Size = new System.Drawing.Size(155, 31);
this.btnCheckOk.TabIndex = 22;
this.btnCheckOk.Text = "检测完成";
this.btnCheckOk.UseVisualStyleBackColor = true;
this.btnCheckOk.Click += new System.EventHandler(this.btnCheckOk_Click);
//
// AxisControl // AxisControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -207,5 +247,7 @@ namespace TheMachine ...@@ -207,5 +247,7 @@ namespace TheMachine
private System.Windows.Forms.Button btnYellow; private System.Windows.Forms.Button btnYellow;
private System.Windows.Forms.ColorDialog colorDialog1; private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btnCheck;
private System.Windows.Forms.Button btnCheckOk;
} }
} }
...@@ -231,5 +231,52 @@ namespace TheMachine ...@@ -231,5 +231,52 @@ namespace TheMachine
{ {
RobotManage.mainMachine.CloseColor(); RobotManage.mainMachine.CloseColor();
} }
private void btnCheck_Click(object sender, EventArgs e)
{
//判断是否空闲中
if (RobotManage.mainMachine.isInBusy())
{
MessageBox.Show("操作失败:当前忙碌中");
return;
}
if (RobotManage.mainMachine.runStatus != RunStatus.Running)
{
MessageBox.Show("操作失败:设备未在待机状态");
return;
}
DialogResult result=MessageBox.Show("启动料叉检测后需要复位设备,确定启动?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question); ;
if (result.Equals(DialogResult.Yes))
{
LogUtil.info("点击按钮:" + btnCheck.Text + ", 确认开始料叉检测");
RobotManage.mainMachine.StartToCheck();
MessageBox.Show("操作成功:请在料叉到位后进行检查,确认后请点检测完成按钮!");
}
}
private void btnCheckOk_Click(object sender, EventArgs e)
{
if (RobotManage.mainMachine.ResetMoveInfo.IsStep(MoveStep.CH06_WaitCheck))
{
LogUtil.info("点击按钮:" + btnCheck.Text + ", 确认检查完成");
bool result = RobotManage.mainMachine.CheckOk();
LogUtil.info("点击按钮:" + btnCheck.Text + ", CheckOk 结果:" + result);
if(result)
{
MessageBox.Show("操作成功");
}
else
{
MessageBox.Show("操作失败");
}
}
else
{
MessageBox.Show("操作失败");
}
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!