Commit 7dc49e34 LN

调试修改

1 个父辈 b38ed426
...@@ -75,11 +75,12 @@ ...@@ -75,11 +75,12 @@
错误信息 错误信息
</summary> </summary>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.LogPath(System.String)"> <member name="M:Asa.IOModule.AIOBOX.LogPath(System.String,Asa.IOModule.LogType)">
<summary> <summary>
日志路径,连接前设置路径会自动保存日志 日志路径,连接前设置路径会自动保存日志
</summary> </summary>
<param name="path">文件夹路径</param> <param name="path">文件夹路径</param>
<param name="type">输出类型</param>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.SetInput(Asa.IOModule.Box_Type,System.Int32)"> <member name="M:Asa.IOModule.AIOBOX.SetInput(Asa.IOModule.Box_Type,System.Int32)">
<summary> <summary>
...@@ -326,6 +327,21 @@ ...@@ -326,6 +327,21 @@
闭合,打开,高电平 闭合,打开,高电平
</summary> </summary>
</member> </member>
<member name="T:Asa.IOModule.LogType">
<summary>
日志类型
</summary>
</member>
<member name="F:Asa.IOModule.LogType.OnlyError">
<summary>
仅错误信息
</summary>
</member>
<member name="F:Asa.IOModule.LogType.All">
<summary>
所有
</summary>
</member>
<member name="T:Asa.IOModule.LogFile"> <member name="T:Asa.IOModule.LogFile">
<summary> <summary>
日志操作类 日志操作类
...@@ -336,7 +352,7 @@ ...@@ -336,7 +352,7 @@
日志 日志
</summary> </summary>
<param name="path">文件夹路径</param> <param name="path">文件夹路径</param>
<param name="args"></param> <param name="ip"></param>
</member> </member>
<member name="M:Asa.IOModule.LogFile.Close"> <member name="M:Asa.IOModule.LogFile.Close">
<summary> <summary>
......
...@@ -240,32 +240,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -240,32 +240,32 @@ namespace OnlineStore.DeviceLibrary
//阻挡气缸移动 //阻挡气缸移动
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降"); InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_10_WaitBox)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_10_WaitBox))
{ {
MoveInfo.NextMoveStep(LineMoveStep.MI_10_BeforeAfterCylinderBefore); MoveInfo.NextMoveStep(LineMoveStep.MI_10_BeforeAfterCylinderBefore);
InLog("入库:(MI_10_BeforeAfterCylinderBefore,前后气缸1前进"); InLog("入库:(MI_10_BeforeAfterCylinderBefore,前后气缸1前进");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before); CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_10_BeforeAfterCylinderBefore)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_10_BeforeAfterCylinderBefore))
{ {
MoveInfo.NextMoveStep(LineMoveStep.MI_11_UpDownCylinderDown); MoveInfo.NextMoveStep(LineMoveStep.MI_11_UpDownCylinderDown);
InLog("入库 " + MoveInfo.SLog + " ,上下气缸1下降"); InLog("入库 " + MoveInfo.SLog + " ,上下气缸1下降");
UpdownDownP3Move(MoveInfo.MoveParam.PlateH); UpdownDownP3Move(MoveInfo.MoveParam.PlateH);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_11_UpDownCylinderDown)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_11_UpDownCylinderDown))
{ {
MoveInfo.NextMoveStep(LineMoveStep.MI_12_ClampCylinderTighten); MoveInfo.NextMoveStep(LineMoveStep.MI_12_ClampCylinderTighten);
InLog("入库 " + MoveInfo.SLog + ",夹料气缸1放松"); InLog("入库 " + MoveInfo.SLog + ",夹料气缸1放松");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten); CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_12_ClampCylinderTighten)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_12_ClampCylinderTighten))
{ {
MoveInfo.NextMoveStep(LineMoveStep.MI_13_UpdownCylinderUp); MoveInfo.NextMoveStep(LineMoveStep.MI_13_UpdownCylinderUp);
InLog("入库 " + MoveInfo.SLog + ",上下气缸1上升"); InLog("入库 " + MoveInfo.SLog + ",上下气缸1上升");
UpdownUpMove(); UpdownUpMove();
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_13_UpdownCylinderUp)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_13_UpdownCylinderUp))
......
...@@ -73,7 +73,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -73,7 +73,7 @@ namespace OnlineStore.DeviceLibrary
private void MO_14_TopCylinder_Down() private void MO_14_TopCylinder_Down()
{ {
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
OutLog("放托盘(放开阻挡)" + MoveInfo.SLog + " 物品已移走,顶升气缸1下降"); OutLog("放托盘(放开阻挡)" + MoveInfo.SLog + " 物品已移走,顶升气缸1下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
if (Config.SidesWayNum <= 0) if (Config.SidesWayNum <= 0)
{ {
...@@ -523,7 +523,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -523,7 +523,14 @@ namespace OnlineStore.DeviceLibrary
{ {
return true; return true;
} }
return outline.MoveInfo.MoveStep.Equals(LineMoveStep.DLO_04_CanReviceTray); if (outline.MoveInfo.MoveStep.Equals(LineMoveStep.DLO_04_CanReviceTray))
{
return true;
}
else if (outline.MoveInfo.Equals(LineMoveType.None))
{
outline.StartOut(MoveInfo.MoveParam);
}
} }
else else
{ {
......
...@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
string server = GetAddr(Addr_PosForPutin, paramMap); string server = GetAddr(Addr_PosForPutin, paramMap);
//string server = GetAddr(Addr_PosForPutin) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr; //string server = GetAddr(Addr_PosForPutin) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr;
LogUtil.info(deviceName + "托盘【" + trayNum + "】 条码<< " + codeStr + ",获取入库PosID:" + server); LogUtil.info(deviceName + "托盘【" + trayNum + "】 条码<< " + codeStr + ",获取入库PosID:" );
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
LogUtil.info("CodeReceived 【" + server + "】【" + resultStr + "】"); LogUtil.info("CodeReceived 【" + server + "】【" + resultStr + "】");
......
...@@ -118,7 +118,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -118,7 +118,8 @@ namespace OnlineStore.DeviceLibrary
aioBox.Close(); aioBox.Close();
aioBox = null; aioBox = null;
} }
}catch(Exception ex) }
catch (Exception ex)
{ {
LogUtil.error("关闭Io模块【" + ioIp + "】出错:" + ex); LogUtil.error("关闭Io模块【" + ioIp + "】出错:" + ex);
} }
...@@ -149,7 +150,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,7 +150,8 @@ 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\", LogType.OnlyError);
aioBox.IP = ioIp; aioBox.IP = ioIp;
// bool rtn = aioBox.AutoIP(ioIp); // bool rtn = aioBox.AutoIP(ioIp);
...@@ -158,16 +160,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -158,16 +160,16 @@ namespace OnlineStore.DeviceLibrary
aioBox.SetOutput(Asa.IOModule.Box_Type.DO, DOLength); aioBox.SetOutput(Asa.IOModule.Box_Type.DO, DOLength);
//DI主动上传 //DI主动上传
aioBox.AutoReadInput(true); aioBox.AutoReadInput(true);
aioBox.AutoReadOutput(false,DOMS); aioBox.AutoReadOutput(false, DOMS);
aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ; aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ;
aioBox.DO_Changed_Event += AioBox_DO_Changed_Event; aioBox.DO_Changed_Event += AioBox_DO_Changed_Event;
// aioBox.Log_Out_Event += AioBox_Log_Out_Event; // aioBox.Log_Out_Event += AioBox_Log_Out_Event;
//aioBox.Log_RxTx_Event += AioBox_Log_RxTx_Event; //aioBox.Log_RxTx_Event += AioBox_Log_RxTx_Event;
LogUtil.debug("开始连接" + logName + ",尝试重连3次"); LogUtil.debug("开始连接" + logName + ",尝试重连3次");
for (int i = 1; i <= conCount; i++) for (int i = 1; i <= conCount; i++)
{ {
bool result = aioBox.Connect(); bool result = aioBox.Connect();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!