Commit 0fae4079 刘韬

修正压紧轴定期回原是被打断后无法再次回原的问题

1 个父辈 d7a1c0e7
此文件类型无法预览
using HuichuanLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
......@@ -241,14 +242,14 @@ namespace DeviceLibrary
public static bool HomeMoveIsEnd(MoveInfo MoveInfo, ConfigMoveAxis axis, out string msg)
{
msg = "";
if (AxisManager.IsHomeMoveEnd(axis.DeviceName, axis.GetAxisValue()))// || AxisManager.AxisStsINP(axis.DeviceName, axis.GetAxisValue()).Equals(1))
var HomeLowSpeed = axis.HomeLowSpeed > 0 ? axis.HomeLowSpeed : axis.HomeHighSpeed / 10;
var HomeAddSpeed = axis.HomeAddSpeed > 0 ? axis.HomeAddSpeed : axis.HomeHighSpeed * 5;
if (AxisManager.IsHomeMoveEnd(axis.DeviceName, axis.GetAxisValue()) || AxisManager.GetBusyStatus(axis.DeviceName, axis.GetAxisValue()).Equals(0))// || AxisManager.AxisStsINP(axis.DeviceName, axis.GetAxisValue()).Equals(1))
{
//原点完成并且位置=0
//编码器位置
int outCount = AxisManager.GetActualtPosition(axis.DeviceName, axis.GetAxisValue());
//规划位置
int outTarget = AxisManager.GetTargetPosition(axis.DeviceName, axis.GetAxisValue());
AxisSts axisS = HCBoardManager.GetAxisSts(axis.GetAxisValue());
int errorCount = Math.Abs(outCount);
if (errorCount <= axis.CanErrorCountMax)
{
......@@ -257,18 +258,14 @@ namespace DeviceLibrary
//判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0)
{
string msg1 = $"{MoveInfo.Name} {axis.DisplayStr} 收到原点完成信号,当前位置{outCount},规划位置{outTarget},重新回原点,剩余[{MoveInfo.CanWhileCount}]]次。{axisS.ToStr()}";
LogUtil.error(msg1);
LogUtil.error(MoveInfo.Name + axis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
var HomeLowSpeed = axis.HomeLowSpeed > 0 ? axis.HomeLowSpeed : axis.HomeHighSpeed / 10;
var HomeAddSpeed = axis.HomeAddSpeed > 0 ? axis.HomeAddSpeed : axis.HomeHighSpeed * 5;
AxisManager.HomeMove(axis.DeviceName, (short)axis.GetAxisValue(), axis.HomeHighSpeed, HomeLowSpeed, HomeAddSpeed);
AxisManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed, HomeLowSpeed, HomeAddSpeed);
MoveInfo.CanWhileCount--;
}
else
{
msg = $"{MoveInfo.Name} {MoveInfo.MoveStep} {axis.DisplayStr} ,收到原点完成信号,当前位置[{outCount}],规划位置{outTarget},误差过大,需要报警。{axisS.ToStr()}";
msg = MoveInfo.Name + " " + MoveInfo.MoveStep + axis.DisplayStr + crc.GetString("Res0006.405c5a9e", ",收到原点完成信号,当前位置[") + outCount + crc.GetString("Res0007.6658614e", "],误差过大,需要报警");
LogUtil.error(msg);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!