Commit eb08dc23 LN

1

1 个父辈 82abb114
...@@ -331,11 +331,12 @@ ...@@ -331,11 +331,12 @@
日志操作类 日志操作类
</summary> </summary>
</member> </member>
<member name="M:Asa.IOModule.LogFile.#ctor(System.String)"> <member name="M:Asa.IOModule.LogFile.#ctor(System.String,System.String)">
<summary> <summary>
日志 日志
</summary> </summary>
<param name="path">文件夹路径</param> <param name="path">文件夹路径</param>
<param name="args"></param>
</member> </member>
<member name="M:Asa.IOModule.LogFile.Close"> <member name="M:Asa.IOModule.LogFile.Close">
<summary> <summary>
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(766, 708); this.ClientSize = new System.Drawing.Size(961, 708);
this.Controls.Add(this.btnExit); this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnUpdate); this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.lblMsg); this.Controls.Add(this.lblMsg);
......
...@@ -133,7 +133,8 @@ namespace OnlineStore.AssemblyLine ...@@ -133,7 +133,8 @@ namespace OnlineStore.AssemblyLine
AddHealder("BOX_CID", 80); AddHealder("BOX_CID", 80);
AddHealder("BOX报警", 100); AddHealder("BOX报警", 100);
AddHealder("更新时间", 80); AddHealder("更新时间", 80);
AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8); AddHealder("BOX状态", 100);
//AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8);
foreach (MoveEquip move in lineBean.MoveEquipMap.Values) foreach (MoveEquip move in lineBean.MoveEquipMap.Values)
{ {
ListViewItem lvi = new ListViewItem(); ListViewItem lvi = new ListViewItem();
......
...@@ -417,7 +417,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -417,7 +417,7 @@ namespace OnlineStore.DeviceLibrary
//判断是哪个工位有料架 //判断是哪个工位有料架
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{ {
FI_07_ShelfLocationUP(); FI_04_WaitTime();
} }
else else
{ {
...@@ -427,17 +427,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -427,17 +427,15 @@ namespace OnlineStore.DeviceLibrary
} }
return true ; return true ;
} }
/// <summary>
/// 检测到上料工位有料架,缓冲阻挡上升,定位气缸上升,准备入料 private void FI_04_WaitTime()
/// </summary>
private void FI_07_ShelfLocationUP()
{ {
//定位工位有料架,直接开始入料 //定位工位有料架,等待1秒后再次检测
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.FI_04_WaitTime);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升"); InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 等待1秒再次检测");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降 MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
} }
private void LineInStoreProcess() private void LineInStoreProcess()
{ {
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW); IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
...@@ -445,7 +443,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -445,7 +443,7 @@ namespace OnlineStore.DeviceLibrary
//判断是哪个工位有料架 //判断是哪个工位有料架
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{ {
FI_07_ShelfLocationUP(); FI_04_WaitTime();
} }
//阻挡工位有料架,流水线转动一个工位 //阻挡工位有料架,流水线转动一个工位
else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
...@@ -508,7 +506,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -508,7 +506,31 @@ namespace OnlineStore.DeviceLibrary
{ {
LineInStoreProcess(); LineInStoreProcess();
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_04_WaitTime))
{
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
else
{
MoveInfo.EndMove();
runStatus = LineRunStatus.Runing;
LogUtil.info(" 未检测到料架,入料结束");
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_05_WaitS))
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_07_LocationCylinder_Up)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_07_LocationCylinder_Up))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_08_BatchAxisToP2); MoveInfo.NextMoveStep(LineMoveStep.FI_08_BatchAxisToP2);
...@@ -545,20 +567,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -545,20 +567,24 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode); MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:暂时不扫码"); bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:是否需要扫码【"+isScan+"】");
LastCodeList = new List<string>(); LastCodeList = new List<string>();
//MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode()); if (isScan)
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); {
//Task<List<string>> scanTask = Task.Factory.StartNew(delegate MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
//{ MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
// LastCodeList = CodeManager.CameraScan(Config.GetCameraList()); Task<List<string>> scanTask = Task.Factory.StartNew(delegate
// if (LastCodeList.Count <= 0) {
// { LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
// LastCodeList = CodeManager.CameraScan(Config.GetCameraList()); if (LastCodeList.Count <= 0)
// } {
// return LastCodeList; LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
//}); }
return LastCodeList;
});
}
} }
else else
{ {
...@@ -770,7 +796,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -770,7 +796,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove(); MoveInfo.EndMove();
runStatus = LineRunStatus.Runing; runStatus = LineRunStatus.Runing;
// MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun); // MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun);
InStoreLog(" 上料完成, ,料架到达出口处, 通知AGV取空料架, 入料流程结束"); InStoreLog(" 上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束");
AgvClient.ReadyEmpty(Config.AgvOutName); AgvClient.ReadyEmpty(Config.AgvOutName);
} }
......
...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
{ {
// Create new modbus master and add event functions // Create new modbus master and add event functions
aioBox = new AIOBOX(); aioBox = new AIOBOX();
//aioBox.LogPath( Application.StartupPath+@"\logs\aio\"); aioBox.LogPath( Application.StartupPath+@"\logs\aio\");
aioBox.IP = ioIp; aioBox.IP = ioIp;
// bool rtn = aioBox.AutoIP(ioIp); // bool rtn = aioBox.AutoIP(ioIp);
......
...@@ -558,20 +558,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -558,20 +558,27 @@ namespace OnlineStore.DeviceLibrary
/// 入口流水线转动,等待入料检测信号消失 /// 入口流水线转动,等待入料检测信号消失
/// </summary> /// </summary>
FI_03_LineStart = 11003, FI_03_LineStart = 11003,
/// <summary> /// <summary>
/// 入口流水线转动,等待阻挡气缸信号到位 /// 入口流水线转动,等待定位工位信号稳定1秒
/// </summary> /// </summary>
FI_04_LineRunCheck= 11004, FI_04_WaitTime = 11004,
/// <summary> /// <summary>
/// 入口流水线转动,等待入料阻挡信号消失 /// 入口流水线转动,等待定位工位信号稳定1秒
/// </summary> /// </summary>
FI_05_LineStart = 11005, FI_05_WaitS = 11005,
///// <summary>
///// 入口流水线转动,等待阻挡气缸信号到位
///// </summary>
//FI_04_LineRunCheck= 11004,
///// <summary>
///// 入口流水线转动,等待入料阻挡信号消失
///// </summary>
//FI_05_LineStart = 11005,
/// <summary> ///// <summary>
/// 入口流水线转动,等待定位工位检测到位 ///// 入口流水线转动,等待定位工位检测到位
/// </summary> ///// </summary>
FI_06_LineRunCheck = 11006, //FI_06_LineRunCheck = 11006,
/// <summary> /// <summary>
///入料检测: 工位检测信号,定位气缸上升 ///入料检测: 工位检测信号,定位气缸上升
......
...@@ -284,11 +284,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -284,11 +284,7 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
private static bool SendStrToClient(TcpClientBean client, string sendMsg) private static bool SendStrToClient(TcpClientBean client, string sendMsg)
{ {
if (client != null && client.ClientSocket.Connected) if (client != null && client.ClientSocket.Connected)
...@@ -322,6 +318,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -322,6 +318,10 @@ namespace OnlineStore.DeviceLibrary
{ {
ClientMap.Remove(id); ClientMap.Remove(id);
} }
else
{
LogUtil.info("有新的料仓连接上,料仓ID【" + id + "】,地址【" + client.AddStr + "】");
}
ClientMap.Add(id, client); ClientMap.Add(id, client);
} }
} }
...@@ -344,22 +344,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -344,22 +344,21 @@ namespace OnlineStore.DeviceLibrary
private static bool ProcessMsg(TcpClientBean client, string msg) private static bool ProcessMsg(TcpClientBean client, string msg)
{ {
IPEndPoint clientipe = (IPEndPoint)client.ClientSocket.RemoteEndPoint;
string add = clientipe.Address.ToString();
// string[] msgArray = msg.Split(cmd_spilt); // string[] msgArray = msg.Split(cmd_spilt);
msg = msg.Replace("\r", ""); msg = msg.Replace("\r", "");
LogUtil.info("收到【" + add + "】的消息【" + msg + "】"); LogUtil.debug("收到【" + client.AddStr + "】的消息【" + msg + "】");
StoreSendBean storeSMsg = JsonHelper.DeserializeJsonToObject<StoreSendBean>(msg); StoreSendBean storeSMsg = JsonHelper.DeserializeJsonToObject<StoreSendBean>(msg);
if (storeSMsg == null) if (storeSMsg == null)
{ {
LogUtil.error("收到【" + add + "】的消息【" + msg + "】,解析失败"); LogUtil.error("收到【" + client.AddStr + "】的消息【" + msg + "】,解析失败");
} }
else else
{ {
int id = storeSMsg.StoreId; int id = storeSMsg.StoreId;
BoxInfo box = new BoxInfo(storeSMsg.StoreId, storeSMsg.Cid, storeSMsg.Seq, storeSMsg.SStatus, storeSMsg.SRunStatus, storeSMsg.DoorHasTray, storeSMsg.AlarmType, storeSMsg.WaitInStoreList); BoxInfo box = new BoxInfo(storeSMsg.StoreId, storeSMsg.Cid, storeSMsg.Seq, storeSMsg.SStatus, storeSMsg.SRunStatus, storeSMsg.DoorHasTray, storeSMsg.AlarmType, storeSMsg.WaitInStoreList);
SaveBoxClient(id, box, client); SaveBoxClient(id, box, client );
string cmd = storeSMsg.Cmd; string cmd = storeSMsg.Cmd;
if (cmd.StartsWith(cmd_heart)) if (cmd.StartsWith(cmd_heart))
...@@ -367,7 +366,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -367,7 +366,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (cmd.StartsWith(cmd_outend)) else if (cmd.StartsWith(cmd_outend))
{ {
LogUtil.info("收到【" + add + "】的出库完成消息【" + msg + "】"); LogUtil.info("收到【" + client.AddStr + "】的出库完成消息【" + msg + "】");
string posId = storeSMsg.PosId; string posId = storeSMsg.PosId;
int plateH = Convert.ToInt32(storeSMsg.PlateH.Trim()); int plateH = Convert.ToInt32(storeSMsg.PlateH.Trim());
int plateW = Convert.ToInt32(storeSMsg.PlateW.Trim()); int plateW = Convert.ToInt32(storeSMsg.PlateW.Trim());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!