Commit eb12d2ed 刘韬

基于汇川伺服

修复重复出库问题
1 个父辈 fab3aa85
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<add key="App_Title" value="料仓_批量上下料" /> <add key="App_Title" value="料仓_批量上下料" />
<add key="Server_Log_Open" value="0" /> <add key="Server_Log_Open" value="0" />
<add key="scanner_start_command" value="S" /> <add key="scanner_start_command" value="S" />
<add key="code_block_size_list" value="19,21" />
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)--> <!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="0.5" /> <add key="StartBlowValue" value="0.5" />
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)--> <!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
......
...@@ -49,8 +49,9 @@ ...@@ -49,8 +49,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath> <HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -367,7 +367,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -367,7 +367,7 @@ namespace OnlineStore.AutoInOutStore
} }
//string deviceMsg = "叉子上有料盘,请打开仓门检查"; //string deviceMsg = "叉子上有料盘,请打开仓门检查";
if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && store.StoreMove.MoveType.Equals(StoreMoveType.None) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (StoreManager.Store.Config.IsUse_Tray_Check.Equals(1) && store.storeRunStatus.Equals(StoreRunStatus.Runing) && store.StoreMove.MoveType.Equals(StoreMoveType.None) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
lblWarnMsg.Text = lblWarnMsg.Text + HasWare; lblWarnMsg.Text = lblWarnMsg.Text + HasWare;
} }
...@@ -879,6 +879,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -879,6 +879,7 @@ namespace OnlineStore.AutoInOutStore
private void btnClearLog_Click(object sender, EventArgs e) private void btnClearLog_Click(object sender, EventArgs e)
{ {
LogUtil.ClearLog(); LogUtil.ClearLog();
richTextBox1.Text = "";
} }
private void 料仓运转ONToolStripMenuItem_Click(object sender, EventArgs e) private void 料仓运转ONToolStripMenuItem_Click(object sender, EventArgs e)
......
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
......
...@@ -115,7 +115,6 @@ namespace OnlineStore.Common ...@@ -115,7 +115,6 @@ namespace OnlineStore.Common
public static string Tool_TargetSpeed = "Tool_TargetSpeed"; public static string Tool_TargetSpeed = "Tool_TargetSpeed";
public static string Tool_TargetPosition = "Tool_TargetPosition"; public static string Tool_TargetPosition = "Tool_TargetPosition";
public static string code_block_size_list= "code_block_size_list";
} }
} }
...@@ -50,8 +50,9 @@ ...@@ -50,8 +50,9 @@
<Reference Include="HuichuanLibrary"> <Reference Include="HuichuanLibrary">
<HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath> <HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -64,7 +64,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -64,7 +64,7 @@ namespace OnlineStore.DeviceLibrary
public abstract bool IsHomeMoveEnd(string portName, short slvAddr); public abstract bool IsHomeMoveEnd(string portName, short slvAddr);
public abstract bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError); public abstract bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError,out int IMP);
public abstract void ServoOn(string portName, short slvAddr); public abstract void ServoOn(string portName, short slvAddr);
public abstract void ServoOff(string portName, short slvAddr); public abstract void ServoOff(string portName, short slvAddr);
public abstract void RelMove(string portName, short slvAddr, int position, int targetSpeed , int ptpAcc , int ptpDec ); public abstract void RelMove(string portName, short slvAddr, int position, int targetSpeed , int ptpAcc , int ptpDec );
......
...@@ -137,10 +137,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -137,10 +137,10 @@ namespace OnlineStore.DeviceLibrary
{ {
HCBoardManager.AxisStop(slvAddr); HCBoardManager.AxisStop(slvAddr);
} }
public override bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError) public override bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError, out int INP)
{ {
countError = false; countError = false;
bool isOk = HCBoardManager.MoveIsEnd(axisNo); bool isOk = HCBoardManager.MoveIsEnd(axisNo,out INP);
if (isOk) if (isOk)
{ {
if (HCBoardManager.IsInPosition(axisNo, targetPosition, canErrorCount)) if (HCBoardManager.IsInPosition(axisNo, targetPosition, canErrorCount))
......
...@@ -24,7 +24,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -24,7 +24,7 @@ namespace OnlineStore.DeviceLibrary
public static List<string> codeTypeList = new List<string>(); public static List<string> codeTypeList = new List<string>();
//public static List<string> balserNameList = new List<string>(); //public static List<string> balserNameList = new List<string>();
public static List<string> hikNameList = new List<string>(); public static List<string> hikNameList = new List<string>();
public static List<int> Code_Block_Size_List = new List<int>();
private static char spiltChar = '#'; private static char spiltChar = '#';
/// <summary> /// <summary>
/// 初始化摄像机名称和二维码类型 /// 初始化摄像机名称和二维码类型
...@@ -35,6 +35,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -35,6 +35,16 @@ namespace OnlineStore.DeviceLibrary
{ {
QRCodeCount = 1; QRCodeCount = 1;
} }
string code_block_size_list = ConfigAppSettings.GetValue(Setting_Init.code_block_size_list);
var cl = code_block_size_list.Split(',');
foreach (string s in cl) {
int i;
if (int.TryParse(s, out i)) {
Code_Block_Size_List.Add(i);
}
}
if (Code_Block_Size_List.Count == 0)
Code_Block_Size_List.Add(19);
string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName); string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType); string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
codeTypeList = new List<string>(); codeTypeList = new List<string>();
...@@ -173,9 +183,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -173,9 +183,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码"); LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码");
string r = ""; string r = "";
foreach (int codesize in Code_Block_Size_List)
{
if (codeList.Count > 0)
break;
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp); List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp,null,codesize);
foreach (CodeInfo code in tlci) foreach (CodeInfo code in tlci)
{ {
LogUtil.info(" 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr); LogUtil.info(" 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
...@@ -189,7 +202,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,7 +202,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
}
/* /*
* List<CodeInfo> cc = new List<CodeInfo>(); * List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList) foreach (string codeType in codeTypeList)
...@@ -217,7 +230,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -217,7 +230,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
*/ */
if (codeList.Count()==0) if (codeList.Count() == 0)
{ {
SaveImageToFile("mimo", cameraName, bmp); SaveImageToFile("mimo", cameraName, bmp);
} }
......
...@@ -446,7 +446,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -446,7 +446,7 @@ namespace OnlineStore.DeviceLibrary
ResetCloseDoor(); ResetCloseDoor();
break; break;
case StoreMoveStep.BOX_H_OtherAxisBack: case StoreMoveStep.BOX_H_OtherAxisBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1); StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
ResetLog("复位中:旋转轴到P1,上下轴到P7门口位置,压紧轴到P1"); ResetLog("复位中:旋转轴到P1,上下轴到P7门口位置,压紧轴到P1");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
...@@ -531,7 +531,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -531,7 +531,7 @@ namespace OnlineStore.DeviceLibrary
private bool StartResetOut() private bool StartResetOut()
{ {
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (Config.IsUse_Tray_Check.Equals(1) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
if (IOManager.IOValue(IO_Type.ClampingDisc_Down).Equals(IO_VALUE.HIGH) || if (IOManager.IOValue(IO_Type.ClampingDisc_Down).Equals(IO_VALUE.HIGH) ||
IOManager.IOValue(IO_Type.ClampingDisc_Up).Equals(IO_VALUE.LOW)) IOManager.IOValue(IO_Type.ClampingDisc_Up).Equals(IO_VALUE.LOW))
...@@ -688,6 +688,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -688,6 +688,7 @@ namespace OnlineStore.DeviceLibrary
break; break;
case StoreMoveStep.BOX_H_OtherAxisBack: case StoreMoveStep.BOX_H_OtherAxisBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1); StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
ResetLog("回原点:旋转轴到P1,上下轴到门口位置P7,压紧轴到P1"); ResetLog("回原点:旋转轴到P1,上下轴到门口位置P7,压紧轴到P1");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
...@@ -1330,6 +1331,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -1330,6 +1331,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列"); LogUtil.info(LOGGER, StoreName + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列");
AddWaitOutInfo(currInOutFixture); AddWaitOutInfo(currInOutFixture);
} }
else {
TestADelWaitOutInfo(currInOutFixture);
}
} }
} }
} }
...@@ -1721,7 +1725,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1721,7 +1725,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (CodeOrInoutMsg.Equals("")) if (CodeOrInoutMsg.Equals(""))
{ {
if (storeRunStatus.Equals(StoreRunStatus.Runing) && AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing) if (Config.IsUse_Tray_Check.Equals(1) && storeRunStatus.Equals(StoreRunStatus.Runing) && AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing)
&& IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
boxStatus.SetMsg(ResourceControl.GetString(ResourceControl.HasWare, "叉子料盘检测有料,请检查"), ResourceControl.HasWare); boxStatus.SetMsg(ResourceControl.GetString(ResourceControl.HasWare, "叉子料盘检测有料,请检查"), ResourceControl.HasWare);
...@@ -1913,7 +1917,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1913,7 +1917,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("发送定时消息时,服务器返回Op=1 【" + json + "】"); LogUtil.error("发送定时消息时,服务器返回Op=1 【" + json + "】");
} }
else if (resultOperation.data != null) if (resultOperation.data != null)
{ {
string result = ""; string result = "";
Dictionary<string, string> dataMap = resultOperation.data; Dictionary<string, string> dataMap = resultOperation.data;
...@@ -2034,6 +2038,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -2034,6 +2038,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + " 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列"); LogUtil.info(LOGGER, StoreName + " 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列");
AddWaitOutInfo(currInOutFixture); AddWaitOutInfo(currInOutFixture);
} }
else
{
TestADelWaitOutInfo(currInOutFixture);
}
if (autoNext) if (autoNext)
{ {
autoMsg = ResourceControl.GetString("自动出库", "自动出库") + ":" + posId; autoMsg = ResourceControl.GetString("自动出库", "自动出库") + ":" + posId;
......
...@@ -311,7 +311,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -311,7 +311,7 @@ namespace OnlineStore.DeviceLibrary
UpdateInOutMsg(logMsg + "失败,找不到库位信息"); UpdateInOutMsg(logMsg + "失败,找不到库位信息");
return false; return false;
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (Config.IsUse_Tray_Check.Equals(1) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料"); UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料");
return false; return false;
...@@ -457,6 +457,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -457,6 +457,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库:SI_07 叉子返回,进出轴至P1,检测料仓料盘检测信号 "); InStoreLog("入库:SI_07 叉子返回,进出轴至P1,检测料仓料盘检测信号 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_07_InoutToP1); StoreMove.NextMoveStep(StoreMoveStep.SI_07_InoutToP1);
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
if (Config.IsUse_Tray_Check.Equals(1))
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
} }
} }
...@@ -811,7 +812,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -811,7 +812,7 @@ namespace OnlineStore.DeviceLibrary
UpdateInOutMsg(logMsg + "失败,找不到库位信息"); UpdateInOutMsg(logMsg + "失败,找不到库位信息");
return false; return false;
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (Config.IsUse_Tray_Check.Equals(1) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料"); UpdateInOutMsg(logMsg + "失败,叉子料盘检测有料");
return false; return false;
...@@ -972,7 +973,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -972,7 +973,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_06_BagDeviceBack) else if (StoreMove.MoveStep == StoreMoveStep.SO_06_BagDeviceBack)
{ {
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) if (Config.IsUse_Tray_Check.Equals(1) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{ {
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
LogUtil.error("出库【" + posId + "】取料完成后,未检测到叉子料盘信号 "); LogUtil.error("出库【" + posId + "】取料完成后,未检测到叉子料盘信号 ");
...@@ -1248,7 +1249,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -1248,7 +1249,20 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
public void TestADelWaitOutInfo(FixtureCodeInfo code)
{
lock (waitOutListLock)
{
//判断已经有此库位号的出库信息,直接抛弃不处理
List<FixtureCodeInfo> list = (from m in waitOutStoreList where m.PosId.Equals(code.PosId) select m).ToList<FixtureCodeInfo>();
if (list.Count > 0)
{
LogUtil.info($"当前队列任务数:{waitOutStoreList.Count} 【" + code.ToStr() + "】 【" + code.PosId + "】发现出库队列有重复任务,删除该队列任务");
waitOutStoreList.Remove(list[0]);
LogUtil.info($"waitOutStoreList:{waitOutStoreList.Count}");
}
}
}
#region 自动出入库循环代码 #region 自动出入库循环代码
public string GetAutoPosid(bool isNext) public string GetAutoPosid(bool isNext)
{ {
......
...@@ -273,6 +273,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -273,6 +273,7 @@ namespace OnlineStore.DeviceLibrary
} }
break; break;
case StoreMoveStep.AUTO_R04_AutoBack: case StoreMoveStep.AUTO_R04_AutoBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2);
LogUtil.info(Name + "复位中:上料轴移动到p1点【" + StoreManager.Config.BatchAxis_P2 + "】"); LogUtil.info(Name + "复位中:上料轴移动到p1点【" + StoreManager.Config.BatchAxis_P2 + "】");
ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed); ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
...@@ -408,6 +409,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -408,6 +409,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog(" 批量轴匀速上升【" + StoreManager.Config.BatchAxis_SlowSpeed + "】"); InStoreLog(" 批量轴匀速上升【" + StoreManager.Config.BatchAxis_SlowSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial);
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true); CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true);
if (StoreManager.Store.Config.IsUse_Tray_Check.Equals(1))
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
if (StoreManager.Config.Default_TrayWidth.Equals(7)) if (StoreManager.Config.Default_TrayWidth.Equals(7))
{ {
...@@ -564,15 +566,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -564,15 +566,20 @@ namespace OnlineStore.DeviceLibrary
addHeight = StoreManager.Config.LastTrayAddHeight; addHeight = StoreManager.Config.LastTrayAddHeight;
} }
LastHeight += addHeight; LastHeight += addHeight;
string msg = Name + StoreMove.MoveStep + " 计算盘高:脉冲值 [" + EndMovePosition + "-" + StartMovePosition + "]=[" + cha + "] ,补充[" + addHeight + "]计算后[" + LastHeight + "]"; string msg = Name + StoreMove.MoveStep + " 计算盘高:脉冲值 [" + EndMovePosition + "-" + StartMovePosition + "]=[" + cha + "] ,补充[" + addHeight + "]";
if (LastHeight < 0) if (LastHeight < 0)
{ {
LastHeight = StoreManager.Config.GetDefaultHeight(); LastHeight = StoreManager.Config.GetDefaultHeight();
msg += "使用默认值[" + LastHeight + "]";
}
if (LastHeight <= 8) { LastHeight = 8;
msg += "小于8[" + LastHeight + "]";
} }
if (LastHeight <= 8) { LastHeight = 8; }
else else
{ {
LastHeight = (int)Math.Floor(1F * (LastHeight-1) / 4) * 4; msg += "计算后[" + LastHeight + "]";
//LastHeight = (int)Math.Floor(1F * (LastHeight-1) / 4) * 4;
LastHeight = LastHeight - LastHeight % 4;
} }
LogUtil.info(msg + ",归类为" + LastHeight + "【" + LastCode + "】"); LogUtil.info(msg + ",归类为" + LastHeight + "【" + LastCode + "】");
return LastHeight; return LastHeight;
......
using OnlineStore.Common; using HuichuanLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -46,28 +47,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -46,28 +47,37 @@ namespace OnlineStore.DeviceLibrary
if (ACServerManager.IsHomeMoveEnd(moveAxis.DeviceName, moveAxis.GetAxisValue())) if (ACServerManager.IsHomeMoveEnd(moveAxis.DeviceName, moveAxis.GetAxisValue()))
{ {
//原点完成并且位置=0 //原点完成并且位置=0
int outCount = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue()); int outCount = AxisManager.instance.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
int errorCount = Math.Abs(outCount); int errorCount = Math.Abs(outCount);
if (errorCount > moveAxis.CanErrorCountMax) //if (outCount < 0)
//{
// ACServerManager.RelMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), 200, moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed);
// LogUtil.info(Name + moveAxis.DisplayStr + "回原过头["+ outCount + "],相对移动200");
// return false;
//}
//else
if (errorCount <= moveAxis.CanErrorCountMax)
{ {
LogUtil.info(Name + moveAxis.DisplayStr + "回原已到位,当前位置[" + outCount + "]最大允许误差[" + moveAxis.CanErrorCountMax + "]");
//ACServerManager.SuddenStop(moveAxis);
return true;
}
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (StoreMove.CanWhileCount > 0)
{ {
LogUtil.error(Name + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次"); LogUtil.error(Name + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],最大允许误差[" + moveAxis.CanErrorCountMax + "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed);
StoreMove.CanWhileCount--; StoreMove.CanWhileCount--;
} }
else else
{ {
// msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; // msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
SetWarnMsgAndLog(ResourceControl.AxisHomeMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), outCount + ""); SetWarnMsgAndLog(ResourceControl.AxisHomeMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), outCount + "");
msg = WarnObj.WarnMsg; msg = WarnObj.WarnMsg;
LogUtil.error(msg, 100); LogUtil.error(msg, 100);
return false; return false;
} }
}
return true;
} }
/* /*
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH)) else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
...@@ -77,6 +87,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,6 +87,8 @@ namespace OnlineStore.DeviceLibrary
}*/ }*/
return false; return false;
} }
protected static DateTime preRWTime = DateTime.Now; protected static DateTime preRWTime = DateTime.Now;
private static void CheckWait() private static void CheckWait()
{ {
...@@ -224,21 +236,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -224,21 +236,23 @@ namespace OnlineStore.DeviceLibrary
private static bool ACAxisMoveIsEnd(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed, out string msg) private static bool ACAxisMoveIsEnd(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed, out string msg)
{ {
msg = ""; msg = "";
bool isOk = ACServerManager.GetBusyStatus(moveAxis.DeviceName, moveAxis.GetAxisValue()).Equals(0); string deviceName = moveAxis.DeviceName;
if (isOk) short axisNo = moveAxis.GetAxisValue();
{ bool countError = false;
int outCount = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue()); bool IsOk = AxisManager.instance.AbsMoveIsEnd(deviceName, axisNo, targetPosition, moveAxis.CanErrorCountMax, out countError,out int IMP);
int errorCount = Math.Abs(outCount - targetPosition); if (IsOk)
if (errorCount <= moveAxis.CanErrorCountMax)
{ {
return true; return true;
} }
if (countError)
{
int outCount = AxisManager.instance.GetActualtPosition(deviceName, axisNo);
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (StoreMove.CanWhileCount > 0)
{ {
LogUtil.error(Name + moveAxis.DisplayStr + "目标[" + targetPosition + "]当前[" + outCount + LogUtil.error(Name + moveAxis.DisplayStr + "IMP["+IMP+"]目标[" + targetPosition + "]当前[" + outCount +
"],误差过大,重新运动,剩余[" + StoreMove.CanWhileCount + "]次"); "],误差过大,重新运动,剩余[" + StoreMove.CanWhileCount + "]次");
ACServerManager.SuddenStop(moveAxis.DeviceName, moveAxis.GetAxisValue()); //ACServerManager.SuddenStop(moveAxis.DeviceName, moveAxis.GetAxisValue());
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed);
StoreMove.CanWhileCount--; StoreMove.CanWhileCount--;
} }
...@@ -653,7 +667,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -653,7 +667,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device"); return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device");
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (StoreManager.Store.Config.IsUse_Tray_Check.Equals(1) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
return ResourceControl.GetString(ResourceControl.batchInError2, "Batch storing Error: gripper full, check before restoring"); return ResourceControl.GetString(ResourceControl.batchInError2, "Batch storing Error: gripper full, check before restoring");
} }
......
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -655,12 +655,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -655,12 +655,12 @@ namespace OnlineStore.LoadCSVLibrary
/// PRO (轴四)压紧轴加速度 CompAxis_AddSpeed 300 /// PRO (轴四)压紧轴加速度 CompAxis_AddSpeed 300
/// </summary> /// </summary>
[ConfigProAttribute("CompAxis_AddSpeed")] [ConfigProAttribute("CompAxis_AddSpeed")]
public short CompAxis_AddSpeed { get; set; } public int CompAxis_AddSpeed { get; set; }
/// <summary> /// <summary>
/// PRO (轴四)压紧轴减速度 CompAxis_DelSpeed 300 /// PRO (轴四)压紧轴减速度 CompAxis_DelSpeed 300
/// </summary> /// </summary>
[ConfigProAttribute("CompAxis_DelSpeed")] [ConfigProAttribute("CompAxis_DelSpeed")]
public short CompAxis_DelSpeed { get; set; } public int CompAxis_DelSpeed { get; set; }
/// <summary> /// <summary>
/// PRO (轴四)压紧轴原点低速 CompAxis_HomeLowSpeed 20 /// PRO (轴四)压紧轴原点低速 CompAxis_HomeLowSpeed 20
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!