Commit 7dc12ba0 张东亮

agv对接滚筒停止根据停止接口,不按照信号

1 个父辈 62275c92
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Security.Cryptography;
using System.Web.Http;
......@@ -56,6 +57,8 @@ namespace WebApi.Controllers
}
else
{
RobotManage.mainMachine.IOMove(IO_Type.RightMoto_Reverse, IO_VALUE.HIGH, false, 500);
RobotManage.mainMachine.RightMoveInfo.log($"电滚停止");
result.status = "IDLE";
}
break;
......@@ -72,6 +75,8 @@ namespace WebApi.Controllers
}
else
{
RobotManage.mainMachine.IOMove(IO_Type.LeftMoto_Reverse, IO_VALUE.HIGH, false, 500);
RobotManage.mainMachine.LeftMoveInfo.log($"电滚停止");
result.status = "IDLE";
}
break;
......
......@@ -12,10 +12,10 @@ namespace DeviceLibrary
{
partial class MainMachine
{
public void StopMove(bool ServoOff=false)
public void StopMove(bool ServoOff = false)
{
runStatus = RunStatus.Stop;
MoveInfo.List.ForEach((m)=> { m.EndMove(); });
MoveInfo.List.ForEach((m) => { m.EndMove(); });
AxisBean.StopMultiAxis(AxisBean.List);
if (ServoOff)
......@@ -76,7 +76,7 @@ namespace DeviceLibrary
else if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{
ConfigIO io = RobotManage.Config.getWaitIO(wait.IoType);
NotOkMsg = crc.GetString("Res0104","等待")+"【" + io.DisplayStr + "】=【" + wait.IoValue + "】";
NotOkMsg = crc.GetString("Res0104", "等待") + "【" + io.DisplayStr + "】=【" + wait.IoValue + "】";
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue);
if (!wait.IsEnd)
{
......@@ -84,8 +84,8 @@ namespace DeviceLibrary
if (span.TotalMilliseconds > timeOutMs && NoAlarm())
{
WarnMsg = Name + "[" + MoveInfo.MoveStep + "] "+crc.GetString("Res0104","等待")+"(" + io.DisplayStr + "=" + wait.IoValue + ") "+crc.GetString("Res0105","超时");
WarnMsg = Name + "[" + MoveInfo.MoveStep + "] " + crc.GetString("Res0104", "等待") + "(" + io.DisplayStr + "=" + wait.IoValue + ") " + crc.GetString("Res0105", "超时");
Msg.add(WarnMsg, MsgLevel.warning);
if (NoAlarm())
{
......@@ -128,7 +128,7 @@ namespace DeviceLibrary
{
axisBean.SuddenStop();
}
wait.IsEnd=true;
wait.IsEnd = true;
}
else
{
......@@ -151,7 +151,7 @@ namespace DeviceLibrary
}
}
if (wait.IsEnd)
{
{
if (MoveInfo.OneWaitCanEndStep)
{
isOk = true;
......@@ -175,7 +175,7 @@ namespace DeviceLibrary
else if (span.TotalSeconds > MoveInfo.TimeOutSeconds)
{
LogUtil.error($"MoveInfo.MoveStep:{span.TotalSeconds}>{MoveInfo.TimeOutSeconds}");
WarnMsg = Name + "[" + MoveInfo.MoveStep + "]"+crc.GetString("Res0104","等待") + NotOkMsg + crc.GetString("Res0105","超时")+"[" + Math.Round(span.TotalSeconds, 1) + "]"+crc.GetString("Res0106","秒");
WarnMsg = Name + "[" + MoveInfo.MoveStep + "]" + crc.GetString("Res0104", "等待") + NotOkMsg + crc.GetString("Res0105", "超时") + "[" + Math.Round(span.TotalSeconds, 1) + "]" + crc.GetString("Res0106", "秒");
int second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
if (second > 120)
......@@ -188,7 +188,7 @@ namespace DeviceLibrary
}
LogUtil.error(WarnMsg, logType + 100, second);
//MoveInfo.errlog(WarnMsg);
Alarm(AlarmType.IoSingleTimeOut, WarnMsg);
Alarm(AlarmType.IoSingleTimeOut, WarnMsg);
Msg.add(WarnMsg, MsgLevel.alarm);
}
return true;
......@@ -213,7 +213,8 @@ namespace DeviceLibrary
LogUtil.error(Name + " 报警,报警类型:" + _alarmType);
if (this.alarmType == AlarmType.SuddenStop && _alarmType == AlarmType.None) {
if (this.alarmType == AlarmType.SuddenStop && _alarmType == AlarmType.None)
{
clampTool.Close();
clampTool.Open();
}
......@@ -258,10 +259,11 @@ namespace DeviceLibrary
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoHighType, IO_VALUE.HIGH));
}
}
public IO_VALUE IOValue(string ioType) {
public IO_VALUE IOValue(string ioType)
{
return IOManager.IOValue(ioType);
}
void IOMove(string IoType, IO_VALUE value, bool isCheck = false, int msTime = 0)
public void IOMove(string IoType, IO_VALUE value, bool isCheck = false, int msTime = 0)
{
if (msTime <= 0)
{
......@@ -273,7 +275,7 @@ namespace DeviceLibrary
}
else
{
Task.Run(()=>
Task.Run(() =>
{
IOManager.IOMove(IoType, value);
Thread.Sleep(msTime);
......
......@@ -29,7 +29,7 @@ namespace DeviceLibrary
{
int hight = 0;
//if (Uppre != -1000 && Uplast != -1000&&step==3)
if (Uppre != -1000 && Uplast != -1000 && step == 2)
if (Uppre != -1000 && Uplast != -1000 && step == 2)
{
hight = Math.Abs(Uplast - Uppre) + 2000;
RightMoveInfo.log($"料盘高度计算:hight:{hight},Uppre:{Uppre},Uplast:{Uplast}");
......@@ -201,8 +201,8 @@ namespace DeviceLibrary
break;
case MoveStep.L55:
LeftMoveInfo.NextMoveStep(MoveStep.LEND);
IOMove(IO_Type.LeftMoto_Reverse, IO_VALUE.HIGH, false, 500);
LeftMoveInfo.log($"电滚停止");
// IOMove(IO_Type.LeftMoto_Reverse, IO_VALUE.HIGH, false, 500);
// LeftMoveInfo.log($"电滚停止");
break;
//}
//料串入料流程,轴下降到p1,挡停下降,滚筒正转到后端检测高电平后再转60秒,再转1秒,再转0.5秒停止,进入上料流程
......@@ -332,7 +332,7 @@ namespace DeviceLibrary
if (PlwHight > 5000)
{
int currpoint = Left_Batch_Axis.GetAclPosition();
int countPleHight= PlwHight / Config.Right_Batch_ChangeValue * Config.Left_Batch_ChangeValue;
int countPleHight = PlwHight / Config.Right_Batch_ChangeValue * Config.Left_Batch_ChangeValue;
targetP1 = currpoint - countPleHight;
LeftMoveInfo.log($"出料提升机构,获取到料盘高度脉冲{PlwHight},当前位置{currpoint},计算盘高{countPleHight}");
}
......
......@@ -210,8 +210,8 @@ namespace DeviceLibrary
break;
case MoveStep.R34:
RightMoveInfo.NextMoveStep(MoveStep.REND);
IOMove(IO_Type.RightMoto_Reverse, IO_VALUE.HIGH, false, 500);
RightMoveInfo.log($"电滚停止");
////IOMove(IO_Type.RightMoto_Reverse, IO_VALUE.HIGH, false, 500);
//RightMoveInfo.log($"电滚停止");
break;
//}
//料串入料流程,轴下降到P1点,阻挡下降,滚筒正转,等待后端到位检测高电平延时5秒,0.5秒后滚筒正转停,阻挡上升,进入上料料流程
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!