Commit 29f10494 LN

rfid增加日志

1 个父辈 1f248698
...@@ -29,8 +29,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -29,8 +29,8 @@ namespace OnlineStore.DeviceLibrary
Init(); Init();
UseAxis = true; UseAxis = true;
Config.SetAxisParam(); Config.SetAxisParam();
UpdownAxis = new AxisBean(config.UpDown_Axis); UpdownAxis = new AxisBean( config.UpDown_Axis,Name);
BatchAxis = new AxisBean(config.Batch_Axis); BatchAxis = new AxisBean( config.Batch_Axis,Name);
MoveInfo = new LineMoveInfo(DeviceID, "入料-" + DeviceID + "-Move"); MoveInfo = new LineMoveInfo(DeviceID, "入料-" + DeviceID + "-Move");
SecondMoveInfo = new LineMoveInfo(DeviceID, "入料-" + DeviceID + "-SecondMove"); SecondMoveInfo = new LineMoveInfo(DeviceID, "入料-" + DeviceID + "-SecondMove");
} }
......
...@@ -10,6 +10,7 @@ using System.Text; ...@@ -10,6 +10,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers; using System.Timers;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
...@@ -173,6 +174,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -173,6 +174,8 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(5); Thread.Sleep(5);
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
string path = Application.StartupPath + @"\logs\rfid\";
RFIDManager.RfidReader.LogPath(path);
string[] rfidArray = rfidList.ToArray(); string[] rfidArray = rfidList.ToArray();
//连接rfip //连接rfip
RFIDManager.RfidReader.Open(rfidArray); RFIDManager.RfidReader.Open(rfidArray);
...@@ -695,10 +698,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -695,10 +698,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info( Name + "收到复位信号,开始复位!"); LogUtil.info( Name + "收到复位信号,开始复位!");
Reset(); Reset();
} }
} }
// FeederProcess();
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -846,8 +846,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -846,8 +846,7 @@ namespace OnlineStore.DeviceLibrary
} }
return isReviceInfo; return isReviceInfo;
} }
#endregion #endregion
internal override void StopMove() internal override void StopMove()
{ {
...@@ -920,9 +919,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -920,9 +919,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "所有移栽模块复位完成,打开流水线,开始运转!"); LogUtil.info(Name + "所有移栽模块复位完成,打开流水线,开始运转!");
} }
} }
} }
public string GetMoveStr() public string GetMoveStr()
{ {
string msg = ""; string msg = "";
......
...@@ -43,7 +43,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -43,7 +43,7 @@ namespace OnlineStore.DeviceLibrary
Config.UpDown_Axis.ServerOnDO = IO_Type.UpDownAxis_ServoOn; Config.UpDown_Axis.ServerOnDO = IO_Type.UpDownAxis_ServoOn;
Config.UpDown_Axis.BreakOnDO = IO_Type.UpDownAxis_BreakOn; Config.UpDown_Axis.BreakOnDO = IO_Type.UpDownAxis_BreakOn;
} }
UpdownAxis=new AxisBean (config.UpDown_Axis); UpdownAxis=new AxisBean (config.UpDown_Axis,Name);
} }
public override bool StartRun(bool isDebug=false) public override bool StartRun(bool isDebug=false)
...@@ -132,6 +132,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -132,6 +132,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
DebugInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始"); DebugInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始");
UpdownUpMove(); UpdownUpMove();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break; break;
case LineMoveStep.MH_UpDownCylinder_Up: case LineMoveStep.MH_UpDownCylinder_Up:
......
...@@ -42,7 +42,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -42,7 +42,7 @@ namespace OnlineStore.DeviceLibrary
Config.UpDown_Axis.ServerOnDO = IO_Type.UpDownAxis_ServoOn; Config.UpDown_Axis.ServerOnDO = IO_Type.UpDownAxis_ServoOn;
Config.UpDown_Axis.BreakOnDO = IO_Type.UpDownAxis_BreakOn; Config.UpDown_Axis.BreakOnDO = IO_Type.UpDownAxis_BreakOn;
} }
UpdownAxis = new AxisBean(config.UpDown_Axis); UpdownAxis = new AxisBean(config.UpDown_Axis,Name);
} }
public override bool StartRun(bool isDebug=false) public override bool StartRun(bool isDebug=false)
...@@ -123,6 +123,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -123,6 +123,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
LogInfo(MoveInfo.MoveType + " : (上下轴原点返回完成,上下轴走到待机点 )开始"); LogInfo(MoveInfo.MoveType + " : (上下轴原点返回完成,上下轴走到待机点 )开始");
UpdownUpMove(); UpdownUpMove();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break; break;
case LineMoveStep.MH_UpDownCylinder_Up: case LineMoveStep.MH_UpDownCylinder_Up:
MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back); MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back);
...@@ -254,11 +255,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -254,11 +255,13 @@ namespace OnlineStore.DeviceLibrary
if (UseAxis) if (UseAxis)
{ {
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownHomeMove); MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownHomeMove);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
UpdownAxis.HomeMove(MoveInfo); UpdownAxis.HomeMove(MoveInfo);
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up); MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up); CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
} }
} }
......
...@@ -41,6 +41,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -41,6 +41,10 @@ namespace OnlineStore.DeviceLibrary
{ {
return data.Num; return data.Num;
} }
else
{
LogUtil.error("RFID [ " + ip + " ] 读到数据 " + data.ToStr() + " 返回盘号 0");
}
return 0; return 0;
} }
......
...@@ -19,10 +19,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -19,10 +19,10 @@ namespace OnlineStore.DeviceLibrary
public int LastPosition = 0; public int LastPosition = 0;
public string AxisName; public string AxisName;
public AxisBean(ConfigMoveAxis axisConfig) public AxisBean(ConfigMoveAxis axisConfig, string deviceName)
{ {
this.Config = axisConfig; this.Config = axisConfig;
AxisName = Config.Explain + "[" + Config.DeviceName + "-" + Config.GetAxisValue() + "]"; AxisName = deviceName + " " + Config.Explain + "[" + Config.DeviceName + "-" + Config.GetAxisValue() + "]";
} }
...@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary
public void HomeMove(LineMoveInfo MoveInfo) public void HomeMove(LineMoveInfo MoveInfo)
{ {
Config.TargetPosition = 0; Config.TargetPosition = 0;
LogUtil.info(Config.DisplayStr + "speed[" + Config.TargetSpeed + "]开始原点返回"); LogUtil.info(AxisName + "speed[" + Config.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, true)); MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, true));
ACServerManager.HomeMove(Config.DeviceName, (short)Config.GetAxisValue(), Config.HomeHighSpeed); ACServerManager.HomeMove(Config.DeviceName, (short)Config.GetAxisValue(), Config.HomeHighSpeed);
} }
...@@ -145,7 +145,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -145,7 +145,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动 //判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error(axis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount + LogUtil.error(MoveInfo.Name + axis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次"); "],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.SuddenStop(axis.DeviceName, axis.GetAxisValue()); ACServerManager.SuddenStop(axis.DeviceName, axis.GetAxisValue());
ACServerManager.AbsMove(axis.DeviceName, axis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(axis.DeviceName, axis.GetAxisValue(), targetPosition, targetSpeed);
...@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
msg = " " + MoveInfo.SLog + axis.DisplayStr + ",目标位置[" + targetPosition + "]当前位置[" + outCount msg = " " + MoveInfo.SLog + MoveInfo.Name + axis.DisplayStr + ",目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警"; + "],误差过大,需要报警";
LogUtil.error(msg, 1034); LogUtil.error(msg, 1034);
} }
...@@ -175,14 +175,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -175,14 +175,14 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动 //判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error(axis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次"); LogUtil.error(MoveInfo.Name + axis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点"); //LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed); ACServerManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed);
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
} }
else else
{ {
msg = " " + MoveInfo.SLog + axis.DisplayStr + ",收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; msg =MoveInfo.Name+ " " + MoveInfo.SLog + axis.DisplayStr + ",收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(msg); LogUtil.error(msg);
} }
} }
...@@ -220,7 +220,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -220,7 +220,7 @@ namespace OnlineStore.DeviceLibrary
{ {
ACServerManager.SuddenStop(Config.DeviceName, Config.GetAxisValue()); ACServerManager.SuddenStop(Config.DeviceName, Config.GetAxisValue());
} }
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!