Commit 6e3c379e LN

皮带线456信号修改

1 个父辈 5550ee11
......@@ -144,7 +144,9 @@ agvclien增加cancelState的参数设置.
20200221
agv客户端启动时需要设置状态为none
20200223
1.急停信号增加500ms延迟
2.皮带线456信号修改。
......
......@@ -63,9 +63,11 @@ namespace OnlineStore.DeviceLibrary
{
agvClient.CancelState = isCancel;
}
public static void SetStatus(string id, string shelfId = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low)
public static void SetStatus(string id, string shelfId = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low,bool isMust=false)
{
// ClientAction currA = GetAction(id);
if (!isMust)
{
if (actionMap.ContainsKey(id))
{
ClientAction currA = actionMap[id]; //相同状态就设置一次
......@@ -74,7 +76,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
}
}
agvClient.SetStatus(id, "", shelfId, action, level);
UpdateAction(id, action);
}
......
......@@ -30,17 +30,25 @@ namespace OnlineStore.DeviceLibrary
this.Config = config;
IsDebug = config.IsDebug.Equals(1);
baseConfig = config;
Name = (" " + "_出料皮带线_" +( DeviceID.Equals(301)?"123":"456") + " ").ToUpper();
Name = (" " + "_出料皮带线_" + (DeviceID.Equals(301) ? "123" : "456") + " ").ToUpper();
Init();
UseAxis = false;
MoveInfo = new LineMoveInfo(DeviceID, "[" + Name + "-Move]");
SecondMoveInfo = new LineMoveInfo(DeviceID, "[" + Name + "-SMove]");
int id = DeviceID % 100;
hengyiName = "横移皮带线-"+ ((id - 1) * 3 + 3)+" ";
TrayLine1 = new OutTrayLineBean("移栽皮带线" + "-" +( (id - 1) * 3 + 1)+" ", IO_Type.EntryLocation_Check1, IO_Type.ExitLocation_Check1, IO_Type.ExitTray_Check1, IO_Type.DLine_Run1, IO_Type.EntryTray_Check3, this.DeviceID);
TrayLine2 = new OutTrayLineBean("移栽皮带线" + "-" +( (id - 1) * 3 + 2)+" ", IO_Type.EntryLocation_Check2, IO_Type.ExitLocation_Check2, IO_Type.ExitTray_Check2, IO_Type.DLine_Run2, IO_Type.MiddleTray_Check3, this.DeviceID);
hengyiName = "横移皮带线-" + ((id - 1) * 3 + 3) + " ";
if (id.Equals(1))
{
TrayLine1 = new OutTrayLineBean("移栽皮带线" + "-" + ((id - 1) * 3 + 1) + " ", IO_Type.EntryLocation_Check1, IO_Type.ExitLocation_Check1, IO_Type.ExitTray_Check1, IO_Type.DLine_Run1, IO_Type.EntryTray_Check3, this.DeviceID);
TrayLine2 = new OutTrayLineBean("移栽皮带线" + "-" + ((id - 1) * 3 + 2) + " ", IO_Type.EntryLocation_Check2, IO_Type.ExitLocation_Check2, IO_Type.ExitTray_Check2, IO_Type.DLine_Run2, IO_Type.MiddleTray_Check3, this.DeviceID);
}
else
{
TrayLine1 = new OutTrayLineBean("移栽皮带线" + "-" + ((id - 1) * 3 + 1) + " ", IO_Type.EntryLocation_Check1, IO_Type.ExitLocation_Check1, IO_Type.ExitTray_Check1, IO_Type.DLine_Run1, IO_Type.MiddleTray_Check3, this.DeviceID);
TrayLine2 = new OutTrayLineBean("移栽皮带线" + "-" + ((id - 1) * 3 + 2) + " ", IO_Type.EntryLocation_Check2, IO_Type.ExitLocation_Check2, IO_Type.ExitTray_Check2, IO_Type.DLine_Run2, IO_Type.EntryTray_Check3, this.DeviceID);
}
Line3Turn = new LineTurnBean(DeviceID);
if((DeviceID%100).Equals(1))
if ((DeviceID % 100).Equals(1))
{
Line3MaxPosition = 13;
}
......@@ -195,11 +203,15 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.DLine_SuddenStop).Equals(IO_VALUE.LOW))
{
LogUtil.error(Name + "收到急停信号,等待500后再次验证急停");
Thread.Sleep(500);
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
SetWarnMsg(Name + "收到急停信号");
Alarm(LineAlarmType.SuddenStop);
return;
}
}
if (IOValue(IO_Type.DLine_Reset).Equals(IO_VALUE.HIGH))
{
......
......@@ -19,6 +19,7 @@ namespace OnlineStore.DeviceLibrary
public FeedingEquip_Config Config;
public bool OutEndSendShelfOut = false;
public string CurrShelfId = "";//当前的料架ID
public string LastOutShelfId = "";//最后一个出口
public AxisBean BatchAxis = null;
public FeedingEquip(string cid, FeedingEquip_Config config)
{
......@@ -270,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SL_Out_Check).Equals(IO_VALUE.HIGH))
{
LogInfo("重置完成,出口检测到有料架,调用 " + Config.AgvOutName + " AgvClient.NeedLeave");
AgvClient.NeedLeave(Config.AgvOutName);
AgvClient.NeedLeave(Config.AgvOutName, LastOutShelfId);
}
MoveEndS();
break;
......@@ -325,13 +326,18 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.SL_SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
if (isInSuddenDown.Equals(false))
LogUtil.error(Name + "收到急停信号,等待500后再次验证急停");
Thread.Sleep(500);
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
SetWarnMsg(Name + "收到急停信号");
if (isInSuddenDown.Equals(false))
{
Alarm(LineAlarmType.SuddenStop);
}
return;
}
}
if (IOValue(IO_Type.SL_Reset_BTN).Equals(IO_VALUE.HIGH))
{
......@@ -386,7 +392,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SL_Out_Check).Equals(IO_VALUE.HIGH))
{
//线体出口检测到料架,需要通知AGV小车
AgvClient.NeedLeave(Config.AgvOutName);
AgvClient.NeedLeave(Config.AgvOutName, LastOutShelfId);
// SendShelfToAGV();
}
else
......@@ -696,11 +702,11 @@ namespace OnlineStore.DeviceLibrary
//停止转动 ,阻挡上升
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.LOW);
AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.FinishLeave);
AgvClient.SetStatus(Config.AgvOutName, LastOutShelfId, ClientAction.FinishLeave,ClientLevel.High,true);
Task.Factory.StartNew(delegate
{
Thread.Sleep(10000);
AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.None, ClientLevel.High);
AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.None, ClientLevel.High, true);
});
ProcessShelfOut = false;
LogUtil.info(logName + " 结束");
......@@ -754,11 +760,11 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(3000);
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
//料架可离开
AgvClient.SetStatus(Config.AgvInName,"",ClientAction.FinishEnter,ClientLevel.High);
AgvClient.SetStatus(Config.AgvInName,"",ClientAction.FinishEnter, ClientLevel.High, true);
Task.Factory.StartNew(delegate
{
Thread.Sleep(10000);
AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None, ClientLevel.High);
AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None, ClientLevel.High, true);
});
ProcessShelfEnter = false;
LogUtil.info(logName + " 结束");
......
......@@ -840,8 +840,9 @@ namespace OnlineStore.DeviceLibrary
{
MoveEndS();
// MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun);
InLog("上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束");
AgvClient.NeedLeave(Config.AgvOutName,CurrShelfId);
LastOutShelfId = CurrShelfId;
InLog("上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束,更新LastOutShelfId=" + LastOutShelfId);
AgvClient.NeedLeave(Config.AgvOutName, LastOutShelfId);
}
#endregion
......
......@@ -338,7 +338,7 @@ namespace OnlineStore.DeviceLibrary
MoveEndS();
// MoveInfo.NextMoveStep(LineMoveStep.FO_39_OutLineRun);
OutLog("送出料串: " + MoveInfo.SLog + ", 出口线体运转,料架到达出口处, 通知AGV取空料架, 出料结束");
AgvClient.NeedLeave(Config.AgvOutName,CurrShelfId);
AgvClient.NeedLeave(Config.AgvOutName, LastOutShelfId);
}
else if (MoveInfo.MoveStep >= LineMoveStep.FO_211_AxisDownMove && MoveInfo.MoveStep < LineMoveStep.FO_30_BatchAxisToP2)
{
......@@ -515,8 +515,27 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FO_30_BatchAxisToP2);
OutStoreHeight = -1;
OutLog("紧急出料完成, " + MoveInfo.SLog + ":"+msg+ ",送出料串,提升伺服到P2点,重置OutStoreHeight=-1");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
//包装料会发往分盘区, 紧急料区, 包装线区
// urgentReel 这个为true是紧急料 出到紧急料区
// cutReel 为true是分盘料,AGV会拉到到分盘区
//料串会发到分盘区和紧急料区
//两个都为false 包装料默认拉到包装线体, 料串默认拉到紧急料区
if (MoveInfo.MoveParam.urgentReel)
{
//紧急料,需要到紧急料区
LastOutShelfId = CurrShelfId + ",urgent";
}
else if (MoveInfo.MoveParam.cutReel)
{
//cutReel 为true是分盘料,AGV会拉到到分盘区
LastOutShelfId = CurrShelfId + ",cut";
}
else
{
LastOutShelfId = CurrShelfId + ",urgent";
}
OutLog("紧急出料完成, " + MoveInfo.SLog + ":" + msg + ",送出料串,提升伺服到P2点,重置OutStoreHeight=-1,更新LastOutShelfId=" + LastOutShelfId);
}
#endregion
}
......
......@@ -261,20 +261,10 @@ namespace OnlineStore.DeviceLibrary
StartTime = DateTime.Now;
LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString());
// rfidList = new List<string>();
RFIDManager.Open();
Thread.Sleep(5);
////连接AGV调度
//if (!AgvClient.ISConnected())
//{
//}
AgvClient.SetCancelState(false);
LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort));
RHomeOp();
......@@ -581,9 +571,14 @@ namespace OnlineStore.DeviceLibrary
//急停按钮和气压检测按钮需要一起使用
if (suddenBtn.Equals(IO_VALUE.LOW))
{
LogUtil.error(Name + "收到急停信号,等待500后再次验证急停");
Thread.Sleep(500);
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
SetWarnMsg("收到急停信号,报警急停");
Alarm(LineAlarmType.SuddenStop);
}
}
if (fuweiValue.Equals(IO_VALUE.HIGH) && (!fuweiValue.Equals(lastFuwei)))
{
if (suddenBtn.Equals(IO_VALUE.LOW))
......
......@@ -313,7 +313,7 @@ namespace OnlineStore.DeviceLibrary
if (equipBean.Line3TurnIsStop() && equipBean.IOValue(Line3_TrayCheck).Equals(IO_VALUE.LOW))
{
Line3CanRun = false;
LogUtil.info(Name+ "出口有料盘,转动一个工位,["+LineRun_Do+"] ["+ExitLocation_Check+"]");
LogUtil.info(Name+ "出口有料盘,且"+ Line3_TrayCheck + "=LOW,转动一个工位,["+LineRun_Do+"] ["+ExitLocation_Check+"]");
lineRun.StartLineRun(LineRun_Do, ExitLocation_Check, LineEndProcess);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!