Commit 3aae5c39 张东亮

添加校准库位缓存、出入库状态上报逻辑修改

1 个父辈 0445b5a6
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</Reference> </Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\DLL\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
......
...@@ -96,5 +96,7 @@ namespace OnlineStore.Common ...@@ -96,5 +96,7 @@ namespace OnlineStore.Common
public static MyConfig<int> CameraScan_QRCodeCount = 3; public static MyConfig<int> CameraScan_QRCodeCount = 3;
[MyConfigComment("二维码扫码超时毫秒")] [MyConfigComment("二维码扫码超时毫秒")]
public static MyConfig<int> CameraScan_CodeTimeOut = 3000; public static MyConfig<int> CameraScan_CodeTimeOut = 3000;
[MyConfigComment("校准库位料盘缓存")]
public static MyConfig<string> FixBuffInfo = "";
} }
} }
...@@ -34,26 +34,26 @@ ...@@ -34,26 +34,26 @@
<ItemGroup> <ItemGroup>
<Reference Include="Asa.Camera.VisionLib, Version=1.3.8398.28384, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Asa.Camera.VisionLib, Version=1.3.8398.28384, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\Asa.Camera.VisionLib.dll</HintPath> <HintPath>..\DLL\Asa.Camera.VisionLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="CodeLibrary, Version=1.0.8406.19246, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary, Version=1.0.8406.19246, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\CodeLibrary.dll</HintPath> <HintPath>..\DLL\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\ConfigHelper.dll</HintPath> <HintPath>..\DLL\ConfigHelper.dll</HintPath>
</Reference> </Reference>
<Reference Include="halcondotnet, Version=12.0.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8, processorArchitecture=MSIL"> <Reference Include="halcondotnet, Version=12.0.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\halcondotnet.dll</HintPath> <HintPath>..\DLL\halcondotnet.dll</HintPath>
</Reference> </Reference>
<Reference Include="HuichuanLibrary"> <Reference Include="HuichuanLibrary">
<HintPath>..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath> <HintPath>..\DLL\HuichuanLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=AMD64"> <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\log4net.dll</HintPath> <HintPath>..\DLL\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath> <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
......
...@@ -124,8 +124,14 @@ namespace DeviceLibrary ...@@ -124,8 +124,14 @@ namespace DeviceLibrary
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
if (!string.IsNullOrEmpty(posid)) if (!string.IsNullOrEmpty(posid))
operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid); operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid);
operation.boxStatus[StoreID].status = (int)storeStatus; if (storeStatus == StoreStatus.OutStoreEnd ||
storeStatus == StoreStatus.OutStoreBoxEnd ||
storeStatus == StoreStatus.InStoreEnd)
{
}
else
operation.boxStatus[StoreID].status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation)); LogUtil.info(JsonHelper.SerializeObject(operation));
if (RobotManage.InoutDebugMode) if (RobotManage.InoutDebugMode)
...@@ -145,13 +151,16 @@ namespace DeviceLibrary ...@@ -145,13 +151,16 @@ namespace DeviceLibrary
LogUtil.info($"SendStoreState success,posid:{posid}, storeStatus:{storeStatus}"); LogUtil.info($"SendStoreState success,posid:{posid}, storeStatus:{storeStatus}");
ResultProcess(resultOperation); ResultProcess(resultOperation);
if (storeStatus == StoreStatus.OutStoreEnd || //if (storeStatus == StoreStatus.OutStoreEnd ||
storeStatus == StoreStatus.OutStoreBoxEnd || // storeStatus == StoreStatus.OutStoreBoxEnd ||
storeStatus == StoreStatus.InStoreEnd) // storeStatus == StoreStatus.InStoreEnd)
//{
// this.storeStatus = StoreStatus.StoreOnline;
//}
if (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.StringOut_Released)
{ {
this.storeStatus = StoreStatus.StoreOnline; this.storeStatus = StoreStatus.StoreOnline;
} }
} }
return true; return true;
} }
......
...@@ -248,6 +248,7 @@ namespace DeviceLibrary ...@@ -248,6 +248,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.StoreFIX04: case MoveStep.StoreFIX04:
MoveInfo.NextMoveStep(MoveStep.StoreFIX05); MoveInfo.NextMoveStep(MoveStep.StoreFIX05);
RobotManage.PutReelInFixPos(MoveInfo.MoveParam);
Comp_Axis.AbsMove(MoveInfo, Fix.Comp_PL, Config.Comp_P2_speed); Comp_Axis.AbsMove(MoveInfo, Fix.Comp_PL, Config.Comp_P2_speed);
UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PH, Config.UpDown_P3_speed/2); UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PH, Config.UpDown_P3_speed/2);
MoveInfo.log($"{storeMoveType}:压紧轴压紧点:{Fix.Comp_PL}"); MoveInfo.log($"{storeMoveType}:压紧轴压紧点:{Fix.Comp_PL}");
...@@ -260,6 +261,7 @@ namespace DeviceLibrary ...@@ -260,6 +261,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.StoreTS10: case MoveStep.StoreTS10:
MoveInfo.NextMoveStep(MoveStep.StoreTS11); MoveInfo.NextMoveStep(MoveStep.StoreTS11);
RobotManage.ClearReelInFixPos();
Middle_Axis.AbsMove(MoveInfo, To.Middle_P2, Config.Middle_P2_speed); Middle_Axis.AbsMove(MoveInfo, To.Middle_P2, Config.Middle_P2_speed);
MoveInfo.log($"{storeMoveType}:行走机构到达目的地:{To.Middle_P2}"); MoveInfo.log($"{storeMoveType}:行走机构到达目的地:{To.Middle_P2}");
UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PH, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PH, Config.UpDown_P1_speed);
......
...@@ -20,7 +20,8 @@ namespace DeviceLibrary ...@@ -20,7 +20,8 @@ namespace DeviceLibrary
get { return _canRunning; } get { return _canRunning; }
set set
{ {
if (_canRunning != value) { if (_canRunning != value)
{
Msg.setlogones(); Msg.setlogones();
} }
_canRunning = value; _canRunning = value;
...@@ -70,11 +71,12 @@ namespace DeviceLibrary ...@@ -70,11 +71,12 @@ namespace DeviceLibrary
public MainMachine(Robot_Config _config) { public MainMachine(Robot_Config _config)
{
Config = _config; Config = _config;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
StringMoveInfo = new MoveInfo("料串进出机构"); StringMoveInfo = new MoveInfo("料串进出机构");
StringMoveInfo.SetStateDelegate(StringProcessState); StringMoveInfo.SetStateDelegate(StringProcessState);
ClampMoveInfo = new MoveInfo("取放料机构"); ClampMoveInfo = new MoveInfo("取放料机构");
ClampMoveInfo.SetStateDelegate(ClampState); ClampMoveInfo.SetStateDelegate(ClampState);
StoreMoveInfo = new MoveInfo("进出库调度"); StoreMoveInfo = new MoveInfo("进出库调度");
...@@ -83,10 +85,10 @@ namespace DeviceLibrary ...@@ -83,10 +85,10 @@ namespace DeviceLibrary
AIOTMoveInfo = new MoveInfo("出入库测试"); AIOTMoveInfo = new MoveInfo("出入库测试");
#region 初始化led #region 初始化led
RunningLed = new Led(Config.DOList[IO_Type.Run_Led].GetIOAddr(),LedColor.green); RunningLed = new Led(Config.DOList[IO_Type.Run_Led].GetIOAddr(), LedColor.green);
StandbyLed = new Led(Config.DOList[IO_Type.Standby_Led].GetIOAddr(), LedColor.yellow); StandbyLed = new Led(Config.DOList[IO_Type.Standby_Led].GetIOAddr(), LedColor.yellow);
AlarmLed = new Led(Config.DOList[IO_Type.Alarm_Led].GetIOAddr(), LedColor.red); AlarmLed = new Led(Config.DOList[IO_Type.Alarm_Led].GetIOAddr(), LedColor.red);
//NG_Led = new Led(Config.DOList[IO_Type.MaterialNG_Led].GetIOAddr()); //NG_Led = new Led(Config.DOList[IO_Type.MaterialNG_Led].GetIOAddr());
#endregion #endregion
#region 初始化伺服轴 #region 初始化伺服轴
...@@ -109,10 +111,10 @@ namespace DeviceLibrary ...@@ -109,10 +111,10 @@ namespace DeviceLibrary
{ {
InOutEndProcessEvent?.Invoke(posid, storeMoveType, arg4); InOutEndProcessEvent?.Invoke(posid, storeMoveType, arg4);
}; };
AlarmBuzzer.SetOnOffAction(() =>{ IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.HIGH); }, () => { IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW); }); AlarmBuzzer.SetOnOffAction(() => { IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.HIGH); }, () => { IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW); });
IOMonitor.RegisterIO(IO_Type.Reset_BTN, Config, IO_VALUE.HIGH, Reset_BTN, 2500,100); IOMonitor.RegisterIO(IO_Type.Reset_BTN, Config, IO_VALUE.HIGH, Reset_BTN, 2500, 100);
IOMonitor.RegisterIO(IO_Type.AutoRun_Single, Config, IO_VALUE.HIGH, Run_BTN, 2500,100); IOMonitor.RegisterIO(IO_Type.AutoRun_Single, Config, IO_VALUE.HIGH, Run_BTN, 2500, 100);
LedProcessInit(); LedProcessInit();
} }
...@@ -120,7 +122,7 @@ namespace DeviceLibrary ...@@ -120,7 +122,7 @@ namespace DeviceLibrary
private void Crc_LanguageChangeEvent(object sender, EventArgs e) private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{ {
StringMoveInfo.Name=crc.GetString(L.string_inout_equipment, "料串进出机构"); StringMoveInfo.Name = crc.GetString(L.string_inout_equipment, "料串进出机构");
ClampMoveInfo.Name = crc.GetString(L.clamp_equipment, "取放料机构"); ClampMoveInfo.Name = crc.GetString(L.clamp_equipment, "取放料机构");
StoreMoveInfo.Name = crc.GetString(L.store_manage_equipment, "进出库调度"); StoreMoveInfo.Name = crc.GetString(L.store_manage_equipment, "进出库调度");
ResetMoveInfo.Name = crc.GetString(L.reset_equipment, "重置"); ResetMoveInfo.Name = crc.GetString(L.reset_equipment, "重置");
...@@ -134,13 +136,14 @@ namespace DeviceLibrary ...@@ -134,13 +136,14 @@ namespace DeviceLibrary
if (IOValue(IO_Type.ClampingDisc_Up).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.ClampingDisc_Up).Equals(IO_VALUE.HIGH))
return (false, ""); return (false, "");
var ismiddleatdoor = Middle_Axis.IsInPosition(Config.Middle_P1) || Middle_Axis.IsInPosition(Config.Middle_P2) || Middle_Axis.IsInPosition(Config.Middle_P3); var ismiddleatdoor = Middle_Axis.IsInPosition(Config.Middle_P1) || Middle_Axis.IsInPosition(Config.Middle_P2) || Middle_Axis.IsInPosition(Config.Middle_P3);
if (!ismiddleatdoor) if (!ismiddleatdoor)
return (false, ""); return (false, "");
var isupdownindoor = UpDown_Axis.IsInPosition(Config.UpDown_P1) || UpDown_Axis.IsInPosition(Config.UpDown_P2) || UpDown_Axis.IsInPosition(Config.UpDown_P3) || UpDown_Axis.IsInPosition(Config.UpDown_P4) || UpDown_Axis.IsInPosition(Config.UpDown_P5); var isupdownindoor = UpDown_Axis.IsInPosition(Config.UpDown_P1) || UpDown_Axis.IsInPosition(Config.UpDown_P2) || UpDown_Axis.IsInPosition(Config.UpDown_P3) || UpDown_Axis.IsInPosition(Config.UpDown_P4) || UpDown_Axis.IsInPosition(Config.UpDown_P5);
if (isupdownindoor) { if (isupdownindoor)
{
return (true, crc.GetString(L.InOut_Axis_interference_01, "夹爪取料气缸不在上端,进出轴不可运动")); return (true, crc.GetString(L.InOut_Axis_interference_01, "夹爪取料气缸不在上端,进出轴不可运动"));
} }
...@@ -171,10 +174,12 @@ namespace DeviceLibrary ...@@ -171,10 +174,12 @@ namespace DeviceLibrary
/// <summary> /// <summary>
/// 整机启动变量,设置为false后将退出线程,只在停止时调用 /// 整机启动变量,设置为false后将退出线程,只在停止时调用
/// </summary> /// </summary>
bool mstart=true; bool mstart = true;
public void Run() { public void Run()
{
mstart = true; mstart = true;
while (mstart) { while (mstart)
{
try try
{ {
canRunning = DeviceCheck(); canRunning = DeviceCheck();
...@@ -209,11 +214,12 @@ namespace DeviceLibrary ...@@ -209,11 +214,12 @@ namespace DeviceLibrary
Msg.add(ex.ToString(), MsgLevel.warning); Msg.add(ex.ToString(), MsgLevel.warning);
Msg.setlogones(); Msg.setlogones();
} }
finally { finally
{
var m = Msg.get(); var m = Msg.get();
ProcessMsgEvent?.Invoke(m); ProcessMsgEvent?.Invoke(m);
ServerCM.ProcessMsg(m); ServerCM.ProcessMsg(m);
StoreStatus currnetstoreStatus= StoreStatus.None; StoreStatus currnetstoreStatus = StoreStatus.None;
if (m.Find((aa) => aa.msgLevel == MsgLevel.alarm) == null) if (m.Find((aa) => aa.msgLevel == MsgLevel.alarm) == null)
{ {
hasAlarm = false; hasAlarm = false;
...@@ -226,7 +232,8 @@ namespace DeviceLibrary ...@@ -226,7 +232,8 @@ namespace DeviceLibrary
currnetstoreStatus = StoreStatus.StoreOnline; currnetstoreStatus = StoreStatus.StoreOnline;
} }
} }
else { else
{
hasAlarm = true; hasAlarm = true;
AlarmBuzzer.ON(); AlarmBuzzer.ON();
currnetstoreStatus = isInSuddenDown ? StoreStatus.SuddenStop : StoreStatus.Warning; currnetstoreStatus = isInSuddenDown ? StoreStatus.SuddenStop : StoreStatus.Warning;
...@@ -237,17 +244,19 @@ namespace DeviceLibrary ...@@ -237,17 +244,19 @@ namespace DeviceLibrary
else else
currnetstoreStatus = StoreStatus.Debugging; currnetstoreStatus = StoreStatus.Debugging;
if (currnetstoreStatus!=StoreStatus.None) if (currnetstoreStatus != StoreStatus.None)
ServerCM.storeStatus = currnetstoreStatus; ServerCM.storeStatus = currnetstoreStatus;
} }
} }
LogUtil.info("主线程已退出."); LogUtil.info("主线程已退出.");
} }
public void Start() { public void Start()
{
ServerCM.StartConnectServer(); ServerCM.StartConnectServer();
Run(); Run();
} }
public void Stop() { public void Stop()
{
mstart = false; mstart = false;
AutoInOutTest = false; AutoInOutTest = false;
ServerCM.StopConnectServer(); ServerCM.StopConnectServer();
...@@ -258,7 +267,8 @@ namespace DeviceLibrary ...@@ -258,7 +267,8 @@ namespace DeviceLibrary
} }
public void BeginHomeReset(bool firstRun=false) { public void BeginHomeReset(bool firstRun = false)
{
if (!firstRun) if (!firstRun)
{ {
StopMove(); StopMove();
...@@ -273,7 +283,7 @@ namespace DeviceLibrary ...@@ -273,7 +283,7 @@ namespace DeviceLibrary
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
} }
//强制回原 //强制回原
bool forceHome=true; bool forceHome = true;
void HomeReset() void HomeReset()
{ {
if (CheckWait(ResetMoveInfo)) if (CheckWait(ResetMoveInfo))
...@@ -283,14 +293,15 @@ namespace DeviceLibrary ...@@ -283,14 +293,15 @@ namespace DeviceLibrary
{ {
case MoveStep.H01_HomeReset: case MoveStep.H01_HomeReset:
ServerCM.storeStatus = StoreStatus.ResetMove; ServerCM.storeStatus = StoreStatus.ResetMove;
if (IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.LOW)) { if (IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.LOW))
{
Msg.add("批量门没有关闭,无法复位,请关闭批量门", MsgLevel.alarm); Msg.add("批量门没有关闭,无法复位,请关闭批量门", MsgLevel.alarm);
return; return;
} }
CylinderMove(ResetMoveInfo, IO_Type.BatchDoor_Close, IO_Type.BatchDoor_Open, IO_VALUE.LOW); CylinderMove(ResetMoveInfo, IO_Type.BatchDoor_Close, IO_Type.BatchDoor_Open, IO_VALUE.LOW);
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset_01); ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset_01);
break; break;
case MoveStep.H02_HomeReset_01: case MoveStep.H02_HomeReset_01:
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
...@@ -305,12 +316,12 @@ namespace DeviceLibrary ...@@ -305,12 +316,12 @@ namespace DeviceLibrary
CylinderMove(ResetMoveInfo, IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, IO_VALUE.LOW); CylinderMove(ResetMoveInfo, IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, IO_VALUE.LOW);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break; break;
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
ResetMoveInfo.log("旋转轴,升降轴,回原,料叉P1待机点"); ResetMoveInfo.log("旋转轴,升降轴,回原,料叉P1待机点");
InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
Middle_Axis.HomeMove(ResetMoveInfo, forceHome); Middle_Axis.HomeMove(ResetMoveInfo, forceHome);
UpDown_Axis.HomeMove(ResetMoveInfo, forceHome); UpDown_Axis.HomeMove(ResetMoveInfo, forceHome);
//OpenFlipDoor(ResetMoveInfo); //OpenFlipDoor(ResetMoveInfo);
break; break;
case MoveStep.H04_HomeReset: case MoveStep.H04_HomeReset:
...@@ -328,7 +339,7 @@ namespace DeviceLibrary ...@@ -328,7 +339,7 @@ namespace DeviceLibrary
case MoveStep.H06_HomeReset: case MoveStep.H06_HomeReset:
ResetMoveInfo.log("压紧轴回原"); ResetMoveInfo.log("压紧轴回原");
if (AxisManager.GetAlarmStatus(Comp_Axis.Config.DeviceName, Comp_Axis.Config.GetAxisValue()) == 1) if (AxisManager.GetAlarmStatus(Comp_Axis.Config.DeviceName, Comp_Axis.Config.GetAxisValue()) == 1)
{ {
AxisManager.AlarmClear(Comp_Axis.Config.DeviceName, Comp_Axis.Config.GetAxisValue()); AxisManager.AlarmClear(Comp_Axis.Config.DeviceName, Comp_Axis.Config.GetAxisValue());
Msg.add("压紧轴报警无法回原,请手动取出取料叉上的物料", MsgLevel.alarm); Msg.add("压紧轴报警无法回原,请手动取出取料叉上的物料", MsgLevel.alarm);
SingleDoor.ToHigh(null); SingleDoor.ToHigh(null);
...@@ -342,7 +353,8 @@ namespace DeviceLibrary ...@@ -342,7 +353,8 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.H07_HomeReset: case MoveStep.H07_HomeReset:
if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) { if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
ResetMoveInfo.NextMoveStep(MoveStep.H12_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H12_HomeReset);
ResetMoveInfo.log("料叉上有料,送到NG口"); ResetMoveInfo.log("料叉上有料,送到NG口");
Middle_Axis.AbsMove(ResetMoveInfo, Config.Middle_P2, Config.Middle_P2_speed); Middle_Axis.AbsMove(ResetMoveInfo, Config.Middle_P2, Config.Middle_P2_speed);
...@@ -350,11 +362,11 @@ namespace DeviceLibrary ...@@ -350,11 +362,11 @@ namespace DeviceLibrary
} }
else else
if (IOValue(IO_Type.WidthCheck_7).Equals(IO_VALUE.HIGH) || if (IOValue(IO_Type.WidthCheck_7).Equals(IO_VALUE.HIGH) ||
IOValue(IO_Type.WidthCheck_13).Equals(IO_VALUE.HIGH) ) IOValue(IO_Type.WidthCheck_13).Equals(IO_VALUE.HIGH))
{ {
ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset);
ResetMoveInfo.log("夹爪上有料盘,送到NG口"); ResetMoveInfo.log("夹爪上有料盘,送到NG口");
} }
else else
{ {
...@@ -405,7 +417,8 @@ namespace DeviceLibrary ...@@ -405,7 +417,8 @@ namespace DeviceLibrary
Msg.add(crc.GetString(L.x29_higt_has_reel, "系统启动X29检测到有无信息料盘,等待取走单料口料盘"), MsgLevel.alarm); Msg.add(crc.GetString(L.x29_higt_has_reel, "系统启动X29检测到有无信息料盘,等待取走单料口料盘"), MsgLevel.alarm);
RobotManage.UserPause("系统启动X29检测到有无信息料盘,等待取走单料口料盘"); RobotManage.UserPause("系统启动X29检测到有无信息料盘,等待取走单料口料盘");
} }
else { else
{
ResetMoveInfo.NextMoveStep(MoveStep.H15_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H15_HomeReset);
ResetMoveInfo.log("料盘已取走"); ResetMoveInfo.log("料盘已取走");
} }
...@@ -415,7 +428,7 @@ namespace DeviceLibrary ...@@ -415,7 +428,7 @@ namespace DeviceLibrary
{ {
Msg.add(crc.GetString(L.wait_put_reel_into_ngdoor, "等待阻挡物离开光栅"), MsgLevel.warning); Msg.add(crc.GetString(L.wait_put_reel_into_ngdoor, "等待阻挡物离开光栅"), MsgLevel.warning);
} }
else else
{ {
ResetMoveInfo.NextMoveStep(MoveStep.H16_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H16_HomeReset);
} }
...@@ -446,27 +459,43 @@ namespace DeviceLibrary ...@@ -446,27 +459,43 @@ namespace DeviceLibrary
boxTransport.Reset(); boxTransport.Reset();
ResetMoveInfo.log("回原完成"); ResetMoveInfo.log("回原完成");
ResetMoveInfo.EndMove(); ResetMoveInfo.EndMove();
if ((RobotManage.HasReelInFixPos(out ReelParam reelParam)) && boxTransport.IsComplateOrFree && ClampMoveInfo.MoveStep == MoveStep.Wait && ConfigHelper.Config.Get("Device_Use_Fixpos", false))
{
StoreMoveInfo.NewMove(MoveStep.StoreOut_NGPre);
StoreMoveInfo.MoveParam = reelParam.clone();
StoreMoveInfo.MoveParam.PosID = "NG";
StoreMoveInfo.MoveParam.IsNg = true;
StoreMoveInfo.MoveParam.NgMsg = "检测到校准库位有料盘信息,请人工确认";
StoreMoveInfo.log($"开始校准库位料盘出库");
ServerCM.storeStatus = StoreStatus.OutStoreExecute;
//CloseFlipDoor(StoreMoveInfo);
}
runStatus = RunStatus.Running; runStatus = RunStatus.Running;
ServerCM.storeStatus = StoreStatus.StoreOnline; ServerCM.storeStatus = StoreStatus.StoreOnline;
break; break;
} }
} }
bool _IgnoreSafecheck = false; bool _IgnoreSafecheck = false;
public bool IgnoreSafecheck { get => _IgnoreSafecheck; set { public bool IgnoreSafecheck
{
get => _IgnoreSafecheck; set
{
if (value) if (value)
{ {
IOMove(IO_Type.DoorSafe_Disable, IO_VALUE.HIGH); IOMove(IO_Type.DoorSafe_Disable, IO_VALUE.HIGH);
} }
else { else
{
IOMove(IO_Type.DoorSafe_Disable, IO_VALUE.LOW); IOMove(IO_Type.DoorSafe_Disable, IO_VALUE.LOW);
} }
_IgnoreSafecheck = value; _IgnoreSafecheck = value;
} } }
}
public bool IgnoreGratingSignal = false; public bool IgnoreGratingSignal = false;
bool lastSafeCheckStatus = true; bool lastSafeCheckStatus = true;
bool SafeCheck() { bool SafeCheck()
{
bool ok = true; bool ok = true;
var ignorestring = "[" + crc.GetString(L.ignored, "已忽略") + "]"; var ignorestring = "[" + crc.GetString(L.ignored, "已忽略") + "]";
if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
...@@ -504,7 +533,8 @@ namespace DeviceLibrary ...@@ -504,7 +533,8 @@ namespace DeviceLibrary
return ok; return ok;
} }
void DeviceSuddenStop() { void DeviceSuddenStop()
{
if (lastSafeCheckStatus) if (lastSafeCheckStatus)
{ {
AxisBean.StopMultiAxis(AxisBean.List); AxisBean.StopMultiAxis(AxisBean.List);
...@@ -523,7 +553,8 @@ namespace DeviceLibrary ...@@ -523,7 +553,8 @@ namespace DeviceLibrary
DateTime lastAirCloseTime = DateTime.MinValue; DateTime lastAirCloseTime = DateTime.MinValue;
internal DateTime checkAlarmTime = DateTime.Now; internal DateTime checkAlarmTime = DateTime.Now;
public bool DeviceCheck() { public bool DeviceCheck()
{
bool ok = true; bool ok = true;
isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW); isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW);
if (UserPause) if (UserPause)
...@@ -540,14 +571,15 @@ namespace DeviceLibrary ...@@ -540,14 +571,15 @@ namespace DeviceLibrary
Msg.add(crc.GetString(L.in_suddenstop, "急停中"), MsgLevel.alarm); Msg.add(crc.GetString(L.in_suddenstop, "急停中"), MsgLevel.alarm);
ok = false; ok = false;
} }
else if (alarmType != AlarmType.None) { else if (alarmType != AlarmType.None)
{
//if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)) //if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH))
//{ //{
// Alarm(AlarmType.None); // Alarm(AlarmType.None);
//} //}
//else //else
{ {
Msg.add(crc.GetString(L.system_need_reset, "系统需要重置"), MsgLevel.alarm,ErrInfo.SuddenStop); Msg.add(crc.GetString(L.system_need_reset, "系统需要重置"), MsgLevel.alarm, ErrInfo.SuddenStop);
ButtenEvent?.Invoke(null, ErrInfo.SuddenStop); ButtenEvent?.Invoke(null, ErrInfo.SuddenStop);
ok = false; ok = false;
} }
...@@ -569,10 +601,11 @@ namespace DeviceLibrary ...@@ -569,10 +601,11 @@ namespace DeviceLibrary
Msg.add(crc.GetString(L.airpressure_not_enough, "气压不足"), MsgLevel.warning); Msg.add(crc.GetString(L.airpressure_not_enough, "气压不足"), MsgLevel.warning);
} }
} }
else { else
{
lastAirCloseTime = DateTime.MinValue; lastAirCloseTime = DateTime.MinValue;
} }
if (alarmType!=AlarmType.SuddenStop) if (alarmType != AlarmType.SuddenStop)
{ {
TimeSpan span = DateTime.Now - checkAlarmTime; TimeSpan span = DateTime.Now - checkAlarmTime;
if (span.TotalSeconds > 2) if (span.TotalSeconds > 2)
...@@ -610,7 +643,8 @@ namespace DeviceLibrary ...@@ -610,7 +643,8 @@ namespace DeviceLibrary
return ok; return ok;
} }
public void IgnoreX09() { public void IgnoreX09()
{
boxTransport.IgnoreX09 = true; boxTransport.IgnoreX09 = true;
LogUtil.info("按下X09忽略"); LogUtil.info("按下X09忽略");
} }
......
...@@ -180,6 +180,34 @@ namespace DeviceLibrary ...@@ -180,6 +180,34 @@ namespace DeviceLibrary
else else
LogUtil.info("用户取消忽略安全光栅"); LogUtil.info("用户取消忽略安全光栅");
} }
#region 校准库位缓存
public static bool HasReelInFixPos(out ReelParam reelParam)
{
reelParam = null;
try
{
string fix = ConfigHelper.Config.Get(Setting_Init.FixBuffInfo, "");
if (!string.IsNullOrEmpty(fix))
{
reelParam = JsonHelper.DeserializeJsonToObject<ReelParam>(fix);
return true;
}
}
catch (Exception e)
{
LogUtil.error("解析校准库位缓存异常", e);
}
return false;
}
public static void PutReelInFixPos(ReelParam reelParam)
{
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo, JsonHelper.SerializeObject(reelParam));
}
public static void ClearReelInFixPos()
{
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo, "");
}
#endregion
} }
public enum StoreType { public enum StoreType {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\DLL\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -43,15 +43,15 @@ ...@@ -43,15 +43,15 @@
<ItemGroup> <ItemGroup>
<Reference Include="CodeLibrary, Version=1.0.8406.19246, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary, Version=1.0.8406.19246, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\CodeLibrary.dll</HintPath> <HintPath>..\DLL\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\ConfigHelper.dll</HintPath> <HintPath>..\DLL\ConfigHelper.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=AMD64"> <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SO1069MIMO_PLUS\DLL\log4net.dll</HintPath> <HintPath>..\DLL\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!