Commit 2e627ea5 刘韬

1

1 个父辈 63b54a68
......@@ -36,22 +36,11 @@ namespace DeviceLibrary
ConfigHelper.Config.Set("CamTestReel_Test", "Click To Test");
ConfigHelper.AdvanceConfigForm.AddCustomEditor<CameraTest>("CamTestReel_Test");
string nameStr = ConfigHelper.Config.Get(Setting_Init.CameraName);
codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender";
try
{
string[] nameArray = nameStr.Split(spiltChar);
foreach (string str in nameArray)
{
if (str.Trim().Equals(""))
{
continue;
}
//LogUtil.info("加载到配置摄像机名称:" + str.Trim());
cameraNameList.Add(str.Trim());
}
LoadCamera(false);
LoadCamera(true);
codeTypeList = new List<string>();
string[] codeArray = CodeType.Split(spiltChar);
......@@ -71,14 +60,6 @@ namespace DeviceLibrary
if (cameraNameList.Count <= 0 && hikNameList.Count > 0)
{
cameraNameList = new List<string>(hikNameList);
string cameraStr = "";
foreach (string name in hikNameList)
{
cameraStr += name + spiltChar;
}
cameraStr = cameraStr.Substring(0, cameraStr.Length - 1);
//ConfigAppSettings.SaveValue(Setting_Init.CameraName, cameraStr);
LogUtil.info("未配置扫码相机,默认【" + Setting_Init.CameraName + "】=【" + cameraStr + "】");
}
}
catch (Exception ex)
......@@ -87,55 +68,8 @@ namespace DeviceLibrary
}
}
/// <summary>
/// 初始化摄像机名称和二维码类型
/// </summary>
public static bool LoadSingle()
{
codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender";
try
{
codeTypeList = new List<string>();
string[] codeArray = CodeType.Split(spiltChar);
foreach (string str in codeArray)
{
if (str.Trim().Equals(""))
{
continue;
}
string file = GetCodeParamFilePath(str.Trim());
LogUtil.info("加载到配置二维码类型:" + str.Trim() + ",配置文件:" + file);
codeTypeList.Add(str.Trim());
}
CodeLibrary.HDCodeLearnHelper.LoadConfig("", CodeType);
LoadCamera(false);
//如果未加载到配置相机,自动配置
if (hikNameList.Count > 0)
{
cameraNameList = new List<string>(hikNameList);
string cameraStr = "";
foreach (string name in hikNameList)
{
cameraStr += name + spiltChar;
}
cameraStr = cameraStr.Substring(0, cameraStr.Length - 1);
//ConfigAppSettings.SaveValue(Setting_Init.CameraName, cameraStr);
LogUtil.info("未配置扫码相机,默认【" + Setting_Init.CameraName + "】=【" + cameraStr + "】");
return true;
}
return false;
}
catch (Exception ex)
{
LogUtil.error("解析摄像机配置出错:" + ex.StackTrace);
}
return false;
}
private static void LoadCamera(bool isReLoad)
public static void LoadCamera(bool isReLoad)
{
if (isReLoad || Camera._cam == null)
{
......
......@@ -18,6 +18,7 @@ namespace DeviceLibrary
int upspeed;
int downspeed;
int StrokeLength = 270000;
bool paused = false;
public LiftMonitor(string _up, string _down,string _break, AxisBean _axisBean,int _StrokeLength,int _upspeed, int _downspeed= 0) {
up = _up;
down = _down;
......@@ -47,6 +48,12 @@ namespace DeviceLibrary
if (moveInfo == null)
moveInfo = new MoveInfo("界面",false);
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
moveInfo.log($"急停未解除");
return;
}
paused = false;
if (IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH)) {
moveInfo.log($"{axisBean.AxisName},已在位置,无需上升");
return;
......@@ -66,10 +73,24 @@ namespace DeviceLibrary
Task.Run(()=> {
while (!IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH)) {
Task.Delay(30);
if (paused)
{
paused = false;
return;
}
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) {
LogUtil.info("设备急停");
Pause();
return;
}
}
axisBean.SuddenStop();
if (!string.IsNullOrEmpty(axisbreak))
{
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
axisBean.ServoOff();
}
var t = (DateTime.Now - d).TotalSeconds;
moveInfo.log($"{axisBean.AxisName},上升到位,s:{t}");
});
......@@ -78,14 +99,19 @@ namespace DeviceLibrary
{
if (IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH))
{
axisBean.SuddenStop();
axisBean.SuddenStop();
if (!string.IsNullOrEmpty(axisbreak))
{
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
axisBean.ServoOff();
}
return true;
}
if (!axisBean.IsBusy) {
axisBean.RelMove(StrokeLength, (double)upspeed);
LogUtil.info("恢复继续上升");
LiftUp(null);
}
return false;
}
......@@ -93,6 +119,12 @@ namespace DeviceLibrary
{
if (moveInfo == null)
moveInfo = new MoveInfo("界面", false);
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
moveInfo.log($"急停未解除");
return;
}
paused = false;
if (IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
{
moveInfo.log($"{axisBean.AxisName},已在位置,无需下降");
......@@ -115,10 +147,24 @@ namespace DeviceLibrary
while (!IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
{
Task.Delay(30);
if (paused)
{
paused = false;
return;
}
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
LogUtil.info("设备急停");
Pause();
return;
}
}
axisBean.SuddenStop();
if (!string.IsNullOrEmpty(axisbreak))
{
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
axisBean.ServoOff();
}
var t = (DateTime.Now - d).TotalSeconds;
moveInfo.log($"{axisBean.AxisName},下降到位,s:{t}");
});
......@@ -128,21 +174,33 @@ namespace DeviceLibrary
if (IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
{
axisBean.SuddenStop();
if (!string.IsNullOrEmpty(axisbreak))
{
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
axisBean.ServoOff();
}
return true;
}
if (!axisBean.IsBusy)
{
axisBean.RelMove(-StrokeLength, (double)downspeed);
LogUtil.info("恢复继续下降");
LiftDown(null);
}
return false;
}
public void Pause()
{
paused = true;
axisBean.SuddenStop();
if (!string.IsNullOrEmpty(axisbreak))
{
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
axisBean.ServoOff();
}
}
public void Resume()
......
......@@ -181,7 +181,7 @@ namespace DeviceLibrary
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false;
if (To.posid== BoxStorePosition.strings && ConfigHelper.Config.Get("Device_Use_Fixpos",false) && Fix!=null)
if (!RobotManage.mainMachine.AutoInOutTest && To.posid== BoxStorePosition.strings && ConfigHelper.Config.Get("Device_Use_Fixpos",false) && Fix!=null)
MoveInfo.NextMoveStep(MoveStep.StoreFIX01);
else
MoveInfo.NextMoveStep(MoveStep.StoreTS10);
......
......@@ -147,14 +147,14 @@ namespace DeviceLibrary
UpDown_PH = aCStorePosition.UpDownAxis_IHPosition_P3;
UpDown_PL = aCStorePosition.UpDownAxis_ILPosition_P4;
Comp_PH = Config.Comp_P2 - Config.Clamp_PoToMM * (aCStorePosition.BagHigh-8 + Config.Comp_PH_MM);
Comp_PH = Config.Comp_P2 - Config.Comp_PoToMM * (aCStorePosition.BagHigh-8 + Config.Comp_PH_MM);
Comp_PL = Config.Comp_P2 - Config.Clamp_PoToMM * (reel.PlateH-8) - (reel.PlateH > 8 ? Config.Clamp_PoToMM * Config.Comp_PL_MM : 0);
Comp_PL = Config.Comp_P2 - Config.Comp_PoToMM * (reel.PlateH-8) - (reel.PlateH > 8 ? Config.Comp_PoToMM * Config.Comp_PL_MM : 0);
Comp_PH = Comp_PH < 0 ? 0 : Comp_PH;
Comp_PL = Comp_PL < 0 ? 0 : Comp_PL;
posid = aCStorePosition.PositionNum;
Reel = reel.clone();
LogUtil.info($"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({aCStorePosition.BagHigh}-{8}+{Config.Comp_PH_MM})*{Config.Clamp_PoToMM},Comp_PL:{Comp_PL}={reel.PlateH},Comp_PL_MM:{Config.Comp_PL_MM},{JsonHelper.SerializeObject(this)}");
LogUtil.info($"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({aCStorePosition.BagHigh}-{8}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={reel.PlateH},Comp_PL_MM:{Config.Comp_PL_MM},{JsonHelper.SerializeObject(this)}");
}
public const string ngdoor = "单料口";
public const string strings = "料串口";
......@@ -168,6 +168,9 @@ namespace DeviceLibrary
UpDown_PH = Config.UpDown_P2;
UpDown_PL = Config.UpDown_P3;
posid = ngdoor;
if (reel.PlateW > 7 && Config.InOut_P5>0)
InOut_P2 = Config.InOut_P5;
}
else if (storeSide == StoreSide.String)
{
......@@ -176,9 +179,11 @@ namespace DeviceLibrary
UpDown_PH = Config.UpDown_P4;
UpDown_PL = Config.UpDown_P5;
posid = strings;
if (reel.PlateW > 7 && Config.InOut_P4 > 0)
InOut_P2 = Config.InOut_P4;
}
Comp_PH = Config.Comp_P2 - Config.Clamp_PoToMM * (reel.PlateH - 8 + Config.Comp_PH_MM);
Comp_PL = Config.Comp_P2 - Config.Clamp_PoToMM * (reel.PlateH - 8) - (reel.PlateH > 8 ? Config.Clamp_PoToMM * Config.Comp_PL_MM : 0);
Comp_PH = Config.Comp_P2 - Config.Comp_PoToMM * (reel.PlateH - 8 + Config.Comp_PH_MM);
Comp_PL = Config.Comp_P2 - Config.Comp_PoToMM * (reel.PlateH - 8) - (reel.PlateH > 8 ? Config.Comp_PoToMM * Config.Comp_PL_MM : 0);
Comp_PH = Comp_PH < 0 ? 0 : Comp_PH;
Comp_PL = Comp_PL < 0 ? 0 : Comp_PL;
Reel = reel.clone();
......
......@@ -26,7 +26,7 @@ namespace DeviceLibrary
errmsg = crc.GetString("Res0003","入库料盘没有准备好,无法启动");
return false;
}
poslist =CSVPositionReader<ACStorePosition>.getPositionList();
poslist = RobotManage.PositionNumList.Select(a => { return CSVPositionReader<ACStorePosition>.allPositionMap[a]; }).ToList();//CSVPositionReader<ACStorePosition>.getPositionList();
AutoInOutTest = true;
StopAutoInOut = false;
CurrentPosIndex = posindex;
......
......@@ -85,7 +85,7 @@ namespace DeviceLibrary
else if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{
ConfigIO io = RobotManage.Config.getWaitIO(wait.IoType);
NotOkMsg = MoveInfo.Name + $" {crc.GetString(L.wait, "等待")}【" + io.DisplayStr + "】=【" + wait.IoValue + "】";
NotOkMsg = MoveInfo.Name + $" {crc.GetString(L.wait, "等待")}【" + crc.GetString(io.ProName, io.Explain) + "】=【" + wait.IoValue + "】";
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue);
if (!wait.IsEnd)
{
......@@ -93,7 +93,7 @@ namespace DeviceLibrary
if (span.TotalMilliseconds > timeOutMs && NoAlarm())
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + $"] {crc.GetString(L.wait, "等待")}(" + io.DisplayStr + "=" + wait.IoValue + $") {crc.GetString(L.timeout, "超时")}";
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + $"] {crc.GetString(L.wait, "等待")}(" + crc.GetString(io.ProName, io.Explain) + "=" + wait.IoValue + $") {crc.GetString(L.timeout, "超时")}";
Msg.add(WarnMsg, MsgLevel.alarm);
if (NoAlarm())
......@@ -303,10 +303,11 @@ namespace DeviceLibrary
/// </summary>
/// <param name="moveInfo"></param>
public void CloseFlipDoor(MoveInfo moveInfo) {
LogUtil.info("关闭翻板门");
//IOMove(IO_Type.ReelFlipDoor_Home, IO_VALUE.LOW);
//IOMove(IO_Type.ReelFlipDoor_Work, IO_VALUE.HIGH);
if (ConfigHelper.Config.Get("Device_FlipDoorType", FlipDoorTypeE.Cylinder) == FlipDoorTypeE.Cylinder)
if (moveInfo == null)
LogUtil.info("关闭翻板门");
else
moveInfo.log("关闭翻板门");
if (MotorFlipDoorA == null)
{
FlipDoor.ToHigh(null);
}
......
......@@ -135,7 +135,7 @@ namespace DeviceLibrary
if (Config.StringDoor_Axis != null) {
RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Open);
RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Close);
StringDoor = new LiftMonitor(IO_Type.StringDoor_Open, IO_Type.StringDoor_Close, null, new AxisBean(Config.StringDoor_Axis, Name), Config.StringDoorLength, Config.StringDoorLength_speed);
StringDoor = new LiftMonitor(IO_Type.StringDoor_Open, IO_Type.StringDoor_Close, IO_Type.StringDoor_Axis_Break, new AxisBean(Config.StringDoor_Axis, Name), Config.StringDoorLength, Config.StringDoorLength_speed);
LogUtil.info("加载料串门类型为:步进");
//此版本同步删除其他IO
......@@ -153,6 +153,14 @@ namespace DeviceLibrary
RobotManage.Config.DOList.Remove(IO_Type.DoorSafe_Disable);
}
if (!ConfigHelper.Config.Get("Device_IO_HasX29", true))
{
RobotManage.Config.DIList.Remove(IO_Type.NGDoor_Tray_Check);
}
if (!ConfigHelper.Config.Get("Device_IO_HasX20", true))
{
RobotManage.Config.DIList.Remove(IO_Type.WidthCheck_15);
}
boxTransport = new ReelTransport(Config, this);
......@@ -399,9 +407,7 @@ namespace DeviceLibrary
break;
case MoveStep.H07_HomeReset:
if (IOValue(IO_Type.WidthCheck_7).Equals(IO_VALUE.HIGH) ||
IOValue(IO_Type.WidthCheck_13).Equals(IO_VALUE.HIGH) ||
IOValue(IO_Type.WidthCheck_15).Equals(IO_VALUE.HIGH))
if (GetWidth()>0)
{
ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset);
ResetMoveInfo.log("夹爪上有料盘,送到NG口");
......@@ -447,8 +453,8 @@ namespace DeviceLibrary
ResetMoveInfo.NextMoveStep(MoveStep.H14_HomeReset);
if (!NGDoor_Tray_Test_Reel)
{
Msg.add(crc.GetString(L.x29_low_no_reel, "传感器X29未检测到单料口料盘."), MsgLevel.alarm);
RobotManage.UserPause(crc.GetString("x29_low_no_reel","传感器X29未检测到单料口料盘."));
Msg.add(crc.GetString(L.x29_low_no_reel, "传感器未检测到单料口料盘."), MsgLevel.alarm);
RobotManage.UserPause(crc.GetString("x29_low_no_reel","传感器未检测到单料口料盘."));
}
//CylinderMove(ResetMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
SingleDoor.ToHigh(ResetMoveInfo);
......@@ -456,7 +462,7 @@ namespace DeviceLibrary
case MoveStep.H14_HomeReset:
if (NGDoor_Tray_Test_Reel)
{
Msg.add(crc.GetString(L.x29_higt_has_reel, "系统启动X29检测到有无信息料盘,等待取走单料口料盘"), MsgLevel.alarm);
Msg.add(crc.GetString(L.x29_higt_has_reel, "系统启动检测到有无信息料盘,等待取走单料口料盘"), MsgLevel.alarm);
if (ConfigHelper.Config.Get("CamTestReel_Ability", false))
{
//ResetMoveInfo.NextMoveStep(MoveStep.H14_HomeReset);
......@@ -466,7 +472,7 @@ namespace DeviceLibrary
}
else
{
RobotManage.UserPause($"系统启动X29检测到有无信息料盘,等待取走单料口料盘");
RobotManage.UserPause($"系统启动检测到有无信息料盘,等待取走单料口料盘");
}
}
else {
......@@ -490,7 +496,7 @@ namespace DeviceLibrary
ResetMoveInfo.log("NG口还是检测到料盘");
ResetMoveInfo.NextMoveStep(MoveStep.H14_HomeReset);
}
else if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.NGDoor_Tray_Check).Equals(IO_VALUE.LOW))
else if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH) && !NGDoor_Tray_Test_Reel)
{
ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
ResetMoveInfo.log("关门NG口门");
......@@ -542,32 +548,35 @@ namespace DeviceLibrary
}
Msg.add(crc.GetString(L.SafetyLight_is_block, "安全光栅被遮挡") + (ok ? ignorestring : ""), MsgLevel.warning);
}
if (IOValue(IO_Type.LeftDoorClose_Check).Equals(IO_VALUE.LOW))
if (!ConfigHelper.Config.Get("Device_Disable_DoorSafeCheck", false))
{
if (!IgnoreSafecheck)
if (IOValue(IO_Type.LeftDoorClose_Check).Equals(IO_VALUE.LOW))
{
ok = false;
DeviceSuddenStop();
if (!IgnoreSafecheck)
{
ok = false;
DeviceSuddenStop();
}
Msg.add(crc.GetString(L.left_safedoor_not_close, "左侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.warning);
}
Msg.add(crc.GetString(L.left_safedoor_not_close, "左侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.warning);
}
if (IOValue(IO_Type.RightDoorClose_Check).Equals(IO_VALUE.LOW))
{
if (!IgnoreSafecheck)
if (IOValue(IO_Type.RightDoorClose_Check).Equals(IO_VALUE.LOW))
{
ok = false;
DeviceSuddenStop();
if (!IgnoreSafecheck)
{
ok = false;
DeviceSuddenStop();
}
Msg.add(crc.GetString(L.right_safedoor_not_close, "右侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.warning);
}
Msg.add(crc.GetString(L.right_safedoor_not_close, "右侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.warning);
}
if (IOValue(IO_Type.BackDoorClose_Check).Equals(IO_VALUE.LOW))
{
if (!IgnoreSafecheck)
if (IOValue(IO_Type.BackDoorClose_Check).Equals(IO_VALUE.LOW))
{
ok = false;
DeviceSuddenStop();
if (!IgnoreSafecheck)
{
ok = false;
DeviceSuddenStop();
}
Msg.add(crc.GetString(L.back_safedoor_not_close, "后侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.warning);
}
Msg.add(crc.GetString(L.back_safedoor_not_close, "后侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.warning);
}
if (!lastSafeCheckStatus && ok)
{
......@@ -611,6 +620,8 @@ namespace DeviceLibrary
{
Alarm(AlarmType.SuddenStop);
Msg.add(crc.GetString(L.in_suddenstop, "急停中"), MsgLevel.alarm);
DeviceSuddenStop();
lastSafeCheckStatus = false;
ok = false;
}
else if (alarmType != AlarmType.None) {
......
......@@ -256,7 +256,7 @@ namespace DeviceLibrary
break;
case MoveStep.NGOUT_03:
Msg.add(ClampMoveInfo.MoveParam.NgMsg, MsgLevel.warning);
if (!ConfigHelper.Config.Get("CamTestReel_Ability", false) || NGDoor_Tray_Test_Reel)
if (NGDoor_Tray_Test_Reel)
{
Msg.add(crc.GetString(L.please_take_ngdoor_reel, "等待取走单料口料盘"), MsgLevel.alarm);
if (ConfigHelper.Config.Get("CamTestReel_Ability", false))
......@@ -289,14 +289,15 @@ namespace DeviceLibrary
}
break;
case MoveStep.NGOUT_05:
if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH) && NGDoor_Tray_Test_Reel)
{
ClampMoveInfo.log("NG口还是检测到料盘");
ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_03);
}
else if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.NGDoor_Tray_Check).Equals(IO_VALUE.LOW))
//if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH) && NGDoor_Tray_Test_Reel)
//{
// ClampMoveInfo.log("NG口还是检测到料盘");
// ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_03);
//}
//else
if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
ClampMoveInfo.NextMoveStep(MoveStep.Wait);
ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_06);
ClampMoveInfo.log("关门NG口门");
//CylinderMove(ClampMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.LOW);
SingleDoor.ToLow(ClampMoveInfo);
......@@ -307,6 +308,9 @@ namespace DeviceLibrary
Msg.add(crc.GetString(L.wait_put_reel_into_ngdoor, "等待阻挡物离开光栅"), MsgLevel.warning);
}
break;
case MoveStep.NGOUT_06:
ClampMoveInfo.NextMoveStep(MoveStep.Wait);
break;
case MoveStep.SingleIn:
ClampMoveInfo.NextMoveStep(MoveStep.SingleIn_01);
ClampMoveInfo.log("开始单盘入库, 合拢托盘");
......@@ -344,14 +348,14 @@ namespace DeviceLibrary
get
{
if (ConfigHelper.Config.Get("CamTestReel_Ability", false))
return IOValue(IO_Type.NGDoor_Tray_Check).Equals(IO_VALUE.HIGH) || CodeManager.TestHasReel(CodeManager.hikNameList[0]);
return CodeManager.TestHasReel(CodeManager.hikNameList[0]);
else
return IOValue(IO_Type.NGDoor_Tray_Check).Equals(IO_VALUE.HIGH);
}
}
private int GetWidth()
{
if(IOManager.IOValue(IO_Type.WidthCheck_15).Equals(IO_VALUE.HIGH))
if(ConfigHelper.Config.Get("Device_IO_HasX20",true) && IOManager.IOValue(IO_Type.WidthCheck_15).Equals(IO_VALUE.HIGH))
{
return 15;
}
......
......@@ -79,6 +79,11 @@ namespace DeviceLibrary
bool downCheck2 = false;
bool downCheck3 = false;
int ReelGetFail = 0;
/// <summary>
/// 出库下降对射触发位置高度
/// </summary>
int LastOutDownPosition = 0;
void StringProcess()
{
if (CheckWait(StringMoveInfo))
......@@ -159,6 +164,7 @@ namespace DeviceLibrary
break;
case MoveStep.StringLoad_04:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04b);
LastOutDownPosition = Batch_Axis.GetAclPosition();
if (LastStringState == StringStateE.OutStore)
{
StringMoveInfo.log($"恢复上次料串信息为出库料串");
......@@ -220,8 +226,8 @@ namespace DeviceLibrary
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyGet);
StringMoveInfo.log($"料串有盘上升5mm");
var tpos3 = Batch_Axis.GetAclPosition() + Config.Batch_PoToMM * (Config.Batch_DetectDownMM+2);
Batch_Axis.AbsMove(StringMoveInfo, tpos3, Config.Batch_P1);
var tpos4 = Batch_Axis.GetAclPosition() + Config.Batch_PoToMM * (Config.Batch_DetectDownMM+2);
Batch_Axis.AbsMove(StringMoveInfo, tpos4, Config.Batch_P1);
CylinderMove(StringMoveInfo, IO_Type.Clamping_Relax, IO_Type.Clamping_Work, IO_VALUE.LOW);
//OpenFlipDoor(StringMoveInfo);
StringType = StringTypeE.In;
......@@ -267,6 +273,13 @@ namespace DeviceLibrary
break;
case MoveStep.StringReelPut:
LastStringState = StringStateE.OutStore;
if (ConfigHelper.Config.Get("Device_OutStoreStringReelCheck",false))
{
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_03);
StringMoveInfo.log($"检测阻挡工作");
CylinderMove(StringMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH);
return;
}
var tpos = Batch_Axis.GetAclPosition() - Config.Batch_PoToMM * (StringMoveInfo.MoveParam.PlateH + Config.Batch_OutPlateDownMM);
if (tpos < 0)
tpos = 0;
......@@ -303,7 +316,6 @@ namespace DeviceLibrary
break;
case MoveStep.StringReelPut_01:
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_02);
StringMoveInfo.log($"检测阻挡工作");
CylinderMove(StringMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH);
break;
......@@ -312,6 +324,38 @@ namespace DeviceLibrary
StringMoveInfo.log($"批量轴到顶部检测点");
BatchAxisToP2(StringMoveInfo);
break;
case MoveStep.StringReelPut_03:
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_04);
StringMoveInfo.log($"批量轴到顶部检测点");
BatchAxisToP2(StringMoveInfo,true);
break;
case MoveStep.StringReelPut_04:
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_05);
var heightcheck = (LastOutDownPosition - Batch_Axis.GetAclPosition()) / Config.Batch_PoToMM;
StringMoveInfo.log($"LastOutDownPosition={LastOutDownPosition},CurrentPosition={Batch_Axis.GetAclPosition()},heightcheck={heightcheck}");
if (heightcheck <= 5)
{
Msg.add("出库时料盘未成功放入料串,请检查", MsgLevel.alarm);
RobotManage.UserPause("出库时料盘未成功放入料串,请检查");
}
break;
case MoveStep.StringReelPut_05:
LastOutDownPosition = Batch_Axis.GetAclPosition();
var tpos3 = Batch_Axis.GetAclPosition() - Config.Batch_PoToMM * Config.Batch_OutPlateDownMM;
if (tpos3 < 0)
tpos3 = 0;
if (tpos3 > Config.Batch_P1)
{
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04b);
}
else
{
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
StringState = StringStateE.Full;
Batch_Axis.AbsMove(StringMoveInfo, Config.Batch_P1, Config.Batch_P1_speed);
StringMoveInfo.log($"料串已满可以送出");
}
break;
case MoveStep.StringOut_01:
StringMoveInfo.NextMoveStep(MoveStep.StringOut_02);
StringMoveInfo.log($"料串下降到P1点");
......
......@@ -48,6 +48,9 @@ namespace DeviceLibrary
StringReelPut,
StringReelPut_01,
StringReelPut_02,
StringReelPut_03,
StringReelPut_04,
StringReelPut_05,
StringOut_01,
StringOut_02,
StringOut_03,
......@@ -77,6 +80,7 @@ namespace DeviceLibrary
NGOUT_03,
NGOUT_04,
NGOUT_05,
NGOUT_06,
SingleIn,
SingleIn_01,
SingleInReady,
......
......@@ -7,11 +7,13 @@ AXIS,,上料提升机构,Batch_Axis,4,HC,,40000,0,0,0,20000,0,10,700,0,0
AXIS,,取料机构,Clamp_Axis,5,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,左翻转托盘,FlipDoor_L_Axis,6,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,右翻转托盘,FlipDoor_R_Axis,7,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,料串口折叠门,StringDoor_Axis,8,HC,,40000,0,0,0,30000,0,10,700,0,0
,,,,,,,,,,,,,,,,
PRO,50,IO信号超时时间(秒),IOSingle_TimerOut,5,,,,,,,,,,,,
PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,50,最后一盘料补充高度mm,LastTrayAddHeight,3,,,,,,,,,,,,
PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
PRO,50,折叠门行程,StringDoorLength,700000,,,200000,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,10,旋转机构待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
PRO,10,旋转机构单料口P2,Middle_P2,168460,,,50000,,,,,,,,,
......@@ -26,6 +28,8 @@ PRO,11,升降轴料串放料低点P4,UpDown_P5,659963,,,280000,,,,,,,,,
PRO,12,进出机构待机点P1,InOut_P1,0,,,500000,,,,,,,,,
PRO,12,进出机构单料口P2,InOut_P2,234184,,,500000,,,,,,,,,
PRO,12,进出机构料串放料P3,InOut_P3,234184,,,500000,,,,,,,,,
PRO,12,进出机构13/15寸料串放料P4,InOut_P4,234184,,,500000,,,,,,,,,
PRO,12,进出机构13/15寸单料口P5,InOut_P5,234184,,,500000,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,13,压紧机构待机点P1,Comp_P1,12190,,,280000,,,,,,,,,
PRO,13,压紧机构8mm盘压紧点P2,Comp_P2,46000,,,280000,,,,,,,,,
......@@ -102,3 +106,4 @@ DO,0,上料定位旋转气缸定位,StringPosChecker_Work,18,HC,Y18,,,,,,,,,,
DO,0,上料定位旋转气缸避让,StringPosChecker_Home,19,HC,Y19,,,,,,,,,,
DO,0,料口翻板旋转,ReelFlipDoor_Home,20,HC,Y20,,,,,,,,,,
DO,0,料口翻板水平,ReelFlipDoor_Work,21,HC,Y21,,,,,,,,,,
DO,0,上料机构折叠门刹车解除,StringDoor_Axis_Break,22,HC,Y22,,,,,,,,,,
......@@ -244,6 +244,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DO,0,料口翻板水平,ReelFlipDoor_Work,21,HC,Y21,,,,,,,,,,
/// </summary>
public static string ReelFlipDoor_Work = "ReelFlipDoor_Work";
/// <summary>
/// DO,0,上料机构折叠门刹车,ReelFlipDoor_Work,22,HC,Y22,,,,,,,,,,
/// </summary>
public static string StringDoor_Axis_Break = "StringDoor_Axis_Break";
}
public enum IO_VALUE
......
......@@ -63,7 +63,7 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("FlipDoor_R_Axis", false)]
public ConfigMoveAxis FlipDoor_R_Axis { get; set; }
/// <summary>
/// AXIS,,料串口折叠门,FlipDoor_R_Axis,7,HC,,40000,0,0,0,30000,0,10,700,0,0
/// AXIS,,料串口折叠门,StringDoor_Axis,8,HC,,40000,0,0,0,30000,0,10,700,0,0
/// </summary>
[ConfigProAttribute("StringDoor_Axis", false)]
public ConfigMoveAxis StringDoor_Axis { get; set; }
......@@ -222,7 +222,16 @@ namespace OnlineStore.LoadCSVLibrary
public int Comp_PL_MM { get; set; }
/// <summary>
/// PRO,12,进出机构13/15寸料串放料P4,InOut_P4,234184,,,500000,,,,,,,,,
/// </summary>
[ConfigProAttribute("InOut_P4",false)]
public int InOut_P4 { get; set; }
/// <summary>
/// PRO,12,进出机构13/15寸单料口P5,InOut_P5,234184,,,500000,,,,,,,,,
/// </summary>
[ConfigProAttribute("InOut_P5", false)]
public int InOut_P5 { get; set; }
......@@ -325,6 +334,16 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Clamp_P3_speed")]
public int Clamp_P3_speed { get; set; }
/// <summary>
/// PRO,12,进出机构13/15寸料串放料P4,InOut_P4,234184,,,500000,,,,,,,,,
/// </summary>
[ConfigProAttribute("InOut_P4_speed")]
public int InOut_P4_speed { get; set; }
/// <summary>
/// PRO,12,进出机构13/15寸单料口P5,InOut_P5,234184,,,500000,,,,,,,,,
/// </summary>
[ConfigProAttribute("InOut_P5_speed")]
public int InOut_P5_speed { get; set; }
/// <summary>
/// PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
......
......@@ -59,7 +59,7 @@ namespace TheMachine
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(568, 3);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(647, 553);
this.configControl1.Size = new System.Drawing.Size(647, 688);
this.configControl1.TabIndex = 1;
this.configControl1.Tag = "not";
//
......
......@@ -290,6 +290,19 @@ namespace TheMachine
pnl.Enabled = true;
if (state)
{
CodeManager.LoadCamera(true);
foreach (var cameraName in CodeManager.hikNameList)
{
try
{
Camera._cam.CaptureOnImage(cameraName, out Bitmap bmp, true);
LogUtil.error($"测试拍照:{cameraName}完成");
bmp.Dispose();
}
catch (Exception ex) {
LogUtil.error($"测试拍照错误:{cameraName}:"+ex.ToString());
}
}
btn_run.Enabled = true;
//btn_stop.Enabled = true;
RobotManage.mainMachine.ProcessMsgEvent += MainMachine_ProcessMsgEvent;
......
......@@ -61,5 +61,17 @@ namespace TheMachine
private void ioControl1_Load(object sender, EventArgs e)
{
}
private void btn_stringdooropen_Click(object sender, EventArgs e)
{
LogUtil.info("手动控制:折叠门门打开");
RobotManage.mainMachine.StringDoorOpen(null);
}
private void btn_stringdoorclose_Click(object sender, EventArgs e)
{
LogUtil.info("手动控制:折叠门门关闭");
RobotManage.mainMachine.StringDoorClose(null);
}
}
}
......@@ -17,7 +17,7 @@ namespace TheMachine
{
InitializeComponent();
showLogProDelegate = new ShowLogProDelegate(ShowLogPro);
LogUtil.ShowLog += LogUtil_ShowLog;
//LogUtil.ShowLog += LogUtil_ShowLog;
}
delegate void ShowLogProDelegate(string msg, Color color);
......
......@@ -52,6 +52,7 @@
<Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="halcondotnet, Version=12.0.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8" />
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
......
......@@ -308,6 +308,7 @@ namespace OnlineStore.ACSingleStore
private void FrmPositionTool_FormClosing(object sender, FormClosingEventArgs e)
{
LogUtil.ShowLog -= LogUtil_ShowLog;
timer1.Stop();
if (btnServoOff.Enabled)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!