Commit 4098afb9 LN

夹爪分开配置。

1 个父辈 0c67c918
20200428
20210510
夹爪脆盘和普通料盘参数分开配置
20200428
1.脆盘料号配置增加界面,修改后实时生效。
2.预扫码扫码失败照片保存到文件夹。
3.紧急料直接放入NG箱
......@@ -42,3 +45,6 @@ todesk 874075053 Acc123
线体转动方向
D7处无检测信号,如何判断出料口是否有料
......@@ -249,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.SLog + ": 定位气缸下降 ,夹紧气缸放松");
LocationCylinderDown(MoveInfo);
//CylinderMove(MoveInfo, IO_Type.SL_ClampCylinder_Work, IO_Type.SL_ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo,LastCodeList.ToArray());
break;
case LineMoveStep.FR_15_TopDown:
RFIDData data = RFIDManager.GetShelfId(DeviceID);
......
......@@ -506,7 +506,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_34_CylinderRelax);
InLog("料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
//CylinderMove(MoveInfo, IO_Type.SL_ClampCylinder_Work, IO_Type.SL_ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo, LastCodeList.ToArray());
}
else if (MoveInfo.IsStep(LineMoveStep.FI_34_CylinderRelax))
{
......
......@@ -364,7 +364,7 @@ namespace OnlineStore.DeviceLibrary
ClampCount = 1;
OutLog("出库 " + MoveInfo.SLog + ": 第一次未抓到料,重新抓一次,夹爪先放松", 1);
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo,MoveInfo.MoveParam.WareCode);
}
else
{
......@@ -447,7 +447,7 @@ namespace OnlineStore.DeviceLibrary
//出库全部完成
MoveInfo.NextMoveStep(LineMoveStep.MO_61_CylinderRelax);
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo, MoveInfo.MoveParam.WareCode);
EDataManager.UpdateParam(DeviceID);
}
......@@ -640,7 +640,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.MI_12_CylinderRelax);
InLog("入库 " + MoveInfo.SLog + ",夹料气缸放松");
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo, MoveInfo.MoveParam.WareCode);
EDataManager.UpdateParam(DeviceID);
}
else if (MoveInfo.IsStep(LineMoveStep.MI_12_CylinderRelax))
......
......@@ -39,7 +39,7 @@ namespace OnlineStore.DeviceLibrary
{
if (valueList.Contains(item))
{
LogUtil.error( type.Name + "枚举值:" + item + "重复存在,请检查代码!程序退出。");
LogUtil.error(type.Name + "枚举值:" + item + "重复存在,请检查代码!程序退出。");
Application.Exit();
return false;
}
......@@ -185,14 +185,14 @@ namespace OnlineStore.DeviceLibrary
string moveEquipConfig = ConfigAppSettings.GetValue(Setting_Init.ConfigPath_MoveEquip);
string configBase = appPath + moveEquipConfig;
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + config.Id.ToString().PadLeft(2,'0') + ".csv");
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + config.Id.ToString().PadLeft(2, '0') + ".csv");
allConfigMap[config.Id] = config;
if (!File.Exists(configStr))
{
LogUtil.info("复制配置文件【" + configBase + "】->【" + configStr + "】");
File.Copy(configBase, configStr);
}
bool result = CSVConfigReader.SaveConfig(configStr, config,typeof(MoveEquip_Config));
bool result = CSVConfigReader.SaveConfig(configStr, config, typeof(MoveEquip_Config));
if (!result)
{
LogUtil.error("保存配置文件失败:" + configStr);
......@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("出错:",ex);
LogUtil.error("出错:", ex);
}
}
public static void SaveFeedingEquipConfig(FeedingEquip_Config config)
......@@ -212,9 +212,9 @@ namespace OnlineStore.DeviceLibrary
string moveEquipConfig = ConfigAppSettings.GetValue(Setting_Init.ConfigPath_FeedingEquip);
int id = config.Id - 100;
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + id+ ".csv");
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + id + ".csv");
allConfigMap[config.Id] = config;
bool result = CSVConfigReader.SaveConfig(configStr, config,typeof(FeedingEquip_Config));
bool result = CSVConfigReader.SaveConfig(configStr, config, typeof(FeedingEquip_Config));
if (!result)
{
LogUtil.error("保存配置文件失败:" + configStr);
......@@ -222,7 +222,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("出错:",ex);
LogUtil.error("出错:", ex);
}
}
public static void SaveHYEquipConfig(HYEquip_Config config)
......@@ -241,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
File.Copy(configBase, configStr);
}
allConfigMap[config.Id] = config;
bool result = CSVConfigReader.SaveConfig(configStr, config,typeof(HYEquip_Config));
bool result = CSVConfigReader.SaveConfig(configStr, config, typeof(HYEquip_Config));
if (!result)
{
LogUtil.error("保存配置文件失败:" + configStr);
......@@ -249,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("出错:",ex);
LogUtil.error("出错:", ex);
}
}
......@@ -309,7 +309,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
string str = "";
foreach(string obj in PnList)
foreach (string obj in PnList)
{
str += obj + "#";
}
......@@ -328,11 +328,12 @@ namespace OnlineStore.DeviceLibrary
{
if (!PnList.Contains(pn))
{
PnList.Add (pn);
PnList.Add(pn);
UpdatePnList();
}
}
public static bool NeedWaitHassReel(params string[] codes)
public static bool IsCrispReel(params string[] codes)
{
try
{
......@@ -347,13 +348,13 @@ namespace OnlineStore.DeviceLibrary
{
if (codePn.Equals(pn))
{
LogUtil.info("夹爪不检测是否有料:条码[" + code+"]料号["+ pn + "]是脆盘");
return false;
LogUtil.info("IsCrispReel:条码[" + code + "]料号[" + pn + "]是脆盘");
return true;
}
else if (codePn.StartsWith(pn))
{
LogUtil.info("夹爪不检测是否有料:条码[" + code + "]料号[" + pn + "]认为是脆盘");
return false;
LogUtil.info("IsCrispReel:条码[" + code + "]料号[" + pn + "]认为是脆盘");
return true;
}
}
}
......@@ -361,9 +362,14 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("NeedWaitHassReel出错:" + ex.ToString());
LogUtil.error("IsCrispReel 出错:" + ex.ToString());
}
return false;
}
public static bool NeedWaitHassReel(params string[] codes)
{
return true;
//return !IsCrispReel(codes);
}
}
}
......@@ -58,14 +58,26 @@ namespace OnlineStore.DeviceLibrary
}
public void ClampPush(LineMoveInfo moveInfo, bool checkHasReel, params string[] code)
{
bool iscrisp = LineManager.IsCrispReel(code);
float distance = config.Distance;
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.Push(config.Force, config.Distance, config.Velocity);
if (iscrisp)
{
distance = config.CrispDistance;
rmaxis.Push(config.CrispForce, config.CrispDistance, config.CrispPushVelocity);
}
else
{
distance = config.Distance;
rmaxis.Push(config.Force, config.Distance, config.PushVelocity);
}
}
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached((int)config.Distance));
if (checkHasReel && LineManager.NeedWaitHassReel(code))
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached((int)distance));
if (checkHasReel )
//if (checkHasReel && LineManager.NeedWaitHassReel(code))
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampHasReel());
//有一个到位就算到位
......@@ -121,12 +133,20 @@ namespace OnlineStore.DeviceLibrary
return false;
}
public void Relax(LineMoveInfo moveInfo = null)
public void Relax(LineMoveInfo moveInfo = null, params string[] code)
{
bool iscrisp = LineManager.IsCrispReel(code);
int p = 0;
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.MoveAbsolute(p);
if (iscrisp)
{
rmaxis.MoveAbsolute(p, config.CrispVelocity, config.CrispAddSpeed, config.CrispDelSpeed);
}
else
{
rmaxis.MoveAbsolute(p, config.Velocity, config.AddSpeed, config.DelSpeed);
}
}
if (moveInfo != null)
{
......@@ -196,7 +216,7 @@ namespace OnlineStore.DeviceLibrary
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.Push(force, distance, config.Velocity);
rmaxis.Push(force, distance, config.CrispVelocity);
}
}
......
......@@ -164,6 +164,28 @@ namespace OnlineStore.LoadCSVLibrary
[CSVAttribute("距离")]
public float Distance { get; set; }
[CSVAttribute("推压速度")]
public float PushVelocity { get; set; }
[CSVAttribute("脆盘目标速度")]
public float CrispVelocity { get; set; }
[CSVAttribute("脆盘加速度")]
public float CrispAddSpeed { get; set; }
[CSVAttribute("脆盘减速度")]
public float CrispDelSpeed { get; set; }
[CSVAttribute("脆盘出力")]
public float CrispForce { get; set; }
[CSVAttribute("脆盘距离")]
public float CrispDistance { get; set; }
[CSVAttribute("脆盘推压速度")]
public float CrispPushVelocity { get; set; }
public string GetNameStr()
{
return PortName + "_" + AxisNo;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!