Commit 0f77fced LN

测高系数改为10556,测高修改

1 个父辈 110c80f6
......@@ -432,7 +432,7 @@ namespace OnlineStore.AssemblyLine
try
{
TimeSpan sp = DateTime.Now - lastLogTime;
if (sp.TotalMinutes > 5)
if (sp.TotalMinutes > 3)
{
lastLogTime = DateTime.Now;
Process[] processes = Process.GetProcesses();
......@@ -452,7 +452,7 @@ namespace OnlineStore.AssemblyLine
}
}catch(Exception ex)
{
LogUtil.error("LogM", ex);
LogUtil.error("LogM Error: ", ex);
}
}
private void timer1_Tick(object sender, EventArgs e)
......
......@@ -20,7 +20,7 @@ PRO,0,提升上料轴原点加速度,BatchAxis_HomeAddSpeed,500,,,,,
PRO,0,提升上料轴P1速度,BatchAxis_P1Speed,2800,,,,,
PRO,0,提升上料轴P2速度,BatchAxis_P2Speed,2800,,,,,
PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,600,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,19000,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,10556,,,,,
,,,,,,,,,
AXIS,0,轴一移栽上下轴,UpDown_Axis,2,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,69200,,,,,
......
......@@ -20,7 +20,7 @@ PRO,0,提升上料轴原点加速度,BatchAxis_HomeAddSpeed,500,,,,,
PRO,0,提升上料轴P1速度,BatchAxis_P1Speed,2800,,,,,
PRO,0,提升上料轴P2速度,BatchAxis_P2Speed,2800,,,,,
PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,600,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,19000,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,10556,,,,,
,,,,,,,,,
AXIS,0,轴一移栽上下轴,UpDown_Axis,4,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,82000,,,,,
......
......@@ -19,8 +19,8 @@ PRO,0,提升上料轴原点高速,BatchAxis_HomeHighSpeed,500,,,,,
PRO,0,提升上料轴原点加速度,BatchAxis_HomeAddSpeed,500,,,,,
PRO,0,提升上料轴P1速度,BatchAxis_P1Speed,2800,,,,,
PRO,0,提升上料轴P2速度,BatchAxis_P2Speed,2800,,,,,
PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,800,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,19000,,,,,
PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,500,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,10556,,,,,
,,,,,,,,,
AXIS,0,轴一移栽上下轴,UpDown_Axis,6,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,126100,,,,,
......
......@@ -20,7 +20,7 @@ PRO,0,提升上料轴原点加速度,BatchAxis_HomeAddSpeed,500,,,,,
PRO,0,提升上料轴P1速度,BatchAxis_P1Speed,2800,,,,,
PRO,0,提升上料轴P2速度,BatchAxis_P2Speed,2800,,,,,
PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,800,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,19000,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,10556,,,,,
,,,,,,,,,
AXIS,0,轴一移栽上下轴,UpDown_Axis,8,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,110000,,,,,
......
......@@ -193,6 +193,8 @@ namespace OnlineStore.DeviceLibrary
trayCount = 0;
SetWarnMsg("");
alarmType = LineAlarmType.None;
isInSuddenDown = false;
isNoAirCheck = false;
preTrayNum = 0;
currTrayNum = 0;
}
......
......@@ -949,36 +949,48 @@ namespace OnlineStore.DeviceLibrary
private List<string> NextCodeList = new List<string>();
private int GetHeight()
{
LastHeight = 0;
int AxisChangeValue = Config.Height_ChangeValue;
//计算高度
EndMovePosition = BatchAxis.GetAclPosition();
int height = (int)Math.Ceiling(1F * (EndMovePosition - StartMovePosition) / AxisChangeValue);
int addHeight = 0;
float height = (float)Math.Ceiling(1F * (EndMovePosition - StartMovePosition) / AxisChangeValue);
// int addHeight = 0;
//如果检测信号未亮,极限亮了,需要补充高
//if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW))
//{
// addHeight = Config.LastTrayAddHeight;
//}
height += addHeight;
// height += addHeight;
if (height <= 8) { height = 8; }
else
{
height = (int)Math.Floor(1F * (height - 4) / 4) * 4;
}
if (height <= 8) { height = 8; }
LastHeight = height;
//if (height <= 8) { height = 8; }
//else
//{
// height = (int)Math.Floor(1F * (height - 4) / 4) * 4;
//}
// height = height - 4;
// if (height <= 8) { height = 8; }
// LastHeight =(int) height-4;
List<int> heightList = LineManager.GetTrayList();
heightList = (from m in heightList orderby m descending select m).ToList<int>();
float minCha =height ;
foreach (int h in heightList)
{
if (height >= h)
//取差值最小的接近值
float cha = Math.Abs(h - height);
if (cha < minCha)
{
LastHeight = h;
minCha = cha;
}
//if (LastHeight >= h)
//{
// LastHeight = h;
// break;
//}
}
string msg = Name + " 计算盘高:上升前【" + StartMovePosition + "】实时【" + EndMovePosition + "】补充【" + addHeight + "】计算后【" + height + "】" + ",归类为" + LastHeight;
if (LastHeight <= 8) { LastHeight = 8; }
string msg = Name + " 计算盘高:上升前 [" + StartMovePosition + "]实时[ " + EndMovePosition + "]差值["+ (EndMovePosition - StartMovePosition) + "]系数["+AxisChangeValue+"] 计算后[" + height + "]" + ",归类为【" + LastHeight+"mm】";
LogUtil.info(msg);
return LastHeight;
}
......
......@@ -88,7 +88,7 @@ namespace OnlineStore.DeviceLibrary
}
foreach (WaitResultInfo wait in list)
{
if (wait.IsEnd)
if (wait==null|| wait.IsEnd)
{
continue;
}
......@@ -132,7 +132,6 @@ namespace OnlineStore.DeviceLibrary
isOk = false;
break;
}
}
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{
......
......@@ -235,7 +235,7 @@ namespace OnlineStore.DeviceLibrary
{
int num = MoveInfo.MoveParam.TrayNumber;
MoveInfo.NextMoveStep(LineMoveStep.MI_10_WaitBox);
LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": (判断box门口没有盘, 且可以入库),更新托盘【" + num + "】为空盘");
LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": 等待box可入库,更新托盘【" + num + "】为空盘");
MoveInfo.WaitList.Add(WaitResultInfo.WaitBoxCanReviceTray());
TrayManager.UpdateTrayInfo(num );
......
......@@ -65,6 +65,10 @@ namespace OnlineStore.DeviceLibrary
//MoveInfo.MoveParam = moveParam;
MoveInfo.NewMove(LineMoveType.OutStore,moveParam);
posId = moveParam.PosId;
if (moveParam.InStoreNg)
{
posId = "入库NG料";
}
MoveInfo.NextMoveStep(LineMoveStep.DLO_01_WaitEntryNoTray);
LogUtil.info(Name + "开始出料【" + moveParam.ToStr() + "】:" + MoveInfo.SLog + "等待出口无料盘,NG气缸后退");
if (equipBeanId.Equals(302) && EntryLocation_Check.Equals(IO_Type.EntryLocation_Check2))
......@@ -76,7 +80,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " 启动出料【" + moveParam.ToStr() + "】 失败");
LogUtil.error(Name + " 启动出料【" + moveParam.ToStr() + "】 失败", equipBeanId+31);
return false;
}
}
......@@ -93,7 +97,7 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
string posId = MoveInfo.MoveParam == null ? "" : MoveInfo.MoveParam.PosId;
// string posId = MoveInfo.MoveParam == null ? "" : MoveInfo.MoveParam.PosId;
if (MoveInfo.MoveStep.Equals(LineMoveStep.DLO_01_WaitEntryNoTray))
{
if (IsInTurn().Equals(false) && equipBean.IOValue(ExitTray_Check).Equals(IO_VALUE.LOW))
......@@ -104,20 +108,19 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(180))
{
//TimeSpan span = DateTime.Now - MoveInfo.LastSetpTime;
//if (span.TotalMinutes > 3)
//{
LogUtil.error(Name + "等待出口无料盘超时:" + FormUtil.GetSpanStr(MoveInfo.StepSpan()), 305);
//}
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DLO_02_WaitExitNoTray))
{
if (LineTurnIsStop())
{
MoveInfo.NextMoveStep(LineMoveStep.DLO_03_LineRun);
LogUtil.info(Name + "出料【" + posId + "】:" + MoveInfo.SLog + "出口无料盘,转动到入口定位");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
lineRun.StartLineRun(LineRun_Do, EntryLocation_Check, null);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DLO_03_LineRun))
{
if (LineTurnIsStop())
......@@ -172,7 +175,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DLO_08_NGBefore))
{
MoveInfo.NextMoveStep(LineMoveStep.DLO_09_NGAfter);
LogUtil.info(Name + "出料【" + posId + "】:" + MoveInfo.SLog + "NG气缸后退");
LastTrayPosition++;
LogUtil.info(Name + "出料【" + posId + "】:" + MoveInfo.SLog + "NG气缸后退,更新最后一盘料位置:"+LastTrayPosition);
equipBean.CylinderMove(MoveInfo, IO_Type.NGCylinder_Before, IO_Type.NGCylinder_After);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DLO_09_NGAfter))
......@@ -425,7 +429,7 @@ namespace OnlineStore.DeviceLibrary
//判断Buzy及位置是否结束
else if (IOManager.IOValue(checkDI, subType).Equals(IO_VALUE.HIGH))
{
if (canWhileCount > 0 && span.TotalMilliseconds < 500)
if (canWhileCount > 0 && span.TotalMilliseconds < 800)
{
canWhileCount--;
LogUtil.info(subType + " 异常停止,重新开始转动:[" + moveDO + "] [" + checkDI + "] 耗时 [" + FormUtil.GetSpanStr(span) + "]["+canWhileCount+"]");
......
......@@ -248,7 +248,7 @@ namespace OnlineStore.DeviceLibrary
{
SecondMoveInfo.MoveParam = param;
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
CheckLog("托盘 【" + currTrayNum + "】需要出料" + SecondMoveInfo.SLog + ":" + param.ToStr() + " 等待1秒后顶升上升 ");
CheckLog("托盘 【" + currTrayNum + "】需要出料" + SecondMoveInfo.SLog + ":" + param.ToStr() + " 等待1秒后顶升上升 ");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitProvidingEquipCanOut());//等待
......@@ -289,7 +289,7 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember) && MoveInfo.MoveType.Equals(LineMoveType.None))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_09_WaitLetFixtureGo);
CheckLog("托盘放行 " + SecondMoveInfo.SLog + "开始新的出料任务~" + SecondMoveInfo.MoveParam.ToStr()+",等待移栽完成后放开阻挡)");
CheckLog("托盘放行 " + SecondMoveInfo.SLog + "开始新的出料任务~" + SecondMoveInfo.MoveParam.ToStr()+",开始移栽");
bool result = StartOutStoreMove(SecondMoveInfo.MoveParam);
}
#endregion
......@@ -306,7 +306,7 @@ namespace OnlineStore.DeviceLibrary
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_Stop2Down);
CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,阻挡气缸1-2下降)");
CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,阻挡2下降");
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH));
}
......@@ -329,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_17_Stop2Check))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_18_StopCylinder_Back);
CheckLog("托盘放行 " + SecondMoveInfo.SLog + " , 阻挡气缸1-2上升 )");
CheckLog("托盘放行 " + SecondMoveInfo.SLog + " , 阻挡气缸2上升 ");
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
......@@ -361,7 +361,7 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.OutStoreExecute;
MoveInfo.MoveParam = param;
MoveInfo.NewMove(LineMoveType.OutStore);
LogInfo("出料【" + posId + "】处理(移栽):(PO_00_BeforeAfterAfter, 前后气缸后退)");
LogInfo("出料【" + posId + "】处理(移栽):PO_00_CylinderAfter, 前后气缸后退");
MoveInfo.NextMoveStep(LineMoveStep.PO_00_CylinderAfter);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
......@@ -392,7 +392,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_00_CylinderAfter))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_01_CylinderDown);
LogInfo(" " + MoveInfo.SLog + " : 上下气缸下降");
LogInfo(" " + MoveInfo.SLog + " : 上下气缸下降");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
UpdownDownP2Move(MoveInfo.MoveParam.PlateH);
}
......@@ -478,7 +478,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_09_CylinderUp))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_10_CylinderAfter);
OutLog("出料:" + MoveInfo.SLog + ",前后气缸后退,等待4000 ,皮带线继续运动");
OutLog("出料:" + MoveInfo.SLog + ",前后气缸后退,等待1000 ,皮带线继续运动");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
......
......@@ -95,7 +95,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayInfo fixture = new TrayInfo(trayNum, isFull, inOrOut, param);
TrayInfo fixture = new TrayInfo(trayNum, isFull, inOrOut, param,ngMsg);
TrayInfoMap.TryAdd(trayNum, fixture);
}
}
......
......@@ -218,6 +218,7 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil.info(" [" + cameraName + "] 扫码完成:" + r);
ho_Image.Dispose();
bitmap.Dispose();
}
}
......
......@@ -12,7 +12,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public class TrayInfo
{
public TrayInfo(int trayNum, bool isFull, int inOrOut = 0, InOutParam inoutParam = null)
public TrayInfo(int trayNum, bool isFull, int inOrOut = 0, InOutParam inoutParam = null,string ngMsg = "")
{
this.TrayCode = trayNum;
this.IsFull = isFull;
......@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary
inoutParam = new InOutParam();
}
this.inoutPar = inoutParam;
ShowMsg = "";
ShowMsg = ngMsg;
}
public string ToStr()
{
......@@ -30,7 +30,7 @@ namespace OnlineStore.DeviceLibrary
if (InOrOutStore.Equals(1))
{
type = inoutPar.InStoreNg ? "入料失败:" + ShowMsg + "" : "入料:" + "" + inoutPar.ToStr() + "";
type = inoutPar.InStoreNg ? "入料失败:" + ShowMsg : "入料:" + "" + inoutPar.ToStr() + "";
}
else if (InOrOutStore.Equals(2))
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!