Commit 0925a58d 张东亮

进出轴回原时相对运动值开放

1 个父辈 67761f20
......@@ -36,7 +36,8 @@
<add key="IsInDebug" value="1" />
<add key ="Server_Log_Open" value ="1"/>
<add key ="HumidityParam" value ="35"/>
<add key ="UseAlarmBuzzer" value ="1"/>
<add key ="UseAlarmBuzzer" value ="1"/>
<add key ="Inout_Relative" value ="2500"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -881,6 +881,8 @@ namespace OnlineStore.ACSquareStore
{
store.autoNext = false;
btnStartAuTo.Text = "开始自动出入库";
if (store.waitOutStoreList.Count > 0)
store.waitOutStoreList.Clear();
}
else
{
......
......@@ -94,6 +94,6 @@ namespace OnlineStore.Common
public static string UseTrayCheck = "UseTrayCheck";
public static string HumidityParam = "HumidityParam";
public static string Inout_Relative = "Inout_Relative";
}
}
......@@ -75,7 +75,7 @@ namespace OnlineStore.DeviceLibrary
}
public static void ClearSpeed()
public static void ClearSpeed()
{
LogUtil.info("清理之前设置保存的速度列表");
ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
......@@ -325,7 +325,7 @@ namespace OnlineStore.DeviceLibrary
int isHomeEnd = GetHomeEndStatus(portName, slvAddr);
if (isHomeEnd.Equals(1))
{
int value = 2000;
int value = ConfigAppSettings.GetIntValue(Setting_Init.Inout_Relative);
LogUtil.info("轴【" + portName + "_" + slvAddr + "】原点返回时发现原点已亮且回过原点,需要先相对走" + value);
RelMove(portName, slvAddr, value);
bool isStop = false;
......@@ -359,7 +359,8 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(100);
}
}
}catch (Exception ex)
}
catch (Exception ex)
{
LogUtil.error("轴【" + portName + "_" + slvAddr + "】原点返回前验证是否在原点出错:" + ex.StackTrace);
}
......
......@@ -1476,8 +1476,8 @@ namespace OnlineStore.DeviceLibrary
}
}
HumitureController.QueryData(Config.GetHumpPortList().ToArray());
HumidityProcess();
// HumitureController.QueryData(Config.GetHumpPortList().ToArray());
//HumidityProcess();
LedProcess();
}catch(Exception ex)
{
......
......@@ -321,12 +321,40 @@ namespace OnlineStore.DeviceLibrary
CloseDoor(StoreMove.MoveParam.PosInfo.ShelfType);
InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1);
}
/// <summary>
/// 打印轴状态
/// </summary>
/// <param name="moveInfo"></param>
private void PrintAxisSts(StoreMoveInfo moveInfo)
{
List<WaitResultInfo> list = moveInfo.WaitList;
int cutWLcount = list.Count;
if (list.Count <= 0)
{
return;
}
foreach (WaitResultInfo wait in list)
{
if (wait.IsEnd)
{
continue;
}
if (wait.WaitType.Equals(1))
{
string msg = "";
{
KTK_Store.ACAxisStsInMove(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
}
}
}
}
protected override void InStoreProcess()
{
LineMoveP moveP = StoreMove.MoveParam.MoveP;
if (StoreMove.IsInWait)
{
PrintAxisSts(StoreMove);
CheckWait();
}
if (StoreMove.IsInWait)
......@@ -537,6 +565,7 @@ namespace OnlineStore.DeviceLibrary
LineMoveP moveP = StoreMove.MoveParam.MoveP;
if (StoreMove.IsInWait)
{
PrintAxisSts(StoreMove);
CheckWait();
}
if (StoreMove.IsInWait)
......
......@@ -251,7 +251,23 @@ namespace OnlineStore.DeviceLibrary
moveAxis.TargetPosition = targetPosition;
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
}
/// <summary>
/// 运动过程中轴状态打印
/// </summary>
public static bool ACAxisStsInMove(ConfigMoveAxis axis, int targetPosition, int targetSpeed, out string msg)
{
msg = "";
string deviceName = axis.DeviceName;
short axisNo = axis.GetAxisValue();
bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
int targetCount = ACServerManager.GetTargetPosition(deviceName, axisNo);
int state = ACServerManager.GetHomeSingle(deviceName, axisNo);
//实时打印轴状态
LogUtil.LOGGER.Debug($" 轴实时状态打印:{axis.DisplayStr},目标位置[{targetPosition}]当前位置[{outCount}]规划位置[{targetCount}]原点状态[{state}]");
return false;
}
/// <summary>
/// 判断AC伺服电机轴是否运动完成
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!