Commit 9af14a7c LN

增加父类equipBase

1 个父辈 4f262f65
......@@ -128,7 +128,7 @@ namespace OnlineStore.DUOStore
private void ExitApp()
{
DialogResult result = MessageBox.Show("是否确定退出包装料料仓客户端?", "提示", MessageBoxButtons.YesNo);
DialogResult result = MessageBox.Show("是否确定退出DUO料仓客户端?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
//如果料仓还在运行状态,先关闭料仓
......@@ -255,7 +255,7 @@ namespace OnlineStore.DUOStore
{
if (store.storeRunStatus.Equals(StoreRunStatus.Wait))
{
MessageBox.Show(store.Name + "包装料料仓未启动,不需要停止");
MessageBox.Show(store.Name + "DUO料仓未启动,不需要停止");
return;
}
if (store != null)
......@@ -270,7 +270,7 @@ namespace OnlineStore.DUOStore
{
if (store.storeRunStatus.Equals(StoreRunStatus.Wait))
{
MessageBox.Show(store.Name + "包装料料仓未启动,无法复位");
MessageBox.Show(store.Name + "DUO料仓未启动,无法复位");
return;
}
store.Reset();
......@@ -316,7 +316,7 @@ namespace OnlineStore.DUOStore
var prevCpuTime = TimeSpan.Zero;
foreach (Process process in processes)
{
if (process.ProcessName.EndsWith("ACPackingStore"))
if (process.ProcessName.EndsWith("DUOStore"))
{
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024 / 1024F);
totalMemery += process.PrivateMemorySize64 / 1024;
......
......@@ -79,6 +79,7 @@
<Compile Include="duoStore\BoxBean_Partial.cs" />
<Compile Include="duoStore\BoxBean_Shelf.cs" />
<Compile Include="duoStore\DUOStoreBean_Partial.cs" />
<Compile Include="duoStore\EquipBase.cs" />
<Compile Include="duoStore\HoisterCylinder.cs" />
<Compile Include="duoStore\HumitureBean.cs" />
<Compile Include="duoStore\DUOStoreBean.cs" />
......
......@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 流水线自动料仓-Box类
/// </summary>
public partial class BoxBean : KTK_Store
public partial class BoxBean : EquipBase
{
private bool IsIntSlvBlock = false;
public AutoInoutInfo AutoInout = new AutoInoutInfo();
......@@ -31,7 +31,6 @@ namespace OnlineStore.DeviceLibrary
public HumitureBean humBean = null;
private int logType = 1000;
public AxisBean UpdownAxis = null;
public AxisBean MiddleAxis = null;
......@@ -50,7 +49,7 @@ namespace OnlineStore.DeviceLibrary
CID = config.CID;
IoCheckTimer.Elapsed += IoCheckTimer_Elapsed;
serverConnectTimer.Elapsed += server_connect_timer_Tick;
serverConTimer.Elapsed += server_connect_timer_Tick;
logType = 1000 * config.Id;
//添加调试
IsDebug = config.IsInDebug.Equals(1);
......@@ -76,11 +75,7 @@ namespace OnlineStore.DeviceLibrary
UpdownAxis = new AxisBean(config.UpDown_Axis, Name);
ComAxis = new AxisBean(config.Comp_Axis, Name);
mainTimer.Enabled = false;
int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if (isAuto == 1)
{
mainTimer.Enabled = true;
}
}
private void IoCheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
......@@ -102,9 +97,6 @@ namespace OnlineStore.DeviceLibrary
}
}
}
/// <summary>
/// 配置速度,加减速时间
/// </summary>
public void MoveAxisConfig()
{
Config.UpDown_Axis.BreakOnDO = IO_Type.UpdownAxis_Break;
......@@ -114,9 +106,6 @@ namespace OnlineStore.DeviceLibrary
moveAxisList.Add(Config.InOut_Axis);
moveAxisList.Add(Config.Comp_Axis);
}
/// <summary>
/// 开始运行
/// </summary>
public override bool StartRun(bool isDebug = false)
{
if (!StoreManager.Store.canStart)
......@@ -153,7 +142,7 @@ namespace OnlineStore.DeviceLibrary
StartTime = DateTime.Now;
mainTimer.Enabled = true;
IoCheckTimer.Enabled = true;
serverConnectTimer.Enabled = true;
serverConTimer.Enabled = true;
return true;
}
......@@ -196,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
}
storeRunStatus = StoreRunStatus.Reset;
storeStatus = StoreStatus.ResetMove;
MoveInfo.NewMove(MoveType.StoreReset);
MoveInfo.NewMove(MoveType.Reset);
if (!OpenAllAxis(true))
{
......@@ -217,9 +206,8 @@ namespace OnlineStore.DeviceLibrary
//开始复位动作
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H01_InOutBack);
LogInfo(MoveInfo.MoveType + ": 开始料架入库,线体停止,进出轴先原点返回 ");
LogInfo(MoveInfo.MoveType + ": 进出轴回原点 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LineStop();
InoutAxis.HomeMove(MoveInfo);
}
......@@ -238,13 +226,12 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H01_InOutBack:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H02_InoutToP1);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
LogInfo(MoveInfo.MoveType + ": 进出轴到待机点P1,关闭仓门");
LogInfo(MoveInfo.MoveType + ": 进出轴到待机点P1,关闭仓门");
InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1_Speed);
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
break;
case StoreMoveStep.BOX_H02_InoutToP1:
LineStop();
//如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
......@@ -254,28 +241,27 @@ namespace OnlineStore.DeviceLibrary
return;
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogInfo(MoveInfo.MoveType + ": , 压紧轴,旋转轴,上下轴开始 原点返回");
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_OtherAxisHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LogInfo(MoveInfo.MoveType + ": 压紧轴,旋转轴,上下轴开始 原点返回,关闭NG门");
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
ComAxis.HomeMove(MoveInfo);
MiddleAxis.HomeMove(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
break;
case StoreMoveStep.BOX_H03_OtherAxisHome:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H04_OtherAxisBack);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LogInfo(MoveInfo.MoveType + ": 旋转轴运动到P1,上下轴走到P1,压紧轴到P1 ");
LogInfo(MoveInfo.MoveType + ": 旋转轴运动到P1,上下轴走到P1,压紧轴到P1, ");
MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P1, Config.UpDownAxis_P1_Speed);
ComAxis.AbsMove(MoveInfo, Config.CompAxis_P1, Config.CompAxis_P1_Speed);
break;
case StoreMoveStep.BOX_H04_OtherAxisBack:
LogInfo(MoveInfo.MoveType + ": 完成");
MoveEndToRuningStatus();
MoveEndP();
break;
default: break;
}
}
......@@ -283,20 +269,6 @@ namespace OnlineStore.DeviceLibrary
#endregion
public bool OpenAllAxis(bool isCheck)
{
return RunMultiAxis(true, IO_Type.Axis_Run, IO_Type.UpdownAxis_Break, new AxisBean[] { MiddleAxis,UpdownAxis,InoutAxis,ComAxis});
}
public void CloseAllAxis()
{
LogUtil.info(Name + "关闭刹车,关闭伺服");
CloseMultiAxis(IO_Type.Axis_Run, IO_Type.UpdownAxis_Break, new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
}
/// <summary>
/// 停止运行
/// </summary>
public override void StopRun()
{
lastPosId = "";
......@@ -304,7 +276,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = "";
AutoInout.StopAuto();
IoCheckTimer.Enabled = false;
serverConnectTimer.Enabled = false;
serverConTimer.Enabled = false;
StopMove();
storeRunStatus = StoreRunStatus.Wait;
......@@ -312,200 +284,14 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - StartTime;
LogInfo(",停止运行,总运行时间:" + span.ToString());
}
public DateTime LastAlarmTime = DateTime.Now;
public override void Alarm(AlarmType alarmType, string alarmDetial = "", string alarmMsg = "", MoveType storeMoveType = MoveType.None)
{
if (alarmType.Equals(AlarmType.None).Equals(false))
{
LastAlarmTime = DateTime.Now;
}
SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType);
base.Alarm(alarmType, alarmDetial, alarmMsg, storeMoveType);
AutoInout.StopAuto();
if (this.alarmType.Equals(alarmType) && alarmType != AlarmType.SuddenStop && alarmType != AlarmType.NoAirCheck)
{
return;
}
LogUtil.error(Name + " 报警,报警类型:" + alarmType);
this.alarmType = alarmType;
if (alarmType.Equals(AlarmType.AxisAlarm) | alarmType.Equals(AlarmType.AxisMoveError))
{
LogUtil.error(Name + "轴报警, 停止运动, 打开报警灯");
StopMove();
}
else if (alarmType == AlarmType.SuddenStop)
{
isInSuddenDown = true;
LogUtil.error(Name + "收到急停信号,停止运动, 打开报警灯 ");
StopMove();
storeStatus = StoreStatus.SuddenStop;
}
else if (alarmType.Equals(AlarmType.NoAirCheck))
{
isNoAirCheck = true;
LogUtil.error(Name + " 未检测到气压信号 ,停止运动, 打开报警灯 ");
StopMove();
storeStatus = StoreStatus.SuddenStop;
}
}
private bool InProcess = false;
private bool IsChongfu = false;
private Stopwatch stopwatch = new Stopwatch();
protected override void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (InProcess)
{
//TimeSpan span = DateTime.Now - preProcessTime;
if (stopwatch.Elapsed.TotalSeconds < 10)
{
return;
}
else
{
LogUtil.error("主定时器:InProcess已等待" + stopwatch.Elapsed.ToString() + "重新处理");
IsChongfu = true;
}
}
try
{
InProcess = true;
//preProcessTime = DateTime.Now;
stopwatch.Restart();
IoCheckProcess();
ShowTimeLog("IoCheckProcess");
TimerProcess();
ShowTimeLog("TimerProcess");
//检查运动轴报警
if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown) && (!isNoAirCheck))
{
ShowTimeLog("开始检测轴报警");
CheckAxisAlarm();
ShowTimeLog("轴报警检测完成");
}
}
catch (Exception ex)
{
LogUtil.error(Name + "定时处理出错:" + ex.ToString());
}
IsChongfu = false;
InProcess = false;
}
private IO_VALUE preAirValue = IO_VALUE.HIGH;
private void AirCheckProcess()
{
IO_VALUE currAirValue = IOValue(IO_Type.Airpressure_Check);
if (isInSuddenDown)
{
return;
}
if (isNoAirCheck)
{
return;
}
if (currAirValue.Equals(IO_VALUE.LOW))
{
//判断是否持续了3秒
if (preAirValue.Equals(IO_VALUE.LOW))
{
TimeSpan span = DateTime.Now - lastAirCloseTime;
if (span.TotalSeconds > StoreManager.Config.AirCheckSeconds)
{
WarnMsg = "未检测到气压信号";
preAirValue = IO_VALUE.LOW;
LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警");
Alarm(AlarmType.NoAirCheck, "2", WarnMsg, MoveType.None);
return;
}
}
else
{
lastAirCloseTime = DateTime.Now;
isNoAirCheck = false;
}
}
else
{
isNoAirCheck = false;
}
preAirValue = currAirValue;
}
private void ShowTimeLog(string info)
{
if (IsChongfu)
{
LogUtil.info( Name+"【" + info + "】 处理完成,耗时:" + stopwatch.Elapsed.ToString());
}
}
private IO_VALUE lastAutoRun = IO_VALUE.LOW;
public void IoCheckProcess()
{
DateTime time = DateTime.Now;
if (storeRunStatus.Equals(StoreRunStatus.Wait))
{
//取新的Io状态
IO_VALUE autoSingle = IOValue(IO_Type.Reset_BTN);
if (ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1))
{
if (autoSingle.Equals(IO_VALUE.HIGH) && lastAutoRun.Equals(IO_VALUE.LOW))
{
//没有启动时收到复位按钮,相当于启动按钮
LogInfo("没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
bool result = StartRun();
if (result.Equals(false))
{
LogUtil.error(Name + "料仓启动失败,继续等待下次启动!");
mainTimer.Enabled = true;
}
}
lastAutoRun = autoSingle;
return;
}
lastAutoRun = autoSingle;
}
//判断急停
else if (storeRunStatus >= StoreRunStatus.HomeMoving)
{
////取新的Io状态
//IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN);
//IO_VALUE resetBtn = IOValue(IO_Type.Reset_BTN);
//急停按钮
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
return;
}
else if (IOValue(IO_Type.Reset_BTN).Equals(IO_VALUE.HIGH))
{
//收到复位信号,若报警直接复位,若不报警且无操作,回到待机点
if (alarmType.Equals(AlarmType.None) && isInSuddenDown.Equals(false) && isNoAirCheck.Equals(false))
{
if (MoveInfo.MoveType.Equals(MoveType.None))
{
LogUtil.info(Name + "收到复位信号,当前无报警,且空闲中,暂不处理");
}
else
{
LogUtil.info(Name + "收到复位信号,当前无报警, 在" + MoveInfo.MoveType + "处理中,不处理复位");
}
}
else
{
//收到复位信号
LogUtil.info("收到复位信号,自动复位");
WarnMsg = "收到复位信号,自动复位";
Reset();
}
}
AirCheckProcess();
}
}
public void TimerProcess()
internal override void TimerProcess()
{
try
{
......@@ -523,6 +309,12 @@ namespace OnlineStore.DeviceLibrary
IOTimeOutProcess();
ShowTimeLog("IOTimeOutProcess");
} //检查运动轴报警
if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown) && (!isNoAirCheck))
{
ShowTimeLog("开始检测轴报警");
CheckAxisAlarm(new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
ShowTimeLog("轴报警检测完成");
}
}
catch (Exception ex)
......@@ -531,44 +323,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private DateTime preIoTimerOutTime = DateTime.Now;
/// <summary>
/// io检测异常
/// </summary>
private void IOTimeOutProcess()
{
try
{
TimeSpan span = DateTime.Now - preIoTimerOutTime;
if (span.TotalSeconds > 1)
{
preIoTimerOutTime = DateTime.Now;
if (!alarmType.Equals(AlarmType.IoSingleTimeOut))
{
return;
}
if (storeRunStatus < StoreRunStatus.Runing || isInSuddenDown || isNoAirCheck)
{
return;
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if (MoveInfo.IsInWait == false)
{
LogUtil.info(Name + "之前有IO超时异常【" + alarmInfo.alarmDetail + "】,但是当前已经没有在等待中,清理信号超时异常!");
alarmType = AlarmType.None;
WarnMsg = "";
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "IOTimeOutProcess出错:" + ex.ToString());
}
}
/// <summary>
/// 超过配置次数时需要复位
/// </summary>
private void AutoResetProcess()
{
try
......@@ -605,45 +360,7 @@ namespace OnlineStore.DeviceLibrary
}
/// <summary>
/// 判断是否报警,返回 true表示报警 报警检测2秒钟检测一次
/// </summary>
/// <returns></returns>
private DateTime checkAlarmTime = DateTime.Now;
public bool CheckAxisAlarm()
{
if (alarmType.Equals(AlarmType.AxisAlarm) || alarmType.Equals(AlarmType.AxisMoveError))
{
return true;
}
TimeSpan span = DateTime.Now - checkAlarmTime;
//在回原点,复位,出入库时,检测报警间隔减小
if ((storeRunStatus.Equals(StoreRunStatus.Runing) && span.TotalSeconds < 3) || span.TotalSeconds < 1)
{
return false;
}
checkAlarmTime = DateTime.Now;
bool isInAlarm = false;
foreach (ConfigMoveAxis axisInfo in moveAxisList)
{
short axis = axisInfo.GetAxisValue();
string deviceName = axisInfo.GetNameStr();
if (ACServerManager.GetAlarmStatus(deviceName, axis) == 1)
{
WarnMsg = Name + " 运动轴" + axisInfo.Explain + "报警";
Alarm(AlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, MoveType.None);
isInAlarm = true;
}
}
//判断报警状态
return isInAlarm;
}
/// <summary>
/// 停止所有运行
/// </summary>
public override void StopMove()
{
IOMove(IO_Type.UpdownAxis_Break, IO_VALUE.LOW);
......@@ -659,31 +376,15 @@ namespace OnlineStore.DeviceLibrary
isInPro = false;
}
private void MoveEndToRuningStatus()
{
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
storeStatus = StoreStatus.StoreOnline;
if (alarmType.Equals(AlarmType.None))
{
WarnMsg = "";
}
}
public void LineRun()
{
IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW);
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
}
public void LineBackRun()
public bool OpenAllAxis(bool isCheck)
{
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
IOMove(IO_Type.Line_BackRun, IO_VALUE.HIGH);
return RunMultiAxis(true, IO_Type.Axis_Run, IO_Type.UpdownAxis_Break, new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
}
public void LineStop()
public void CloseAllAxis()
{
IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW);
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
LogUtil.info(Name + "关闭刹车,关闭伺服");
CloseMultiAxis(IO_Type.Axis_Run, IO_Type.UpdownAxis_Break, new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
}
public string GetMoveStr()
{
......
......@@ -287,10 +287,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
LogUtil.info(Name + " 【" + posId + "】入库结束,耗时【" + FormUtil.GetSpanStr(span) + "】");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//设备连接,入库后,BOX恢复原始状态
storeStatus = StoreStatus.StoreOnline;
MoveEndP();
AutoInout.InOutEndProcess(this, MoveType.InStore);
}
......@@ -341,9 +338,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
LogUtil.info(Name + " 【" + posId + "】NG料送料结束,耗时【" + FormUtil.GetSpanStr(span) + "】");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
storeStatus = StoreStatus.StoreOnline;
MoveEndP();
}
......@@ -499,11 +494,9 @@ namespace OnlineStore.DeviceLibrary
{
TimeSpan span = DateTime.Now - startOutStoreTime;
string posId = MoveInfo.MoveParam.PosID;
storeStatus = StoreStatus.StoreOnline;
LogUtil.info(Name + " 【" + posId + "】 出库结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
MoveEndP();
AutoInout.InOutEndProcess(this, MoveType.OutStore);
}
#endregion
......@@ -551,10 +544,9 @@ namespace OnlineStore.DeviceLibrary
{
TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
storeStatus = StoreStatus.StoreOnline;
LogUtil.info(Name + " 【" + posId + "】 单盘出库结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
MoveEndP();
AutoInout.InOutEndProcess(this, MoveType.OutStore);
}
......
......@@ -14,10 +14,8 @@ using System.Timers;
namespace OnlineStore.DeviceLibrary
{
public partial class DUOStoreBean : KTK_Store
public partial class DUOStoreBean : EquipBase
{
private System.Timers.Timer ledProcessTimer = null;
public Dictionary<int, BOX_Config> BoxConfigMap { get; set; }
public Dictionary<int, BoxBean> BoxMap = new Dictionary<int, BoxBean>();
......@@ -40,7 +38,9 @@ namespace OnlineStore.DeviceLibrary
lineConfig.IOSingle_TimerOut = 5000;
}
Init();
InitTimer();
IoCheckTimer.Elapsed += IoCheckTimerProcess;
serverConTimer.Elapsed += ServerConnectTimer_Elapsed;
baseConfig = lineConfig;
this.Config = lineConfig;
this.ID = lineConfig.Id;
......@@ -71,15 +71,17 @@ namespace OnlineStore.DeviceLibrary
{
// RFIDManager.RfidReader.Open(rfidList.ToArray());
IOManager.instance.ConnectionIOList(ioList);
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
addLastDI(IO_Type.Reset_BTN, IOValue(IO_Type.Reset_BTN));
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
mainTimer.Enabled = true;
canStart = true;
int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if (isAuto == 1)
{
mainTimer.Enabled = true;
}
});
}
......@@ -93,20 +95,11 @@ namespace OnlineStore.DeviceLibrary
}
}
}
public void InitTimer()
{
ledProcessTimer = new System.Timers.Timer();
ledProcessTimer.Interval = 1000;
ledProcessTimer.Elapsed += LedProcess;
ledProcessTimer.AutoReset = true;
ledProcessTimer.Enabled = false;
}
private void IoCheckTimerProcess(object sender, ElapsedEventArgs e)
{
}
#endregion
#region 启动,复位,停止,方法
public override bool StartRun(bool isDebug = false)
{
if (!canStart)
......@@ -129,25 +122,15 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.info(Name + "开始启动,连接agv调度,连接rfid,启动时间:" + StartTime.ToString());
LogUtil.info(Name + "开始启动 ,启动时间:" + StartTime.ToString());
storeRunStatus = StoreRunStatus.HomeMoving;
StartTime = DateTime.Now;
//AgvClient.SetCancelState(false);
//RFIDManager.Open(rfidList.ToArray());
mainTimer.Enabled = false;
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = AlarmType.None;
WarnMsg = "";
StartResetMove();
foreach (BoxBean box in this.BoxMap.Values)
{
box.StartRun();
}
ledProcessTimer.Enabled = true;
serverConTimer.Enabled = true;
mainTimer.Enabled = true;
return true;
}
......@@ -162,12 +145,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Reset;
StartResetMove();
mainTimer.Enabled = false;
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = AlarmType.None;
WarnMsg = "";
foreach (BoxBean equip in BoxMap.Values)
{
......@@ -183,12 +162,139 @@ namespace OnlineStore.DeviceLibrary
}
mainTimer.Enabled = true;
}
private void StartResetMove()
{
mainTimer.Enabled = false;
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = AlarmType.None;
WarnMsg = "";
MoveInfo.NewMove(MoveType.Reset);
MoveInfo.NextMoveStep(StoreMoveStep.LR_01_StopUp);
LogUtil.info(Name + "开始复位 "+MoveInfo.MoveStep+" :四个阻挡全部上升");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(600));
IOMove(IO_Type.Line_Stop1_Wait, IO_VALUE.LOW);
IOMove(IO_Type.Line_Stop2_Work, IO_VALUE.LOW);
IOMove(IO_Type.Line_Stop3_Buffer, IO_VALUE.LOW);
IOMove(IO_Type.Line_Stop4_Out, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop1_Wait, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop2_Work, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop3_Buffer, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop4_Out, IO_VALUE.LOW));
}
protected override void ResetProcess()
{
if (MoveInfo.IsInWait)
{
CheckWait();
}
if (MoveInfo.IsInWait)
{
return;
}
if (MoveInfo.IsStep(StoreMoveStep.LR_01_StopUp))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_02_LineRun);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :流水线转动3秒");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
LineRun(MoveInfo);
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_02_LineRun))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_03_BatchAxisHome);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :夹爪放松,提升轴回原点,上下轴回原点");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Clamp, IO_Type.ClampCylinder_Relax);
T1_BatchAxis.HomeMove(MoveInfo);
T3_UpdownAxis.HomeMove(MoveInfo);
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_03_BatchAxisHome))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_04_BatchToP1);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :提升轴到P1点,上下轴到待机点P1");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P1Speed);
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_04_BatchToP1))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_05_Hoister_Back);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :取料电机后退,旋转轴回原点");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
hoisterCylinder.StartBack(MoveInfo);
T2_MiddleAxis.HomeMove(MoveInfo);
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_05_Hoister_Back))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_06_TopDown);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :顶升气缸下降,旋转轴到待机点P1");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P2, Config.MiddleAxis_P2Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_06_TopDown))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_07_WaitBox);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :等待料仓复位完成");
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_07_WaitBox))
{
bool isOk = true;
//判断是否所有的已经返回完成
string msg = "等待BOX复位完成超时";
foreach (BoxBean box in this.BoxMap.Values)
{
if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)))
//if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
{
if (box.alarmType.Equals(AlarmType.None))
{
msg = "等待"+ box .Name+ "复位完成超时";
isOk = false;
break;
}
else
{
WarnMsg = box.Name + "在复位过程中报警,需要重新复位";
}
}
}
if (isOk)
{
//所有原点重置完成
LogUtil.info(Name + "所有设备重置完成");
MoveEndP();
}
else if (MoveInfo.IsTimeOut(120))
{
WarnMsg = Name + "[" + MoveInfo.MoveStep + "] "+msg+" [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, logType + 21);
Alarm(AlarmType.IoSingleTimeOut);
}
}
}
public override void StopMove()
{
foreach (BoxBean equip in this.BoxMap.Values)
{
equip.StopMove();
}
MoveInfo.EndMove();
}
public override void StopRun()
{
mainTimer.Enabled = false;
ledProcessTimer.Enabled = false;
//停止运行时,把阻挡气缸上升
StopMove();
foreach (BoxBean equip in BoxMap.Values)
......@@ -198,11 +304,12 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Wait;
// RFIDManager.Close();
TimeSpan span = DateTime.Now - StartTime;
LogUtil.info( Name + ",停止运行,关闭rfid,总运行时间:" + span.ToString());
LogUtil.info(Name + ",停止运行,关闭rfid,总运行时间:" + span.ToString());
}
#endregion
#region 灯光处理
private void LedProcess(object sender, ElapsedEventArgs e)
private void LedProcess( )
{
try
{
......@@ -293,62 +400,163 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(5);
}
private bool IsDoValue(string ioType, IO_VALUE ioValue)
{
return IOValue(ioType).Equals(ioValue);
}
#endregion
protected override void timersTimer_Elapsed(object sender, ElapsedEventArgs e)
#region 定时处理
private IO_VALUE lastAutoRun = IO_VALUE.LOW;
private IO_VALUE preAirValue = IO_VALUE.HIGH;
private void AirCheckProcess()
{
BusyMoveProcess();
IO_VALUE currAirValue = IOValue(IO_Type.Airpressure_Check);
if (isInSuddenDown)
{
return;
}
public override void StopMove()
if (isNoAirCheck)
{
foreach (BoxBean equip in this.BoxMap.Values)
return;
}
if (currAirValue.Equals(IO_VALUE.LOW))
{
// if (!equip.IsDebug)
//判断是否持续了3秒
if (preAirValue.Equals(IO_VALUE.LOW))
{
equip.StopMove();
TimeSpan span = DateTime.Now - lastAirCloseTime;
if (span.TotalSeconds > StoreManager.Config.AirCheckSeconds)
{
WarnMsg = "未检测到气压信号";
preAirValue = IO_VALUE.LOW;
LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警");
Alarm(AlarmType.NoAirCheck, "2", WarnMsg, MoveType.None);
return;
}
}
MoveInfo.EndMove();
else
{
lastAirCloseTime = DateTime.Now;
isNoAirCheck = false;
}
protected override void ResetProcess()
}
else
{
bool isOk = true;
//判断是否所有的已经返回完成
isNoAirCheck = false;
}
preAirValue = currAirValue;
}
foreach (BoxBean box in this.BoxMap.Values)
private void ServerConnectTimer_Elapsed(object sender, ElapsedEventArgs e)
{
if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) )
//if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
LedProcess();
}
private void IoCheckTimerProcess(object sender, ElapsedEventArgs e)
{
if (box.alarmType.Equals(AlarmType.None))
try
{
isOk = false;
break;
DateTime time = DateTime.Now;
if (storeRunStatus.Equals(StoreRunStatus.Wait))
{
//取新的Io状态
IO_VALUE autoSingle = IOValue(IO_Type.Reset_BTN);
if (ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1))
{
if (autoSingle.Equals(IO_VALUE.HIGH) && lastAutoRun.Equals(IO_VALUE.LOW))
{
//没有启动时收到复位按钮,相当于启动按钮
LogInfo("没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
bool result = StartRun();
if (result.Equals(false))
{
LogUtil.error(Name + "料仓启动失败,继续等待下次启动!");
mainTimer.Enabled = true;
}
}
lastAutoRun = autoSingle;
return;
}
lastAutoRun = autoSingle;
}
//判断急停
else if (storeRunStatus >= StoreRunStatus.HomeMoving)
{
//急停按钮
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
return;
}
else if (IOValue(IO_Type.Reset_BTN).Equals(IO_VALUE.HIGH))
{
//收到复位信号,若报警直接复位,若不报警且无操作,回到待机点
if (alarmType.Equals(AlarmType.None) && isInSuddenDown.Equals(false) && isNoAirCheck.Equals(false))
{
if (MoveInfo.MoveType.Equals(MoveType.None))
{
LogUtil.info(Name + "收到复位信号,当前无报警,且空闲中,暂不处理");
}
else
{
WarnMsg = box.Name + "在复位过程中报警,需要重新复位";
LogUtil.info(Name + "收到复位信号,当前无报警, 在" + MoveInfo.MoveType + "处理中,不处理复位");
}
}
else
{
//收到复位信号
LogUtil.info("收到复位信号,自动复位");
WarnMsg = "收到复位信号,自动复位";
Reset();
}
if (isOk)
}
AirCheckProcess();
}
}
catch(Exception ex)
{
//所有原点重置完成
storeRunStatus = StoreRunStatus.Runing;
LogUtil.info(Name + "所有设备重置完成");
LogUtil.error(Name + "IoCheckTimerProcess 出错:" + ex.ToString());
}
}
public override void Alarm(AlarmType alarmType, string alarmDetial = "", string alarmMsg = "", MoveType storeMoveType = MoveType.None)
internal override void TimerProcess()
{
try
{
DateTime time = DateTime.Now;
if (MoveInfo.MoveType != MoveType.None)
{
BusyMoveProcess();
ShowTimeLog("BusyMoveProcess");
}
else if (storeRunStatus.Equals(StoreRunStatus.Runing))
{
ShowTimeLog("AutoResetProcess");
IOTimeOutProcess();
ShowTimeLog("IOTimeOutProcess");
} //检查运动轴报警
if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown) && (!isNoAirCheck))
{
ShowTimeLog("开始检测轴报警");
CheckAxisAlarm(new AxisBean[] { T1_BatchAxis,T2_MiddleAxis,T3_UpdownAxis});
ShowTimeLog("轴报警检测完成");
}
}
catch (Exception ex)
{
LogUtil.error(Name + "定时处理出错" + ex.ToString());
}
}
#endregion
public int GetShelfNum()
{
int ShelfCheck1 = (int)IOValue(IO_Type.ShelfCheck1);
int ShelfCheck2 = (int)IOValue(IO_Type.ShelfCheck2);
int ShelfCheck3 = (int)IOValue(IO_Type.ShelfCheck3);
int ShelfCheck4 = (int)IOValue(IO_Type.ShelfCheck4);
string dStr = ShelfCheck4.ToString()+ShelfCheck3.ToString() + ShelfCheck2.ToString() + ShelfCheck1.ToString();
int num = Convert.ToInt32(dStr, 2);
return num;
}
public void LineRun(StoreMoveInfo move)
......
using DeviceLib;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public abstract class EquipBase : KTK_Store
{
internal int logType = 1000;
public DateTime LastAlarmTime = DateTime.Now;
public override void Alarm(AlarmType alarmType, string alarmDetial = "", string alarmMsg = "", MoveType storeMoveType = MoveType.None)
{
if (alarmType.Equals(AlarmType.None).Equals(false))
{
LastAlarmTime = DateTime.Now;
}
SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType);
if (this.alarmType.Equals(alarmType) && alarmType != AlarmType.SuddenStop && alarmType != AlarmType.NoAirCheck)
{
return;
}
LogUtil.error(Name + " 报警,报警类型:" + alarmType);
this.alarmType = alarmType;
if (alarmType.Equals(AlarmType.AxisAlarm) | alarmType.Equals(AlarmType.AxisMoveError))
{
LogUtil.error(Name + "轴报警, 停止运动, 打开报警灯");
StopMove();
}
else if (alarmType == AlarmType.SuddenStop)
{
isInSuddenDown = true;
LogUtil.error(Name + "收到急停信号,停止运动, 打开报警灯 ");
StopMove();
storeStatus = StoreStatus.SuddenStop;
}
else if (alarmType.Equals(AlarmType.NoAirCheck))
{
isNoAirCheck = true;
LogUtil.error(Name + " 未检测到气压信号 ,停止运动, 打开报警灯 ");
StopMove();
storeStatus = StoreStatus.SuddenStop;
}
}
private bool InProcess = false;
private bool IsChongfu = false;
private Stopwatch stopwatch = new Stopwatch();
protected override void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (InProcess)
{
if (stopwatch.Elapsed.TotalSeconds < 10)
{
return;
}
else
{
LogUtil.error("主定时器:InProcess已等待" + stopwatch.Elapsed.ToString() + "重新处理");
IsChongfu = true;
}
}
try
{
InProcess = true;
stopwatch.Restart();
TimerProcess();
ShowTimeLog("TimerProcess");
}
catch (Exception ex)
{
LogUtil.error(Name + "定时处理出错:" + ex.ToString());
}
IsChongfu = false;
InProcess = false;
}
internal virtual void TimerProcess()
{
}
internal void ShowTimeLog(string info)
{
if (IsChongfu)
{
LogUtil.info(Name + "【" + info + "】 处理完成,耗时:" + stopwatch.Elapsed.ToString());
}
}
internal DateTime preIoTimerOutTime = DateTime.Now;
internal void IOTimeOutProcess()
{
try
{
TimeSpan span = DateTime.Now - preIoTimerOutTime;
if (span.TotalSeconds > 1)
{
preIoTimerOutTime = DateTime.Now;
if (!alarmType.Equals(AlarmType.IoSingleTimeOut))
{
return;
}
if (storeRunStatus < StoreRunStatus.Runing || isInSuddenDown || isNoAirCheck)
{
return;
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if (MoveInfo.IsInWait == false)
{
LogUtil.info(Name + "之前有IO超时异常【" + alarmInfo.alarmDetail + "】,但是当前已经没有在等待中,清理信号超时异常!");
alarmType = AlarmType.None;
WarnMsg = "";
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "IOTimeOutProcess出错:" + ex.ToString());
}
}
/// <summary>
/// 判断是否报警,返回 true表示报警 报警检测2秒钟检测一次
/// </summary>
/// <returns></returns>
internal DateTime checkAlarmTime = DateTime.Now;
internal bool CheckAxisAlarm(AxisBean[] axisList)
{
if (alarmType.Equals(AlarmType.AxisAlarm) || alarmType.Equals(AlarmType.AxisMoveError))
{
return true;
}
TimeSpan span = DateTime.Now - checkAlarmTime;
//在回原点,复位,出入库时,检测报警间隔减小
if ((storeRunStatus.Equals(StoreRunStatus.Runing) && span.TotalSeconds < 3) || span.TotalSeconds < 1)
{
return false;
}
checkAlarmTime = DateTime.Now;
bool isInAlarm = false;
foreach (AxisBean axisInfo in axisList)
{
short axis = axisInfo.Config.GetAxisValue();
string deviceName = axisInfo.Config.GetNameStr();
if (ACServerManager.GetAlarmStatus(deviceName, axis) == 1)
{
WarnMsg = Name + " 运动轴" + axisInfo.Config.Explain + "报警";
Alarm(AlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo.Config).ToString(), WarnMsg, MoveType.None);
isInAlarm = true;
}
}
//判断报警状态
return isInAlarm;
}
internal bool IsDoValue(string ioType, IO_VALUE ioValue)
{
return IOValue(ioType).Equals(ioValue);
}
internal void MoveEndP()
{
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
storeStatus = StoreStatus.StoreOnline;
if (alarmType.Equals(AlarmType.None))
{
WarnMsg = "";
}
}
#region 出入库结果验证
internal void CheckWait()
{
List<WaitResultInfo> list = MoveInfo.WaitList;
//当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - MoveInfo.LastSetpTime;
string NotOkMsg = "";
if (list.Count <= 0)
{
MoveInfo.EndStepWait();
return;
}
bool isOk = true;
if (MoveInfo.OneWaitCanEndStep)
{
isOk = false;
}
foreach (WaitResultInfo wait in list)
{
if (wait.IsEnd)
{
continue;
}
NotOkMsg = wait.ToStr();
if (wait.WaitType.Equals(WaitEnum.W001_AxisMove))
{
string msg = "";
if (wait.IsHomeMove)
{
wait.IsEnd = AxisBean.HomeMoveIsEnd(MoveInfo, wait.AxisInfo, out msg);
}
else
{
wait.IsEnd = AxisBean.ACAxisMoveIsEnd(MoveInfo, wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
}
if (!msg.Equals(""))
{
isOk = false;
WarnMsg = msg;
Alarm(AlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, MoveInfo.MoveType);
break;
}
}
else if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{
wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs && NoAlarm())
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时";
Alarm(AlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType);
LogUtil.error(Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", logType + 14);
if (!MoveInfo.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
if (wait.IsEnd)
{
if (MoveInfo.OneWaitCanEndStep)
{
isOk = true;
break;
}
}
else
{
if (!MoveInfo.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
if (isOk)
{
MoveInfo.EndStepWait();
}
else if (span.TotalSeconds > MoveInfo.TimeOutSeconds)
{
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
int second = 10;
second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
if (second > 120)
{
second = 120;
}
else if (second < 10)
{
second = 10;
}
LogUtil.error(WarnMsg, logType + 100, second);
Alarm(AlarmType.IoSingleTimeOut, "", WarnMsg, MoveInfo.MoveType);
}
}
#endregion
}
}
......@@ -41,7 +41,7 @@ namespace OnlineStore.DeviceLibrary
private StoreRunStatus storerunstatus = StoreRunStatus.Wait;
protected System.Timers.Timer mainTimer;
protected System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
protected System.Timers.Timer serverConTimer = new System.Timers.Timer();
protected System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
private bool isInit = false;
......@@ -75,32 +75,6 @@ namespace OnlineStore.DeviceLibrary
public AlarmInfo alarmInfo = new AlarmInfo();
/// <summary>
/// 记录上一次的部分IO状态,主要是急停,气压检测信号,复位信号,用来判断是否io发生改变
/// </summary>
public Dictionary<string, IO_VALUE> DILastValueMap = new Dictionary<string, IO_VALUE>();
public object lastDiListLock = "";
public void addLastDI(string type, IO_VALUE value)
{
try
{
lock (lastDiListLock)
{
if (DILastValueMap.ContainsKey(type))
{
DILastValueMap.Remove(type);
}
DILastValueMap.Add(type, value);
}
}
catch (Exception ex)
{
LogUtil.error(ex.ToString());
}
}
/// <summary>
/// 获取料仓运行的时间
......@@ -144,7 +118,7 @@ namespace OnlineStore.DeviceLibrary
ResetProcess();
isInPro = false;
break;
case MoveType.StoreReset:
case MoveType.Reset:
ResetProcess();
isInPro = false;
break;
......@@ -236,10 +210,10 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Elapsed += timersTimer_Elapsed;
mainTimer.AutoReset = true;
serverConnectTimer = new System.Timers.Timer();
serverConnectTimer.Interval = 1000;
serverConnectTimer.AutoReset = true;
serverConnectTimer.Enabled = false;
serverConTimer = new System.Timers.Timer();
serverConTimer.Interval = 1000;
serverConTimer.AutoReset = true;
serverConTimer.Enabled = false;
IoCheckTimer = new System.Timers.Timer();
IoCheckTimer.Interval = 200;
......
......@@ -115,7 +115,7 @@ namespace OnlineStore.DeviceLibrary
/// 无操作,等待状态
/// </summary>
Wait = 0,
#region 料仓复位
#region 料仓复位 011 开始
/// <summary>
/// BOX复位:进出轴回原点
......@@ -125,478 +125,473 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// BOX复位:进出轴回原点
/// </summary>
BOX_H02_InoutToP1 ,
BOX_H02_InoutToP1,
/// <summary>
/// BOX复位:其他轴回原点
/// </summary>
BOX_H03_OtherAxisHome ,
BOX_H03_OtherAxisHome,
/// <summary>
/// BOX复位:升降轴,旋转轴,压紧轴原点返回
/// </summary>
BOX_H04_OtherAxisBack ,
BOX_H04_OtherAxisBack,
#endregion
#region 料架进入料仓步骤 1000开始
#region 料仓内部入库步骤 200开始
/// <summary>
/// 通知agv准备带料架agv
/// 入库:进出轴返回P1
/// </summary>
BI_00_ReadyShelf = 1000,
SI_01_InoutToP1 = 201,
/// <summary>
/// 料架入库:入料口移门打开
/// 入库: 升降轴,旋转轴到P1,压紧轴到P3
/// </summary>
BI_01_DoorOpen = 1001,
SI_02_AxisBack,
/// <summary>
/// 料架入库:等待agvReady
/// 入库:进出轴到P2( 进料口取料点)
/// </summary>
BI_02_WaitReady=1002,
SI_03_InoutToP2,
/// <summary>
/// 料架入库:线体正转,等待入料口检测到信号
/// 入库:升降轴到P7( 进料口取料缓冲点)压紧轴到P2(压紧点)
/// </summary>
BI_03_LineRun = 1003,
SI_04_GetReel,
/// <summary>
/// 等待取料位检测到信号
/// 入库:进出轴返回P1
/// </summary>
BI_04_WaitTakeSingle = 1004,
SI_05_InoutToP1,
/// <summary>
/// 料架入库:取料位检测到信号,停止线体正转
/// 入库:移动到库位点,旋转轴到P2( 库位点),升降轴到P3(库位入库前点)
/// </summary>
BI_05_LineStop = 1005,
SI_06_ToPos,
/// <summary>
/// 料架入库:入料口移门关闭,等待1000
/// 入库:进出轴到P3(库位取放料点)
/// </summary>
BI_06_DoorClose = 1006,
SI_07_InoutToP3,
/// <summary>
/// 线体再正转1秒
/// 入库:升降轴到P4( 库位入料缓冲点)压紧轴到P3( 压紧前点)
/// </summary>
BI_07_LineRun = 1007,
SI_08_PutReel,
/// <summary>
/// 料架入库:定位装置上升
/// 入库:进出轴返回P1
/// </summary>
BI_08_LocationUp = 1008,
SI_09_InoutToP1,
/// <summary>
/// 料架入库:顶升装置上升
/// 入库:旋转轴,升降轴,压紧轴到待机点P1
/// </summary>
BI_09_TopCylinderUp = 1009,
#endregion
SI_10_GoBack,
#region 料架入库步骤,3000开始
/// <summary>
/// 料架入库:开始循环从第一个空位逐个取料盘,扫码入库
/// </summary>
BI_10_StartGetTray = 3010,
/// <summary>
/// 料架取料:叉子后退到待机点P1
/// </summary>
BI_11_InoutToP1 = 3011,
/// <summary>
/// 料架取料:升降轴移动到P101低点,旋转轴移动到P101点,压紧轴到压紧前点
/// 入库NG料:移动到出料口,旋转轴到P11,升降轴到P12高点
/// </summary>
BI_12_MoveToShelf = 3012,
SI_21_ToOutDoor,
/// <summary>
/// 料架取料:叉子前进到P101点
/// 入库NG料:打开出料口门
/// </summary>
BI_13_InoutToP101 = 3013,
SI_22_OpenOutDoor,
/// <summary>
/// 料架取料:升降轴上升到P102
/// 入库NG料:进出轴到_P11-出料口取放料
/// </summary>
BI_14_UpdownToP102 = 3014,
SI_23_InoutToP11,
/// <summary>
/// 料架取料:压紧轴开始缓慢压紧
/// 入库NG料:升降轴到_P11-出料口-低点,压紧轴到压紧前点P3
/// </summary>
BI_15_StartCompress = 3015,
SI_24_PurReel,
/// <summary>
/// 料架取料:检测到料叉压紧确认信号,再次向下压紧指定的值
/// 入库NG料:进出轴返回待机点P1
/// </summary>
BI_16_ComDownMove = 3016,
SI_25_InoutToP1,
/// <summary>
/// 料架取料:记录压紧高度,叉子后退到P1
/// 入库NG料:升降轴,旋转轴,压紧轴返回P1,关闭出料口门
/// </summary>
BI_17_InoutBack = 3017,
SI_26_GoBack,
#endregion
#region 料仓内部出库 500 开始
//TODO 后退到待机点,然后去扫码点,放下料盘,扫码,扫码后再拿起料盘
/// <summary>
/// 扫码:升降轴移动到P2,旋转轴移动到P1
/// </summary>
BI_21_ToScanPosition = 3021,
/// <summary>
/// 扫码:进出轴到P2
///料仓出库:进出轴到P1
/// </summary>
BI_22_InOutToP2,
SO_01_InoutBack = 501,
/// <summary>
/// 扫码:升降轴缓慢下降到P1,压紧轴返回压紧前点
/// 料仓出库:压紧轴到压紧前点P3 ,旋转轴到库位点P2,轴2(上下) 至P5(库位出库前点)
/// </summary>
BI_23_PutTrayDown,
SO_02_ToPosition,
/// <summary>
/// 扫码:进出轴返回待机点
/// 料仓出库:进出轴到库位P3
/// </summary>
BI_24_InOutToP1,
SO_03_InoutToP3,
/// <summary>
/// 扫码:记录宽度,开始扫码
///料仓出库:升降轴到P6,轴4( 压紧) 至P2(压紧点)
/// </summary>
BI_25_ScanCode,
SO_04_GetReel,
/// <summary>
/// 扫码:扫码成功,从服务器获取库位号,设置位置参数
///料仓出库:进出轴返回P1
/// </summary>
BI_26_GetPosId,
SO_05_InoutBack,
/// <summary>
/// 扫码:获取库位号成功,进出轴到P2
/// 料仓出库:旋转轴至P1,升降轴至P2
/// </summary>
BI_27_InoutToP2,
SO_06_ToDoor,
/// <summary>
/// 料仓出库:进出轴到P2
/// /// </summary>
SO_07_InoutToP2,
/// <summary>
/// 扫码:升降轴到P1,压紧轴压紧
/// 料仓出库: 放下物品 升降轴至P1,压紧轴到P3
/// </summary>
BI_28_GetScanPTray,
SO_08_PutReel,
/// <summary>
/// 扫码:进出轴返回
/// 料仓出库: 进出轴到P1
/// </summary>
BI_29_InoutBackP1,
SO_09_InoutBack,
/// <summary>
/// 料架取料: 获取库位号完成,设置位置参数, 准备入库
/// 料仓出库:升降轴,旋转轴到待机点P1
/// </summary>
BI_30_SetInstoreParam = 3030,
SO_10_GoBack,
/// <summary>
/// 入库。。移动到库位点,旋转轴至P2( 库位点)轴2(上下) 至P3(库位入库前点)
/// 单盘出库:移动到出料口,旋转轴到P11,升降轴到P12高点
/// </summary>
BI_51_MoveToBag = 3051,
SO_21_ToOutDoor,
/// <summary>
/// 入库。。叉子进入库位中,进出轴到库位P3
/// 单盘出库:打开出料口门
/// </summary>
BI_52_DeviceToBag = 3052,
SO_22_OpenOutDoor,
/// <summary>
/// 入库。。放下物品,升降轴到库位缓冲点P4,压紧轴到P3
/// 单盘出库:进出轴到_P11-出料口取放料点
/// </summary>
BI_53_PutWareToBag = 3053,
SO_23_InoutToP11,
/// <summary>
/// 入库。。叉子从库位中返回,进出轴到P1
/// 单盘出库:升降轴到_P11-出料口-低点,压紧轴到压紧前点P3
/// </summary>
BI_54_DeviceBackFromBag = 3054,
SO_24_PurReel,
/// <summary>
/// 入库。。返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始
/// 单盘出库:进出轴返回待机点P1
/// </summary>
BI_55_GoBack = 3055,
SO_25_InoutToP1,
/// <summary>
/// 单盘出库:升降轴,旋转轴,压紧轴返回P1,关闭出料口门
/// </summary>
SO_26_GoBack,
#endregion
#region 流水线模块复位 1001开始
/// <summary>
/// 送出料盘:扫码或获取库位失败,升降轴移动到NG料门口上端,旋转轴移动到NG料门口
/// 复位:所有阻挡上升
/// </summary>
BI_71_ToNGDoor = 3071,
LR_01_StopUp = 1001,
/// <summary>
/// 送出料盘:NG料口升降门上升
/// 复位:流水线转动3秒
/// </summary>
BI_72_NGDoorUp = 3072,
LR_02_LineRun,
/// <summary>
/// 送出料盘:进出轴前进到NG料门口位置
/// 复位:夹爪放松,提升轴回原点,上下轴回原点
/// </summary>
BI_73_InoutToNGDoor = 3073,
LR_03_BatchAxisHome,
/// <summary>
/// 送出料盘:升降轴缓慢下降,放下料盘
/// 复位:提升轴到P1点,上下轴到待机点P1
/// </summary>
BI_74_UpdownDown = 3074,
LR_04_BatchToP1,
/// <summary>
/// 送出料盘:叉子后退到P1
/// 复位:取料电机后退,旋转轴回原点
/// </summary>
BI_75_InoutToP1 = 3075,
LR_05_Hoister_Back,
/// <summary>
/// 送出料盘:关门NG料门,送出料盘结束
/// 复位:顶升气缸下降,旋转轴到待机点P1
/// </summary>
BI_76_NGDoorDown = 3076,
LR_06_TopDown,
/// <summary>
/// NG流水线转动指定的时间3000
/// 复位:等待料仓复位完成
/// </summary>
BI_77_NGLineRun = 3078,
LR_07_WaitBox,
#endregion
#region 把料架送出步骤 4000开始
/// <summary>
/// 送出空料架:顶升气缸下降
/// </summary>
BS_01_TopDown = 4001,
/// <summary>
/// 送出空料架:定位气缸下降
/// </summary>
BS_02_LocatinDown = 4002,
#region 入料装置入料处理,2001 开始
//线体入口料串检测到料架
// 链条转动到线体上料等待区检测
//提升伺服先上升到待机点,SL1升降盘定位气缸1后退,定位气缸下降,料架才能进入上料工位
//料架进入上料工位后,定位气缸先上升
//提升伺服下降到P2
////升降盘定位气缸前进
//提升伺服缓慢上升,绝对位置=P1,若上升到P1么有X105,那么没有料盘
// 检测到X105信号,提升伺服停止
// 上料横移机构取料
// 上料横移机构下降
// 上料横移机构夹紧
// 上料横移机构上升
// 提升伺服开始缓慢上升到位
// 计算高度,宽度并记录
// 上料横移机构到放料端
//等待拦截到托盘,并顶升上升,定位上升
// 上料横移机构下降
// 移栽伺服下降到对应盘高位置
//上料气缸放松
// 移栽伺服上升,
// 上料横移机构上升
/// <summary>
/// 通知AGV准备空车
/// 提升轴先返回P1
/// </summary>
BS_03_WaitEmptyAgv = 4003,
LI_00_BatchAxisToP1 = 2001,
/// <summary>
/// 送出空料架:打开仓门
/// 入料流程:升降盘定位气缸后退
/// </summary>
BS_04_DoorOpen = 4004,
LI_01_TrayLocation_After,
/// <summary>
/// 送出空料架:等待agvReady
/// 入料流程:定位气缸下降
/// </summary>
BS_05_WaitReady=4005,
LI_02_LocationCylinder_Down,
/// <summary>
/// 送出空料架:线体反转
/// 入口流水线转动,等待入料检测信号消失
/// </summary>
BS_06_LineBackRun = 4006,
LI_03_LineStart,
/// <summary>
/// 送出空料架:等待取料工位无信号
/// 入口流水线转动,等待定位工位信号稳定1秒
/// </summary>
BS_07_WaitShelfOut=4007,
LI_04_WaitTime,
/// <summary>
/// 送出空料架:等待取料工位无信号,入料口有信号
///入料检测: 工位检测信号,定位气缸上升
/// </summary>
BS_08_WaitLineIn = 4008,
LI_05_LocationCylinder_Up,
/// <summary>
/// 送出空料架:再转动3000时间
/// 入料检测:提升轴下降到位P2
/// </summary>
BS_09_WaitTime = 4009,
LI_06_BatchAxisToP2,
/// <summary>
/// 送出空料架:等待AGV离开后关闭仓门
/// 入料检测:升降盘定位气缸第一次前进
/// </summary>
BS_10_WaitAGVLeave = 4010,
LI_07_TrayLocation_Before,
/// <summary>
/// 送出空料架:关闭仓门
/// 入料检测:升降盘定位气缸第一次后退
/// </summary>
BS_11_CloseDoor = 4011,
#endregion
#region 料仓内部出库步骤
LI_08_TrayLocation_Back,
/// <summary>
///料仓出库,,定位气缸下降
/// 入料检测:升降盘定位气缸前进
/// </summary>
SO_01_LocationCylinderDown = 101,
LI_09_TrayLocation_Before,
/// <summary>
///料仓出库:叉子先运动到P1
/// 入料检测:上料轴开始慢速上升到P3点,等待检测到料盘
/// </summary>
SO_02_DeviceBack = 102,
LI_10_AxisUpMove,
/// <summary>
/// 料仓出库,,所有轴运行到库位, 轴4( 压紧) 至P3(压紧前点) ,轴1( 转盘) 至P2( 库位点),轴2(上下) 至P5(库位出库前点)
/// </summary>
SO_03_ToBagPosition = 103,
/// <summary>
/// 料仓出库,,叉子进入库位中, 轴3( 叉子) 至P3(库位取放料点)
/// 入料取料:横移机构先上升
/// </summary>
SO_04_DeviceToBag = 104,
LI_11_CylinderUp,
/// <summary>
///料仓出库,, 库位的物品放入叉子上,轴2( 上下) 至P6( 库位出料缓冲点),轴4( 压紧) 至P2(压紧点)
/// 入料取料:上料机构到放料端
/// </summary>
SO_05_BagWareToDevice = 105,
LI_12_CylinderGive,
/// <summary>
///料仓出库,,叉子从 库位返回,轴3( 叉子) 至P1( 待机点)
/// 入料检测到料盘:扫码
/// </summary>
SO_06_BagDeviceBack = 106,
LI_13_ScanCode,
/// <summary>
/// 料仓出库,等待检测到料盘信号
/// 料盘移栽:有料盘:上料横移机构取料
/// </summary>
SO_07_CheckTray = 107,
LI_14_CylinderTake,
/// <summary>
/// 料仓出库,,所有设备运行到门,,轴1( 转盘) 至P1( 待机点)轴2( 上下) 至P2( 进料口出料前点)
/// 料盘移栽:升降轴到P3
/// </summary>
SO_08_ToDoorPosition = 108,
LI_15_UpdownAxisToP3,
/// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// 料盘移栽:上料横移机构夹紧
/// </summary>
SO_09_LocationCylinder_Down = 109,
LI_16_CylinderTighten,
/// <summary>
/// 等待门口无料盘
/// 料盘移栽:升降伺服到P1点
/// </summary>
SO_091_WaitNoTray = 120,
LI_17_UpdownAxisToP1,
/// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
SO_10_DeviceToDoor = 110,
/// 料盘移栽:等待没有伺服料盘检测信号
/// </summary>
LI_18_WaitNoLocationCheck,
/// <summary>
/// 料仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// 料盘移栽:批量轴到P3点,检测是否有料盘
/// </summary>
SO_11_DevicePutWare = 111,
LI_19_BatchAxisToP3,
/// <summary>
/// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// 料盘移栽:记录高度尺寸
/// </summary>
SO_12_DeviceOutFromDoor = 112,
LI_20_SaveSize,
/// <summary>
/// 料仓出库:等待叉子无料盘
/// 料盘移栽: 上料横移气缸放料SOL
/// </summary>
SO_13_CheckTray = 113,
LI_21_CylinderGive,
/// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// 提升轴下降到料盘不溢出的位置
/// </summary>
SO_14_aGoBack = 114,
LI_22_BatchAxisDown,
/// <summary>
/// 等待拿走物品
/// 料盘移栽:从服务器获取入库库位号
/// </summary>
SO_15_WaitTake = 115,
#endregion
#region 料仓内部入库步骤 200开始
LI_23_GetPosID,
/// <summary>
/// 入库:进出轴返回P1
/// </summary>
SI_01_InoutToP1 = 201,
/// <summary>
/// 入库: 升降轴,旋转轴到P1,压紧轴到P3
/// 料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码
/// </summary>
SI_02_AxisBack,
LI_24_WaitTray,
/// <summary>
/// 入库:进出轴到P2( 进料口取料点)
/// </summary>
SI_03_InoutToP2,
/// <summary>
/// 入库:升降轴到P7( 进料口取料缓冲点)压紧轴到P2(压紧点)
/// 料盘移栽: 上料机构下降
/// </summary>
SI_04_GetReel,
LI_25_CylinderDown,
/// <summary>
/// 入库:进出轴返回P1
/// 料盘移栽: 上料气缸放松
/// </summary>
SI_05_InoutToP1,
LI_26_CylinderRelax,
/// <summary>
/// 入库:移动到库位点,旋转轴到P2( 库位点),升降轴到P3(库位入库前点)
/// 料盘移栽: 上料横移机构上升
/// </summary>
SI_06_ToPos,
LI_27_WaitCylinderUp,
/// <summary>
/// 入库:进出轴到P3(库位取放料点)
/// 料盘移栽:上料横移机构上升,定位或者顶升可以先下降
/// </summary>
SI_07_InoutToP3,
LI_28_CylinderUp,
/// <summary>
/// 入库:升降轴到P4( 库位入料缓冲点)压紧轴到P3( 压紧前点)
/// 料盘移栽:升降伺服到P1点
/// </summary>
SI_08_PutReel,
LI_29_UpDownAxisToP1,
/// <summary>
/// 入库:进出轴返回P1
/// 上料完成,未检测到料盘,提升伺服到P2点
/// </summary>
SI_09_InoutToP1,
LI_31_BatchAxisToP2 = 11031,
/// <summary>
/// 入库:旋转轴,升降轴,压紧轴到待机点P1
/// 上料完成,升降盘定位气缸后退
/// </summary>
SI_10_GoBack,
LI_32_TrayLocationCylinder_After = 11032,
/// <summary>
/// 入库NG料:移动到出料口,旋转轴到P11,升降轴到P12高
/// 上料完成,提升伺服到P1
/// </summary>
SI_21_ToOutDoor,
LI_33_BatchAxisToP1 = 11033,
/// <summary>
/// 入库NG料:打开出料口门
/// 上料完成,等待出料线体无料架
/// </summary>
SI_22_OpenOutDoor,
LI_34_OutCheck = 11034,
/// <summary>
/// 入库NG料:进出轴到_P11-出料口取放料点
/// 上料完成,出口顶升气缸上升
/// </summary>
SI_23_InoutToP11,
LI_35_OutTopCylinder_Up = 11035,
/// <summary>
/// 入库NG料:升降轴到_P11-出料口-低点,压紧轴到压紧前点P3
///上料完成, 线体横移电机运转,等待料架到达出口
/// </summary>
SI_24_PurReel,
LI_36_SideWayLineRun = 11036,
/// <summary>
/// 入库NG料:进出轴返回待机点P1
///上料完成,等待料架到达出口
/// </summary>
SI_25_InoutToP1,
LI_37_WaitShelfGo = 11307,
/// <summary>
/// 入库NG料:升降轴,旋转轴,压紧轴返回P1,关闭出料口门
///上料完成, 料架到达出口,线体横移电机停止
/// </summary>
SI_26_GoBack,
#endregion
#region 料仓内部出库 500 开始
LI_38_LineStop,
/// <summary>
///料仓出库:进出轴到P1
///上料完成, 料架到达出口,出口顶升下降,定位气缸下降,
/// </summary>
SO_01_InoutBack =501,
LI_39_TopDown,
/// <summary>
/// 料仓出库:压紧轴到压紧前点P3 ,旋转轴到库位点P2,轴2(上下) 至P5(库位出库前点)
///上料完成, 出口线体运转,料架到达出口处, 通知AGV取空料架
/// </summary>
SO_02_ToPosition,
LI_39_OutLineRun,
/// <summary>
/// 料仓出库:进出轴到库位P3
///上料完成, AGV到达,继续转动出口线体,送走出料料架,
/// </summary>
SO_03_InoutToP3,
LI_40_OutLineRun,
/// <summary>
///料仓出库:升降轴到P6,轴4( 压紧) 至P2(压紧点)
///上料完成, 料架送出,
/// </summary>
SO_04_GetReel,
LI_41_OutLineRun,
#endregion
/// <summary>
///料仓出库:进出轴返回P1
/// </summary>
SO_05_InoutBack,
#region 把料架送出步骤 4000开始
/// <summary>
/// 料仓出库:旋转轴至P1,升降轴至P2
/// 送出空料架:顶升气缸下降
/// </summary>
SO_06_ToDoor,
BS_01_TopDown = 4001,
/// <summary>
/// 料仓出库:进出轴到P2
/// /// </summary>
SO_07_InoutToP2,
/// 送出空料架:定位气缸下降
/// </summary>
BS_02_LocatinDown = 4002,
/// <summary>
/// 料仓出库: 放下物品 升降轴至P1,压紧轴到P3
/// 通知AGV准备空车
/// </summary>
SO_08_PutReel,
BS_03_WaitEmptyAgv = 4003,
/// <summary>
/// 料仓出库: 进出轴到P1
/// 送出空料架:打开仓门
/// </summary>
SO_09_InoutBack,
BS_04_DoorOpen = 4004,
/// <summary>
/// 料仓出库:升降轴,旋转轴到待机点P1
/// 送出空料架:等待agvReady
/// </summary>
SO_10_GoBack,
BS_05_WaitReady = 4005,
/// <summary>
/// 单盘出库:移动到出料口,旋转轴到P11,升降轴到P12高点
/// 送出空料架:线体反转
/// </summary>
SO_21_ToOutDoor,
BS_06_LineBackRun = 4006,
/// <summary>
/// 单盘出库:打开出料口门
/// 送出空料架:等待取料工位无信号
/// </summary>
SO_22_OpenOutDoor,
BS_07_WaitShelfOut = 4007,
/// <summary>
/// 单盘出库:进出轴到_P11-出料口取放料点
/// 送出空料架:等待取料工位无信号,入料口有信号
/// </summary>
SO_23_InoutToP11,
BS_08_WaitLineIn = 4008,
/// <summary>
/// 单盘出库:升降轴到_P11-出料口-低点,压紧轴到压紧前点P3
/// 送出空料架:再转动3000时间
/// </summary>
SO_24_PurReel,
BS_09_WaitTime = 4009,
/// <summary>
/// 单盘出库:进出轴返回待机点P1
/// 送出空料架:等待AGV离开后关闭仓门
/// </summary>
SO_25_InoutToP1,
BS_10_WaitAGVLeave = 4010,
/// <summary>
/// 单盘出库:升降轴,旋转轴,压紧轴返回P1,关闭出料口
/// 送出空料架:关闭仓
/// </summary>
SO_26_GoBack,
BS_11_CloseDoor = 4011,
#endregion
}
public enum AlarmType
......
......@@ -113,6 +113,20 @@ namespace OnlineStore.DeviceLibrary
{
return moveStep.Equals(step);
}
public bool IsTimeOut(int timeOutSeconds = 60)
{
TimeSpan span = DateTime.Now - LastSetpTime;
if (span.TotalSeconds > timeOutSeconds)
{
return true;
}
return false;
}
public TimeSpan StepSpan()
{
TimeSpan span = DateTime.Now - LastSetpTime;
return span;
}
}
public class WaitResultInfo
......@@ -377,14 +391,6 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 重置
/// </summary>
StoreReset = 4,
///// <summary>
///// 移栽装置的停止,需要先远点返回,然后停止
///// </summary>
//StopMove=5,
///// <summary>
///// 移栽检测托盘
///// </summary>
//CheckFixture=6,
Reset = 4,
}
}
......@@ -40,7 +40,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
public static string RC_AC_SA = "RC_AC_SA";
/// <summary>
/// 松下伺服控制的包装料料仓
/// 松下伺服控制的DUO料仓
/// </summary>
public static string RC_AC_PA = "RC_AC_PA";
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!