Commit 73c46d62 LN

伺服增加STB

1 个父辈 5ef664e8
......@@ -8,8 +8,7 @@
<add key="App_AutoRun" value="1" />
<add key="App_Title" value="自动点料机" />
<!--<add key="ServerAddr" value="http://10.85.17.233"/>-->
<!--<add key="ServerAddr" value="http://10.85.17.233"/>-->
<add key="ConfigPath_Robot" value="\RobotConfig\Config_Robot.csv" />
<add key="ConfigPath_XRay" value="\RobotConfig\Config_XRay.csv" />
......@@ -28,7 +27,7 @@
<!--流水线监听端口-->
<add key="TCPServerPort" value="5246" />
<!--AGV调度服务器地址-->
<add key="AgvServerIp" value="10.85.160.20" />
<add key="AgvServerIp" value="10.85.199.20" />
<!--IO配置-->
<add key="DIMS" value="60" />
<add key="DOMS" value="300" />
......
......@@ -74,6 +74,8 @@
this.txtAxisValue = new System.Windows.Forms.TextBox();
this.txtAxisDeviceName = new System.Windows.Forms.TextBox();
this.lblServerOn = new System.Windows.Forms.Label();
this.txtStb = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.groupAxis.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
......@@ -91,13 +93,15 @@
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(9, 4);
this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(716, 297);
this.groupAxis.Size = new System.Drawing.Size(716, 309);
this.groupAxis.TabIndex = 218;
this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtStb);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtBusyStatus);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.txtHomeStatus);
......@@ -113,9 +117,9 @@
this.groupBox1.Controls.Add(this.txtLimit1);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.txtHomeSingle);
this.groupBox1.Location = new System.Drawing.Point(553, 11);
this.groupBox1.Location = new System.Drawing.Point(553, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(154, 277);
this.groupBox1.Size = new System.Drawing.Size(154, 290);
this.groupBox1.TabIndex = 302;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "状态";
......@@ -123,7 +127,7 @@
// txtBusyStatus
//
this.txtBusyStatus.Enabled = false;
this.txtBusyStatus.Location = new System.Drawing.Point(120, 80);
this.txtBusyStatus.Location = new System.Drawing.Point(120, 104);
this.txtBusyStatus.Name = "txtBusyStatus";
this.txtBusyStatus.Size = new System.Drawing.Size(25, 23);
this.txtBusyStatus.TabIndex = 288;
......@@ -131,7 +135,7 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(6, 113);
this.label11.Location = new System.Drawing.Point(6, 135);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(105, 17);
this.label11.TabIndex = 292;
......@@ -140,7 +144,7 @@
// txtHomeStatus
//
this.txtHomeStatus.Enabled = false;
this.txtHomeStatus.Location = new System.Drawing.Point(120, 110);
this.txtHomeStatus.Location = new System.Drawing.Point(120, 132);
this.txtHomeStatus.Name = "txtHomeStatus";
this.txtHomeStatus.Size = new System.Drawing.Size(25, 23);
this.txtHomeStatus.TabIndex = 291;
......@@ -148,7 +152,7 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(45, 83);
this.label10.Location = new System.Drawing.Point(45, 107);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(66, 17);
this.label10.TabIndex = 289;
......@@ -157,7 +161,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(52, 53);
this.label3.Location = new System.Drawing.Point(52, 51);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(59, 17);
this.label3.TabIndex = 286;
......@@ -166,7 +170,7 @@
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(40, 203);
this.label24.Location = new System.Drawing.Point(40, 219);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(71, 17);
this.label24.TabIndex = 316;
......@@ -176,7 +180,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(54, 23);
this.label5.Location = new System.Drawing.Point(52, 23);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(59, 17);
this.label5.TabIndex = 328;
......@@ -186,7 +190,7 @@
//
this.btnGetAlarm.BackColor = System.Drawing.Color.White;
this.btnGetAlarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGetAlarm.Location = new System.Drawing.Point(35, 233);
this.btnGetAlarm.Location = new System.Drawing.Point(35, 251);
this.btnGetAlarm.Name = "btnGetAlarm";
this.btnGetAlarm.Size = new System.Drawing.Size(110, 34);
this.btnGetAlarm.TabIndex = 284;
......@@ -197,7 +201,7 @@
// txtAlarmStatus
//
this.txtAlarmStatus.Enabled = false;
this.txtAlarmStatus.Location = new System.Drawing.Point(120, 50);
this.txtAlarmStatus.Location = new System.Drawing.Point(120, 48);
this.txtAlarmStatus.Name = "txtAlarmStatus";
this.txtAlarmStatus.Size = new System.Drawing.Size(25, 23);
this.txtAlarmStatus.TabIndex = 285;
......@@ -205,7 +209,7 @@
// txtLimit2
//
this.txtLimit2.Enabled = false;
this.txtLimit2.Location = new System.Drawing.Point(120, 200);
this.txtLimit2.Location = new System.Drawing.Point(120, 216);
this.txtLimit2.Name = "txtLimit2";
this.txtLimit2.Size = new System.Drawing.Size(25, 23);
this.txtLimit2.TabIndex = 313;
......@@ -221,7 +225,7 @@
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(40, 173);
this.label22.Location = new System.Drawing.Point(40, 191);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(71, 17);
this.label22.TabIndex = 312;
......@@ -231,7 +235,7 @@
// txtLimit1
//
this.txtLimit1.Enabled = false;
this.txtLimit1.Location = new System.Drawing.Point(120, 170);
this.txtLimit1.Location = new System.Drawing.Point(120, 188);
this.txtLimit1.Name = "txtLimit1";
this.txtLimit1.Size = new System.Drawing.Size(25, 23);
this.txtLimit1.TabIndex = 309;
......@@ -239,7 +243,7 @@
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(52, 143);
this.label6.Location = new System.Drawing.Point(52, 163);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(59, 17);
this.label6.TabIndex = 300;
......@@ -248,7 +252,7 @@
// txtHomeSingle
//
this.txtHomeSingle.Enabled = false;
this.txtHomeSingle.Location = new System.Drawing.Point(120, 140);
this.txtHomeSingle.Location = new System.Drawing.Point(120, 160);
this.txtHomeSingle.Name = "txtHomeSingle";
this.txtHomeSingle.Size = new System.Drawing.Size(25, 23);
this.txtHomeSingle.TabIndex = 297;
......@@ -654,12 +658,29 @@
this.lblServerOn.Size = new System.Drawing.Size(0, 19);
this.lblServerOn.TabIndex = 268;
//
// txtStb
//
this.txtStb.Enabled = false;
this.txtStb.Location = new System.Drawing.Point(120, 76);
this.txtStb.Name = "txtStb";
this.txtStb.Size = new System.Drawing.Size(25, 23);
this.txtStb.TabIndex = 329;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(54, 79);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(57, 17);
this.label2.TabIndex = 330;
this.label2.Text = "STB状态:";
//
// AxisMoveControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.groupAxis);
this.Name = "AxisMoveControl";
this.Size = new System.Drawing.Size(731, 305);
this.Size = new System.Drawing.Size(731, 317);
this.groupAxis.ResumeLayout(false);
this.groupAxis.PerformLayout();
this.groupBox1.ResumeLayout(false);
......@@ -718,5 +739,7 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox comjSpeed;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.TextBox txtStb;
private System.Windows.Forms.Label label2;
}
}
......@@ -158,6 +158,7 @@ namespace OnlineStore.AutoCountClient
{
this.txtAlarmStatus.Text = ACServerManager.GetAlarmStatus(PortName, SlvAddr).ToString();
this.txtBusyStatus.Text = ACServerManager.GetBusyStatus(PortName, SlvAddr).ToString();
this.txtStb.Text = ACServerManager.GetSTBState(PortName, SlvAddr).ToString();
this.txtHomeStatus.Text = ACServerManager.GetHomeEndStatus(PortName, SlvAddr).ToString();
this.txtHomeSingle.Text = ACServerManager.GetHomeSingle(PortName, SlvAddr).ToString();
this.txtLimit1.Text = ACServerManager.GetLimitPositiveSingle(PortName, SlvAddr).ToString();
......
......@@ -4,8 +4,8 @@ PRO,0,左入料线体相机名称,LeftCamera,GigE:MV-CE200-10GC (00E02588201),,,,,
PRO,0,右入料线体相机名称,RightCamera,GigE:MV-CE200-10GC (00E02588199),,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,,
,,,,,,,,,
PRO,0,左侧上料口AGV站号名称,LeftAgvName,F1,,,,,
PRO,0,右侧上料口AGV站号名称,RightAgvName,F2,,,,,
PRO,0,左侧上料口AGV站号名称,LeftAgvName,D4,,,,,
PRO,0,右侧上料口AGV站号名称,RightAgvName,D3,,,,,
,,,,,,,,,
PRO,0,左侧提升轴待机点 P1,L_BatchAxisP1,100,,,,,
,0,左侧提升轴下降位置P2,L_BatchAxisP2,-48000,,,,,
......
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
,,,,,,,,,
PRO,0,空料架入口AGV站号名称,AgvInName,F3,,,,,
PRO,0,料架出口AGV站号名称,AgvOutName,F4,,,,,
PRO,0,空料串入口AGV站号名称,AgvInName,D1,,,,,
PRO,0,料串出口AGV站号名称,AgvOutName,D2,,,,,
,,,,,,,,,
PRO,0,相机名称,CameraName,GigE:MV-CE200-10GC (00E02588177),,,,,
,,,,,,,,,
......
......@@ -73,7 +73,7 @@ namespace OnlineStore.DeviceLibrary
int index = shelfId.IndexOf(',');
if (index > 0)
{
//紧急出料模块,料架离开时,mark=紧急料或者分配料,rfid=料架
//紧急出料模块,料串离开时,mark=紧急料或者分配料,rfid=料串
mark = shelfId.Substring(index + 1, shelfId.Length - index - 1);
shelfId = shelfId.Substring(0, index);
}
......@@ -85,7 +85,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.info("收到 AgvClient_CloseDoor [" + id + "] [" + rfid + "] ");
}
private static void AgvClient_Ready(string id, string rfid)
private static void AgvClient_Ready(string id, string rfid)
{
UpdateAction(id, ClientAction.Ready);
......@@ -97,6 +97,9 @@ namespace OnlineStore.DeviceLibrary
else if (RobotManager.robot.inputEquip.Config.RightAgvName.Equals(id))
{
RobotManager.robot.inputEquip.LeftBatchMove.AgvReady(id, rfid);
}else if (RobotManager.robot.outputEquip.Config.AgvInName.Equals(id)|| RobotManager.robot.outputEquip.Config.AgvOutName.Equals(id))
{
RobotManager.robot.outputEquip.AgvReady(id, rfid);
}
else
{
......
......@@ -3,6 +3,7 @@ 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;
......@@ -78,7 +79,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
if (Robot.AutoInput&& Robot.IOValue(IO_LineIn_Check).Equals(IO_VALUE.HIGH))
if (Robot.AutoInput && Robot.IOValue(IO_LineIn_Check).Equals(IO_VALUE.HIGH))
{
StartWorking(new WorkParam());
}
......@@ -92,8 +93,26 @@ namespace OnlineStore.DeviceLibrary
{
WorkingProcess();
}
}
//判断是否无料串
if (Robot.IOValue(IO_LineIn_Check).Equals(IO_VALUE.LOW)
&& Robot.IOValue(IO_LineEnd_Check).Equals(IO_VALUE.LOW)
&& Robot.CylinderIsOk(IO_LocationUp_1, IO_LocationDown_1)
&& Robot.CylinderIsOk(IO_LocationUp_2, IO_LocationDown_2))
{
if (RobotManager.checkWatch(shelfWatch, 3000, true))
{
AgvClient.NeedEnter(AgvName, "", Asa.ClientLevel.High);
}
}
else
{
shelfWatch.Stop();
AgvClient.SetToNone(AgvName);
}
}
private Stopwatch shelfWatch = new Stopwatch();
public bool Reset(bool needStop = false)
{
if (Robot.CanStartRun())
......
......@@ -12,7 +12,7 @@ namespace OnlineStore.DeviceLibrary
{
partial class BatchMoveBean
{
#region 入料处理
#region 入料处理
internal string CurrShelfId = "";
......@@ -34,7 +34,7 @@ namespace OnlineStore.DeviceLibrary
//runStatus = RobotRunStatus.Busy;
MoveInfo.NewMove(RobotMoveType.Working);
MoveInfo.MoveParam = new WorkParam();
//判断是哪个工位有料
//判断是哪个工位有料
IB05_WaitTime();
}
......@@ -54,13 +54,13 @@ namespace OnlineStore.DeviceLibrary
{
try
{
//判断料的编码是否正确
//判断料的编码是否正确
RFIDData rfidD = RFIDManager.ReadRFID(RfidIP);
CurrShelfId = rfidD.NumStr;
//发送料信息给调度系统
//发送料信息给调度系统
// AgvClient.SendRFID(Config.AgvInName, CurrShelfId);
LogUtil.info(Name + "读取到料编号:" + CurrShelfId);
LogUtil.info(Name + "读取到料编号:" + CurrShelfId);
}
catch (Exception ex)
{
......@@ -72,7 +72,7 @@ namespace OnlineStore.DeviceLibrary
private void IB04_LineStart()
{
MoveInfo.NextMoveStep(StepEnum.IB04_LineStart);
WorkLog(" 入口检测到料,流水线转动 3000,等待料串完全进入轨道");
WorkLog(" 入口检测到料,流水线转动 3000,等待料串完全进入轨道");
LineRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineIn_Check, IO_VALUE.HIGH));
......@@ -81,9 +81,9 @@ namespace OnlineStore.DeviceLibrary
private void IB05_WaitTime()
{
// 定位工位有料,等待1秒后再次检测
// 定位工位有料,等待1秒后再次检测
MoveInfo.NextMoveStep(StepEnum.IB05_WaitTime);
WorkLog("定位工位检测到料: 链条转动, 3秒再次检测");
WorkLog("定位工位检测到料: 链条转动, 3秒再次检测");
LineRun();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
......@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
#region 入料:料进入并开始检测托盘
#region 入料:料进入并开始检测托盘
if (MoveInfo.IsStep(StepEnum.IB01_Wait))
{
WorkLog("料串入料 :提升伺服移动到P1,顶升气缸下降");
......@@ -128,7 +128,7 @@ namespace OnlineStore.DeviceLibrary
{
LineStop();
MoveInfo.EndMove();
LogUtil.info(" 未检测到料,入料结束");
LogUtil.info(" 未检测到料,入料结束");
}
}
else if (MoveInfo.IsStep(StepEnum.IB05_WaitTime))
......@@ -139,21 +139,21 @@ namespace OnlineStore.DeviceLibrary
// UpdateShelfId();
//if (CurrShelfId.EndsWith("00"))
//{
// SendShelfOut(" 料号【" + CurrShelfId + "】无效 ");
// SendShelfOut(" 料号【" + CurrShelfId + "】无效 ");
//}
//else
// {
MoveInfo.ShelfNoTray = false;
//定位工位有料,直接开始入料
//定位工位有料,直接开始入料
MoveInfo.NextMoveStep(StepEnum.IB06_LocationUp);
WorkLog("检测到料:链条停止转动,定位气缸上升");
WorkLog("检测到料:链条停止转动,定位气缸上升");
LocationUp(MoveInfo);
// }
}
else
{
MoveInfo.EndMove();
WorkLog(" 未检测到料,链条停止转动,入料结束");
WorkLog(" 未检测到料,链条停止转动,入料结束");
}
}
......@@ -208,7 +208,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.IB22_LocationDown))
{
MoveInfo.NextMoveStep(StepEnum.IB23_ShelfOut);
WorkLog("上料完成 :通知agv来取料,等待料串离开");
WorkLog("上料完成 :通知agv来取料,等待料串离开");
AgvClient.NeedLeave(AgvName, CurrShelfId, ClientLevel.High);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineIn_Check, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(60000));
......@@ -463,7 +463,7 @@ namespace OnlineStore.DeviceLibrary
{
Task.Factory.StartNew(delegate
{
string logName = Name + "AGV料架进入 [" + AgvName + "] ";
string logName = Name + "料串 [AGV->" + AgvName + "] ";
try
{
if (Robot.IOValue(IO_LineIn_Check).Equals(IO_VALUE.LOW) && Robot.IOValue(IO_LineEnd_Check).Equals(IO_VALUE.LOW))
......@@ -499,7 +499,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(logName + "等待3000后,停止链条转动");
LineStop();
//料可离开
//料可离开
AgvClient.SetStatus(AgvName, "", ClientAction.FinishEnter, ClientLevel.High, true);
Task.Factory.StartNew(delegate
{
......@@ -511,7 +511,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
//入口有料,暂不处理
//入口有料,暂不处理
}
}
catch (TimeoutException te)
......@@ -550,10 +550,10 @@ namespace OnlineStore.DeviceLibrary
internal void ShelfOutProcess()
{
//AGV已到达,将料送入AGV中
//AGV已到达,将料送入AGV中
Task.Factory.StartNew(delegate
{
string logName = Name + "[" + AgvName + "] 料架送入AGV ";
string logName = Name + "[" + AgvName + "->AGV ] ";
try
{
LogUtil.info(logName + "开始,先设置状态为None");
......@@ -581,11 +581,11 @@ namespace OnlineStore.DeviceLibrary
AgvClient.SetStatus(AgvName, "", ClientAction.None, ClientLevel.High, true);
});
ProcessShelfOut = false;
LogUtil.info(logName + ",停止转动,清空料[" + CurrShelfId + "], 结束");
LogUtil.info(logName + ",停止转动,清空料[" + CurrShelfId + "], 结束");
}
else
{
LogUtil.info(logName + "开始,未检测到料信号,不处理");
LogUtil.info(logName + "开始,未检测到料信号,不处理");
}
}
catch (TimeoutException te)
......
......@@ -360,7 +360,7 @@ namespace OnlineStore.DeviceLibrary
string msg = "";
int tLength = 15;
msg += "左侧料架:" + LeftBatchMove.CurrShelfId + " 右侧料架:"+RightBatchMove.CurrShelfId+" \r\n";
msg += "左侧料串:" + LeftBatchMove.CurrShelfId + " 右侧料串:"+RightBatchMove.CurrShelfId+" \r\n";
msg += "runS: " + runStatus + "\n";
msg += "alarm: " + alarmType + " " + LeftBatchMove.alarmType +" " + RightBatchMove.alarmType +"\n";
......
......@@ -3,6 +3,7 @@ using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
......@@ -136,6 +137,8 @@ namespace OnlineStore.DeviceLibrary
ShelfMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.O_WLine_WorkStop, IO_VALUE.LOW));
isInPro = false;
}
protected override void ResetProcess()
{
if (MoveInfo.MoveType.Equals(RobotMoveType.Reset) || MoveInfo.MoveType.Equals(RobotMoveType.RHome))
......@@ -388,7 +391,8 @@ namespace OnlineStore.DeviceLibrary
}
}
}
private Stopwatch needEnterWatch = new Stopwatch();
private Stopwatch needLeaveWatch = new Stopwatch();
protected override void BaseTimerProcess()
{
if (isInSuddenDown || isNoAirCheck)
......@@ -414,13 +418,44 @@ namespace OnlineStore.DeviceLibrary
{
if (NoErrorAlarm() && IOValue(IO_Type.Out_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.X_OLine_Run).Equals(IO_VALUE.LOW))
{
//料准备好才能取料
if (OutReelCount >= 0&& SecMoveInfo.MoveType.Equals(RobotMoveType.None))
//料准备好才能取料
if (OutReelCount >= 0 && SecMoveInfo.MoveType.Equals(RobotMoveType.None))
{
StartWorking(new WorkParam());
}
}
}
}
//入口无信号NeedEnter
if (IOValue(IO_Type.O_ELine_InCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.O_WLine_InCheck).Equals(IO_VALUE.LOW) && CylinderIsOk(IO_Type.O_ELine_TopUp, IO_Type.O_ELine_TopDown))
{
if (RobotManager.checkWatch(needEnterWatch, 3000))
{
AgvClient.NeedEnter(Config.AgvInName, "", Asa.ClientLevel.High);
}
}
else
{
needEnterWatch.Stop();
AgvClient.SetToNone(Config.AgvInName);
}
//出口有信号NeedLeave
if (IOValue(IO_Type.O_WLine_OutCheck).Equals(IO_VALUE.HIGH))
{
if (RobotManager.checkWatch(needLeaveWatch, 3000))
{
AgvClient.NeedEnter(Config.AgvOutName, "", Asa.ClientLevel.High);
}
}
else
{
needLeaveWatch.Stop();
AgvClient.SetToNone(Config.AgvOutName);
}
if (NoErrorAlarm())
{
......@@ -473,12 +508,12 @@ namespace OnlineStore.DeviceLibrary
msg += "alarm: " + alarmType + "\n";
msg += "取料状态:" + MoveInfo.MoveType + " " + MoveInfo.MoveStep + "\n";
msg += "贴标状态:" + SecMoveInfo.MoveType + " " + SecMoveInfo.MoveStep + "\n";
msg += "料状态:" + ShelfMoveInfo.MoveType + " " + ShelfMoveInfo.MoveStep + "\n";
msg += "料状态:" + ShelfMoveInfo.MoveType + " " + ShelfMoveInfo.MoveStep + "\n";
//msg += "料盘信息:" + MoveInfo.MoveParam.ToStr() + " \r\n";
// msg += "标签信息:" + Out_ReelInfo.ToStr() + " \r\n";
msg += "当前料:" + WorkShelfId + ",累积出料 "+OutReelCount+" 盘共 "+OutReelHeight+" mm \r\n";
msg += "当前料:" + WorkShelfId + ",累积出料 "+OutReelCount+" 盘共 "+OutReelHeight+" mm \r\n";
msg += "打印机["+RobotManager.PrintName+"]:" + RobotManager.LastPrintStatus + "\n";
return msg;
......@@ -647,5 +682,8 @@ namespace OnlineStore.DeviceLibrary
#endregion
}
}
......@@ -189,7 +189,7 @@ namespace OnlineStore.DeviceLibrary
else
{
MoveInfo.NextMoveStep(StepEnum.OT11_WaitShelfOk);
WorkLog("取料完成,等待料可放料 ");
WorkLog("取料完成,等待料可放料 ");
}
}
else if (MoveInfo.IsStep(StepEnum.OT11_WaitShelfOk))
......@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
if (shelfOk || debugOk)
{
MoveInfo.NextMoveStep(StepEnum.OT12_MoveXToP3);
WorkLog("放料:料可放料,取料X轴移动到P3 ");
WorkLog("放料:料可放料,取料X轴移动到P3 ");
MoveXAxis.AbsMove(MoveInfo, Config.MoveX_P3, Config.MoveX_P3Speed);
if (shelfOk)
......@@ -217,7 +217,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "等待出料料准备完成(OS_18_ShelfReady)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]秒";
WarnMsg = MoveInfo.Name + "等待出料料准备完成(OS_18_ShelfReady)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]秒";
LogUtil.error(WarnMsg);
Alarm(AlarmType.IoSingleTimeOut);
}
......@@ -234,7 +234,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "等待出料料可放料(OS_22_WaitTray)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]秒";
WarnMsg = MoveInfo.Name + "等待出料料可放料(OS_22_WaitTray)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]秒";
LogUtil.error(WarnMsg);
Alarm(AlarmType.IoSingleTimeOut);
}
......@@ -256,7 +256,7 @@ namespace OnlineStore.DeviceLibrary
OutReelHeight += MoveInfo.MoveParam.PlateH;
OutReelCount += 1;
ShelfMoveInfo.NextMoveStep(StepEnum.OS_23_TrayOK);
ShelfWorkLog("料盘已放入料,累积出料 【" + OutReelHeight + "】盘共 " + OutReelHeight + " mm");
ShelfWorkLog("料盘已放入料,累积出料 【" + OutReelHeight + "】盘共 " + OutReelHeight + " mm");
}
}
else if (MoveInfo.IsStep(StepEnum.OT15_MoveZToP1))
......@@ -356,7 +356,8 @@ namespace OnlineStore.DeviceLibrary
else if (SecMoveInfo.IsStep(StepEnum.OL02_TakeForward))
{
SecMoveInfo.NextMoveStep(StepEnum.OL03_PrintLabel);
SecWorkLog("贴标: 开始打印标签 ,等待2000ms");
RobotManager.LastPrintStatus = Asa.PrintLabel.PrinterStatus.Unknown;
SecWorkLog("贴标: 开始打印标签 ,重置状态=Unknown,等待2000ms");
SecMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
StartPrintLabel(SecMoveInfo.MoveParam.WareCode, SecMoveInfo.MoveParam.WareCount.ToString());
}
......@@ -364,13 +365,18 @@ namespace OnlineStore.DeviceLibrary
{
SecMoveInfo.NextMoveStep(StepEnum.OL04_PrintOk);
SecWorkLog("贴标: 等待 贴标机打码OK信号");
SecMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
// SecMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
else if (SecMoveInfo.IsStep(StepEnum.OL04_PrintOk))
{
SecMoveInfo.NextMoveStep(StepEnum.OL05_TakeBack);
SecWorkLog("贴标: 取码气缸后退");
CylinderMove(SecMoveInfo, IO_Type.TakeCode_Forward, IO_Type.TakeCode_Back);
bool isPrintOk = RobotManager.LastPrintStatus.Equals(Asa.PrintLabel.PrinterStatus.Idle);
bool isTimeOut = SecMoveInfo.IsTimeOut(120);
if (isPrintOk || isTimeOut)
{
SecMoveInfo.NextMoveStep(StepEnum.OL05_TakeBack);
SecWorkLog("贴标: 打印结束["+ RobotManager.LastPrintStatus + "]["+(isTimeOut?"超时120秒":"")+"],取码气缸后退");
CylinderMove(SecMoveInfo, IO_Type.TakeCode_Forward, IO_Type.TakeCode_Back);
}
}
else if (SecMoveInfo.IsStep(StepEnum.OL05_TakeBack))
{
......
......@@ -45,7 +45,7 @@ namespace OnlineStore.DeviceLibrary
IsDebug = Config.IsDebug.Equals(1);
AgvClient.Init();
List<string> ioList = new List<string>();
ioList = new List<string>(DeviceConfig.ProIOIpMap.Values);
......@@ -57,8 +57,11 @@ namespace OnlineStore.DeviceLibrary
equipsMap.Add(3, outputEquip);
IOManager.Init();
CodeManager.LoadConfig();
AgvClient.NodeList.Add(outputEquip.Config.AgvInName);
AgvClient.NodeList.Add(outputEquip.Config.AgvOutName);
AgvClient.NodeList.Add(inputEquip.Config.RightAgvName);
AgvClient.NodeList.Add(inputEquip.Config.LeftAgvName);
Task.Factory.StartNew(delegate
{
LogUtil.info(Name + "开始连接IO模块 ");
......
......@@ -92,7 +92,7 @@ namespace OnlineStore.DeviceLibrary
}
internal static bool IsRealRfid(string shelfRfid)
{
//判断料架号是否是真实的料架
//判断料串号是否是真实的料串
if (shelfRfid.StartsWith("C") || shelfRfid.StartsWith("D"))
{
int num = -1;
......
......@@ -4,6 +4,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
......@@ -176,6 +177,24 @@ namespace OnlineStore.DeviceLibrary
}
public static bool checkWatch(Stopwatch watch, int targetMs, bool isStop = true)
{
if (!watch.IsRunning)
{
watch.Restart();
return false;
}
else if (watch.ElapsedMilliseconds >= targetMs)
{
if (isStop)
{
watch.Stop();
}
return true;
}
return false;
}
private static List<int> trayHeightList = new List<int>() { 8, 12, 16, 24, 32, 44, 56 };
public static List<int> GetTrayList()
......
......@@ -116,7 +116,7 @@ namespace OnlineStore.DeviceLibrary
return codeStr;
}
//// 分盘料/紧急料放上料串或料时调用 /rest/api/qisda/device/afterPutCut
//// 分盘料/紧急料放上料串或料时调用 /rest/api/qisda/device/afterPutCut
//private static string Addr_afterPutCut = "/rest/api/qisda/device/afterPutCut";
//public static string afterPutCut(string deviceName, string rfid, string barcode, string cid, int rfidLoc, out TaskData afterData)
//{
......@@ -128,12 +128,12 @@ namespace OnlineStore.DeviceLibrary
// //cid: 料仓cid,流水线可传入空
// //barcode : 条码
// //rfid : RFID
// //rfidLoc: 料位置,流水线可传-1
// //rfidLoc: 料位置,流水线可传-1
// Dictionary<string, string> paramMap = new Dictionary<string, string>();
// paramMap.Add("barcode", barcode); // 参数: barcode=料盘的条码
// paramMap.Add("rfid", rfid); // rfid = 料的RFID信息
// paramMap.Add("rfidLoc", rfidLoc.ToString()); // rfidLoc=料的架位信息
// paramMap.Add("rfid", rfid); // rfid = 料的RFID信息
// paramMap.Add("rfidLoc", rfidLoc.ToString()); // rfidLoc=料的架位信息
// paramMap.Add("cid", cid); // 料仓cid,流水线可传入空
// string server = GetAddr(Addr_afterPutCut, paramMap);
// DateTime startTime = DateTime.Now;
......
......@@ -243,7 +243,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
IB04_LineStart,
/// <summary>
/// 料串入料:等待料稳定
/// 料串入料:等待料稳定
/// </summary>
IB05_WaitTime,
/// <summary>
......@@ -291,7 +291,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
IB22_LocationDown,
/// <summary>
/// 入料结束:通知agv来拉料
/// 入料结束:通知agv来拉料
/// </summary>
IB23_ShelfOut,
#endregion
......@@ -481,7 +481,7 @@ namespace OnlineStore.DeviceLibrary
OLR08_LabelRToP1,
#endregion
#region 批量轴模块复位
#region 批量轴模块复位
/// <summary>
/// 出料模块复位: 阻挡气缸上升
......@@ -565,11 +565,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 取料: 取料完成,等待料可放料
/// 取料: 取料完成,等待料可放料
/// </summary>
OT11_WaitShelfOk,
/// <summary>
/// 取料: 料可放料,取料X轴移动到P3,提升轴下降指定高度
/// 取料: 料可放料,取料X轴移动到P3,提升轴下降指定高度
/// </summary>
OT12_MoveXToP3,
/// <summary>
......@@ -719,82 +719,82 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
OL19_XYRBackToP1,
#endregion
#region 出料模块料处理 3701 开始
#region 出料模块料处理 3701 开始
/// <summary>
/// 出料料:升降盘不在后退端,提升伺服到P2
/// 出料料:升降盘不在后退端,提升伺服到P2
/// </summary>
OS_01_BatchAxisToP2 = 3701,
/// <summary>
/// 出料料:升降盘定位气缸后退
/// 出料料:升降盘定位气缸后退
/// </summary>
OS_02_TrayL_After,
/// <summary>
/// 出料料:定位气缸下降
/// 出料料:定位气缸下降
/// </summary>
OS_03_LocationDown,
/// <summary>
/// 出料料:提升轴移动到高处待机点P1
/// 出料料:提升轴移动到高处待机点P1
/// </summary>
OS_04_BatchAxisToP1,
/// <summary>
/// 出料料,等待空料串入料口有信号
/// 出料料,等待空料串入料口有信号
/// </summary>
OS_05_WaitECheck,
/// <summary>
/// 出料料:空料串,接料线体,入口顶升上升
/// 出料料:空料串,接料线体,入口顶升上升
/// </summary>
OS_06_TopUp,
/// <summary>
/// 出料料:空料串阻挡下降,横移电机运转
/// 出料料:空料串阻挡下降,横移电机运转
/// </summary>
OS_07_SWLineRun,
/// <summary>
/// 出料料:等待入料线进口信号亮
/// 出料料:等待入料线进口信号亮
/// </summary>
OS_08_WLineInCheck,
/// <summary>
/// 出料料架:空料串阻挡上升,等待1000毫秒料架到达接料线体
/// 出料料串:空料串阻挡上升,等待1000毫秒料串到达接料线体
/// </summary>
OS_09_WaitInWLine,
/// <summary>
/// 出料料:空料串阻挡上升,顶升下降,线体停止转动,
/// 出料料:空料串阻挡上升,顶升下降,线体停止转动,
/// </summary>
OS_10_TopDown,
/// <summary>
/// 出料料:接料线体工位阻挡上升,接料线体转动,等待工位检测信号,
/// 出料料:接料线体工位阻挡上升,接料线体转动,等待工位检测信号,
/// </summary>
OS_11_WLineRun,
/// <summary>
/// 出料料:工位检测信号亮,,在转动3000ms,
/// 出料料:工位检测信号亮,,在转动3000ms,
/// </summary>
OS_12_WorkCheck,
/// <summary>
/// 出料料:接料线体停止转动,
/// 出料料:接料线体停止转动,
/// </summary>
OS_13_StopLineRun,
/// <summary>
/// 出料料:工位定位气缸上升,
/// 出料料:工位定位气缸上升,
/// </summary>
OS_14_WLocationUp,
/// <summary>
/// 出料料:提升轴下降到P2,
/// 出料料:提升轴下降到P2,
/// </summary>
OS_15_BatchAxisToP2,
/// <summary>
/// 出料料:托盘定位前进,
/// 出料料:托盘定位前进,
/// </summary>
OS_16_WTrayLForward,
/// <summary>
/// 出料料:批量轴匀速到P3点,
/// 出料料:批量轴匀速到P3点,
/// </summary>
OS_17_BatchAxisToP3,
/// <summary>
/// 出料料架:料架准备完成,
/// 出料料串:料串准备完成,
/// </summary>
OS_18_ShelfReady,
......@@ -804,11 +804,11 @@ namespace OnlineStore.DeviceLibrary
OS_21_BatchDownH,
/// <summary>
/// 放料:等待料盘放入料
/// 放料:等待料盘放入料
/// </summary>
OS_22_WaitTray,
/// <summary>
/// 放料:等待料盘放入料
/// 放料:等待料盘放入料
/// </summary>
OS_23_TrayOK,
/// <summary>
......@@ -828,43 +828,43 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 送出料架:开始送出料架
/// 送出料串:开始送出料串
/// </summary>
OS_31_ShendShelfOut,
/// <summary>
/// 送出料:批量轴下降到P2,
/// 送出料:批量轴下降到P2,
/// </summary>
OS_32_BatchToP2,
/// <summary>
/// 送出料:托盘定位气缸后退,
/// 送出料:托盘定位气缸后退,
/// </summary>
OS_33_TrayFixedBack,
/// <summary>
/// 送出料:定位气缸下降,
/// 送出料:定位气缸下降,
/// </summary>
OS_34_LocationDown,
/// <summary>
/// 送出料:批量轴到P1,
/// 送出料:批量轴到P1,
/// </summary>
OS_35_BatchAxisToP1,
/// <summary>
/// 送出料架:等待出口无料架
/// 送出料串:等待出口无料串
/// </summary>
OS_36_WaitOutNoShelf,
/// <summary>
/// 送出料:出口阻挡上升
/// 送出料:出口阻挡上升
/// </summary>
OS_37_OutStopUp,
/// <summary>
/// 送出料:链条正转到出口有检测信号
/// 送出料:链条正转到出口有检测信号
/// </summary>
OS_38_LineRun,
......
......@@ -465,7 +465,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
Labelling = 4,
/// <summary>
/// 料处理
/// 料处理
/// </summary>
ShelfPro = 5,
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!