Commit f8d997d6 刘韬

1

1 个父辈 75d50573
......@@ -254,14 +254,24 @@ namespace DeviceLibrary
if (span.TotalSeconds > 2)
{
checkAlarmTime = DateTime.Now;
foreach (ConfigMoveAxis configMoveAxis in Config.moveAxisList)
AxisBean.List.ToList().ForEach((x) => { x.Value.ForEach(y => {
AxisManager.AlarmClear(y.Config.DeviceName, y.Config.GetAxisValue());
if (AxisManager.GetAlarmStatus(y.Config.DeviceName, y.Config.GetAxisValue()) == 1)
{
if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1)
{
Msg.add(crc.GetString(configMoveAxis.ProName, configMoveAxis.Explain) + $"[{configMoveAxis.GetAxisValue()}]:" + crc.GetString("Res0179","运动报警"), MsgLevel.alarm, ErrInfo.SuddenStop);
Msg.add(crc.GetString(y.Config.ProName, y.Config.Explain) + $"[{y.Config.GetAxisValue()}]:" + crc.GetString("Res0179", "运动报警"), MsgLevel.alarm, ErrInfo.SuddenStop);
ok = false;
var errcode = HuichuanLibrary.HCBoardManager.GetAxErrCode(y.Config.GetAxisValue());
var errcodebyte = BitConverter.GetBytes(errcode).ToList();
errcodebyte.Reverse();
HuichuanLibrary.HCBoardManager.GetSdo((ushort)y.Config.GetAxisValue(), 0x203f, 0, out byte[] data, out uint datalen);
var errdatabyte = data.ToList();
errdatabyte.Reverse();
LogUtil.error(y.Config.GetAxisValue() + "," + y.Config.Explain + " errcode " + BitConverter.ToString(errcodebyte.ToArray()) + "," + BitConverter.ToString(errdatabyte.ToArray()));
LogUtil.error(string.Join(",",HuichuanLibrary.HCBoardManager.GetAxisErrorDetail(y.Config.GetAxisValue())));
}
}
}); });
}
}
return ok;
......
......@@ -279,8 +279,8 @@ namespace DeviceLibrary
public static Dictionary<int, string> AddrDesc = new Dictionary<int, string>();
static TrayManager() {
TrayTypeDesc.Add(TrayTypeE.None, crc.GetString("Res0002","空"));
TrayTypeDesc.Add(TrayTypeE.MTP1, crc.GetString("Res0003","流水线治具托盘"));
TrayTypeDesc.Add(TrayTypeE.MTP2, crc.GetString("Res0004","流水线料盘托盘"));
TrayTypeDesc.Add(TrayTypeE.MTP1, crc.GetString("Res0004", "流水线料盘托盘"));
TrayTypeDesc.Add(TrayTypeE.MTP2, crc.GetString("Res0003","流水线治具托盘"));
TrayTypeDesc.Add(TrayTypeE.S007, crc.GetString("Res0005","料串"));
TrayTypeDesc.Add(TrayTypeE.M03, crc.GetString("Res0006","Tray料格"));
TrayTypeDesc.Add(TrayTypeE.M02, crc.GetString("Res0007","PCB料格"));
......
......@@ -100,6 +100,8 @@ namespace DeviceLibrary
}
int StopBufDelayMS = 500;
int StopDelayMS = 1000;
bool LastGoInFail = false;
DateTime LastGoInFailTime = DateTime.Now;
#region Rfid横移
public void NoRfidProcess()
{
......@@ -113,7 +115,13 @@ namespace DeviceLibrary
break;
case MoveStep.SideMove_01:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01);
if (IOValue(IO_Type.Ls_A_Front_Check).Equals(IO_VALUE.HIGH))
bool Forcetry = false;
if (LastGoInFail && (LastGoInFailTime - DateTime.Now).TotalSeconds > 5)
{
Forcetry = true;
LSAMoveInfo.log("上次托盘进入失败本次重试");
}
if (IOValue(IO_Type.Ls_A_Front_Check).Equals(IO_VALUE.HIGH)|| Forcetry)
{
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_02);
Location_A.ToLow(LSAMoveInfo);
......@@ -134,10 +142,17 @@ namespace DeviceLibrary
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04);
IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH, 500);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
LastGoInFail = false;
}
else if (LSAMoveInfo.IsTimeOut(10))
{
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01);
if (!LastGoInFail)
{
LastGoInFail = true;
LastGoInFailTime = DateTime.Now;
LSAMoveInfo.log("托盘进入失败");
}
}
break;
......@@ -215,6 +230,14 @@ namespace DeviceLibrary
case MoveStep.SideMove_01:
Minfo.NextMoveStep(MoveStep.SideMove_01);
bool Forcetry = false;
if (LastGoInFail && (LastGoInFailTime - DateTime.Now).TotalSeconds > 5)
{
Forcetry = true;
LSAMoveInfo.log("上次托盘进入失败本次重试");
}
if (lsb.MoveStep >= MoveStep.SideMove_10) {
Msg.add(sideb+crc.GetString("Res0015","侧穿越中"), MsgLevel.info);
}else if (IOValue(Ls_A_Tray_Check).Equals(IO_VALUE.HIGH))
......@@ -223,7 +246,7 @@ namespace DeviceLibrary
Minfo.NextMoveStep(MoveStep.SideMove_06);
Location_a.ToLow(Minfo);
}
else if (IOValue(Ls_A_Front_Check).Equals(IO_VALUE.HIGH))
else if (IOValue(Ls_A_Front_Check).Equals(IO_VALUE.HIGH) || Forcetry)
{
Minfo.NextMoveStep(MoveStep.SideMove_02);
Location_a.ToLow(Minfo);
......@@ -248,12 +271,17 @@ namespace DeviceLibrary
Minfo.log($"检测到进入的托盘");
Minfo.CanWhileCount = 3;
Minfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
else if (Minfo.IsTimeOut(10))
{
Minfo.log($"没有检测到进入的托盘");
Minfo.NextMoveStep(MoveStep.SideMove_01);
if (!LastGoInFail)
{
LastGoInFail = true;
LastGoInFailTime = DateTime.Now;
LSAMoveInfo.log("托盘进入失败");
}
}
break;
case MoveStep.SideMove_04:
......@@ -267,7 +295,7 @@ namespace DeviceLibrary
//Location_a.ToHigh(Minfo);
break;
case MoveStep.SideMove_05:
if (RFID.ReadByte(0x20,16,out byte[] data))
if (RFID.ReadByte(0x20,16,out byte[] data, out string errmsg))
{
var rfid = Common.RfidFilter(data);
TrayManager.Process(rfid, addr, out TrayInfo trayInfo);
......@@ -283,6 +311,7 @@ namespace DeviceLibrary
{
Minfo.CanWhileCount--;
Minfo.log($"RFid读取失败,重试第{3- Minfo.CanWhileCount}次");
Minfo.log("RFIDerr:" + errmsg);
Minfo.WaitList.Add(WaitResultInfo.WaitMsg(crc.GetString("Res0016","RFid读取失败"),MsgLevel.warning));
}
else {
......@@ -393,6 +422,10 @@ namespace DeviceLibrary
break;
case MoveStep.H01_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10 * 1000));
break;
case MoveStep.H02_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
IOMove(IO_Type.Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS);
IOMove(IO_Type.Ls_B_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS);
var loAdown = IOValue(IO_Type.Ls_A_Location_Down).Equals(IO_VALUE.HIGH);
......@@ -430,34 +463,34 @@ namespace DeviceLibrary
}
}
break;
case MoveStep.H02_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
case MoveStep.H03_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
Location_A.ToHigh(LSAMoveInfo);
Location_B.ToHigh(LSAMoveInfo);
if (LS_Type== LS_TypeE.NoRfid)
IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH,StopBufDelayMS);
LSAMoveInfo.log($"顶升顶起");
break;
case MoveStep.H03_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
case MoveStep.H04_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
Line.LineRun("n", false, 10);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LSAMoveInfo.log($"横移点击运行");
break;
case MoveStep.H04_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
case MoveStep.H05_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
Location_A.ToLow(LSAMoveInfo);
Location_B.ToLow(LSAMoveInfo);
LSAMoveInfo.log($"顶升下降");
break;
case MoveStep.H05_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
case MoveStep.H06_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
if (LS_Type!= LS_TypeE.NoRfid)
IOMove(IO_Type.Ls_B_Stop, IO_VALUE.HIGH, StopDelayMS);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LSAMoveInfo.log($"缓冲回退");
break;
case MoveStep.H06_HomeReset:
case MoveStep.H07_HomeReset:
LSAMoveInfo.log("回原完成");
DeviceState = DeviceStateE.Run;
LSAMoveInfo.EndMove();
......
......@@ -122,7 +122,7 @@ namespace DeviceLibrary
}
break;
case MoveStep.TransplantMove_03:
if (RFID_1.ReadByte(0x20, 16, out byte[] data))
if (RFID_1.ReadByte(0x20, 16, out byte[] data, out string errmsg))
{
CurrrentRFID = Common.RfidFilter(data);
MoveInfo.MoveParam.RFID = CurrrentRFID;
......@@ -200,6 +200,7 @@ namespace DeviceLibrary
{
MoveInfo.CanWhileCount--;
MoveInfo.log($"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次");
MoveInfo.log("RFIDerr:"+errmsg);
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(crc.GetString("Res0016", "RFid读取失败"), MsgLevel.warning));
}
else
......@@ -324,7 +325,7 @@ namespace DeviceLibrary
remoteLoad.RequestLoadInfo.LoadParam = MoveInfo.MoveParam.clone();
var tarytype = CurrrentTrayInfo.TrayType;
remoteLoad.RequestLoadInfo.TrayType = tarytype.ToString();
if (tarytype == TrayTypeE.MTP1)
if (tarytype == TrayTypeE.MTP2)
remoteLoad.RequestLoadInfo.DeviceGroupName = StoreCID.AMH_ML5_1;
else
remoteLoad.RequestLoadInfo.DeviceGroupName = StoreCID.AMH_ML5_2;
......
......@@ -121,7 +121,7 @@ namespace DeviceLibrary
}
break;
case MoveStep.TrayStop_03:
if (RFID_1.ReadByte(0x20, 16, out byte[] data))
if (RFID_1.ReadByte(0x20, 16, out byte[] data,out string errmsg))
{
CurrrentRFID = Common.RfidFilter(data);
TrayManager.Process(CurrrentRFID, DeviceGroup.addr_1, out TrayInfo trayInfo);
......@@ -174,6 +174,7 @@ namespace DeviceLibrary
{
MoveInfo.CanWhileCount--;
MoveInfo.log($"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次");
MoveInfo.log("RFIDerr:" + errmsg);
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(crc.GetString("Res0016", "RFid读取失败"), MsgLevel.warning));
}
else
......
......@@ -50,8 +50,8 @@ public enum RobotStatusE
public enum TrayTypeE
{
None,
MTP1, //流水线治具托盘
MTP2, //流水线料盘托盘
MTP1, //流水线料盘托盘
MTP2, //流水线治具托盘
S007, //料串
M03, //Tray料格
M02, //PCB料格
......@@ -173,3 +173,18 @@ public enum RemoteResult
False,
True
}
[Serializable]
public class MTP
{
/// <summary>
/// 料盘托盘
/// </summary>
public static readonly string MTP1 = "MTP1";
/// <summary>
/// 治具托盘
/// </summary>
public static readonly string MTP2 = "MTP2";
}
\ No newline at end of file
......@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\RemoteSheardObject.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
......@@ -28,13 +29,13 @@ namespace TheMachine.UC
private void button_read_Click(object sender, EventArgs e)
{
if (rFID_C2S1.ReadByte(0x20, 16, out byte[] data)) {
if (rFID_C2S1.ReadByte(0x20, 16, out byte[] data, out string errmsg)) {
var rfid = Common.RfidFilter(data);
textBox_rfidlabel.Text = rfid;
} else {
LogUtil.error("RFIDerr:" + errmsg);
textBox_rfidlabel.Text = crc.GetString("Res0033","读取失败");
}
}
}
}
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!