Commit 3b1de64d 张东亮
2 个父辈 63f8fdee 0786a918
...@@ -333,6 +333,17 @@ ...@@ -333,6 +333,17 @@
<param name="value">最大力矩限制</param> <param name="value">最大力矩限制</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:HuichuanLibrary.HCBoardManager.SetAxBacklash(System.Int16,System.Int32,System.Int32,System.Int16)">
<summary>
设置反向间隙
HuichuanLibrary.HCBoardManager.SetAxBacklash(MiddleAxis.Config.GetAxisValue(),Config.MiddleAxis_Reverse_Offset, MiddleAxis.Config.HomeLowSpeed,-1);
</summary>
<param name="axisNo"></param>
<param name="wholdCmpVal"></param>
<param name="cmpVel"></param>
<param name="cmpDir"></param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisLoadRate(System.Int16)"> <member name="M:HuichuanLibrary.HCBoardManager.GetAxisLoadRate(System.Int16)">
<summary> <summary>
获取轴的负载率 获取轴的负载率
......
...@@ -71,3 +71,6 @@ PRO,4,取料旋转轴_P5速度,Middle_P5_Speed,100000,,,,,,,,,,,, ...@@ -71,3 +71,6 @@ PRO,4,取料旋转轴_P5速度,Middle_P5_Speed,100000,,,,,,,,,,,,
PRO,5,取料旋转轴_P6速度,Middle_P6_Speed,100000,,,,,,,,,,,, PRO,5,取料旋转轴_P6速度,Middle_P6_Speed,100000,,,,,,,,,,,,
PRO,6,取料旋转轴_P7速度,Middle_P7_Speed,100000,,,,,,,,,,,, PRO,6,取料旋转轴_P7速度,Middle_P7_Speed,100000,,,,,,,,,,,,
PRO,7,取料旋转轴_P8速度,Middle_P8_Speed,100000,,,,,,,,,,,, PRO,7,取料旋转轴_P8速度,Middle_P8_Speed,100000,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,取料旋转轴_反向间隙补偿值,MiddleAxis_Reverse_Offset,300,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
...@@ -508,7 +508,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -508,7 +508,13 @@ namespace OnlineStore.DeviceLibrary
int pW = FormUtil.GetIntValue(serverResult.plateW); int pW = FormUtil.GetIntValue(serverResult.plateW);
result.Param = new InOutPosInfo(serverResult.barcode, serverResult.posId, pW, pH, urgentReel, cutReel, smallReel, serverResult.rfid, rfidloc); result.Param = new InOutPosInfo(serverResult.barcode, serverResult.posId, pW, pH, urgentReel, cutReel, smallReel, serverResult.rfid, rfidloc);
LogUtil.info(deviceName + "收到出库命令: " + result.Param.ToStr() + " "); LogUtil.error(deviceName + " 【" + codeStr + "】结果入库NG:收到出库信息: " + result.Param.ToStr() + " ");
result.Msg ="收到出库信息["+ serverResult.barcode + "][" + serverResult.posId + "] ";
cancelPutInTask(deviceName, codeStr);
result.Param = InOutPosInfo.NewNgPos(codeStr, "", height, width, "收到出库信息[" + serverResult.barcode + "][" + serverResult.posId + "]");
result.Param.rfid = rfid;
result.Param.IsNG = true;
return result; return result;
} }
else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false)) else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false))
...@@ -542,7 +548,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -542,7 +548,8 @@ namespace OnlineStore.DeviceLibrary
{ {
result.Param.IsNG = true; result.Param.IsNG = true;
result.Param.NgMsg = "未找到库位[" + position + "]"; result.Param.NgMsg = "未找到库位[" + position + "]";
result.Msg = deviceName + ("收到服务器入库命令 " + ",未找到库位: " + result.Param.ToStr() + " ,入库失败!"); result.Msg = "未找到库位: " + result.Param.ToStr() + " ,入库失败";
LogUtil.error( deviceName + ("收到服务器入库命令 " + ",未找到库位: " + result.Param.ToStr() + " ,入库失败!"));
return result; return result;
} }
else else
...@@ -648,66 +655,68 @@ namespace OnlineStore.DeviceLibrary ...@@ -648,66 +655,68 @@ namespace OnlineStore.DeviceLibrary
public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "0", string robotIndex = "1") public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "0", string robotIndex = "1")
{ {
LogUtil.info($"ShelfFinish rifd【{rfid}】barcode【{barcode}】rfidLoc【{rfidLoc}】robotIndex【{robotIndex}】");
ShelfTaskInfo task = new ShelfTaskInfo(); ShelfTaskInfo task = new ShelfTaskInfo();
task.rfid = rfid; task.rfid = rfid;
DateTime startTime = DateTime.Now;
try
{
string api = Addr_ShelfFinish;
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);
paramMap.Add("rfid", rfid);
paramMap.Add("rfidLoc", rfidLoc);
paramMap.Add("robotIndex", robotIndex);
//string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + rfid + "&rfidLoc=" + rfidLoc + "&robotIndex=" + robotIndex;
string url = GetAddr(api, paramMap);
LogUtil.debug("http :URL:" + url);
string json = HttpHelper.Post(url, "", 10000);
if (barcode != "")
{
LogUtil.info("http :URL:" + url + " :Response:" + json + " 耗时[" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "]");
}
else
{
LogUtil.debug("http :URL:" + url + " :Response:" + json);
}
if (string.IsNullOrWhiteSpace(json)) return task;
//行 2234: [2021 - 04 - 07 15:09:31,412][9]INFO - http :URL:
//http://192.168.100.14/myproject/rest/api/qisda/device/putShelfFinished?barcode=640253A*34005600000309*QG00006*5000*23C4&rfid=F103&rfidLoc=8&robotIndex=1 :
//Response:{"code":0,"msg":"ok","data":{"smallTask":"0","cutPackageTask":"0","packageTask":"0","bigTask":"0","smallEmpty":"0","bigEmpty":"5","packageEmpty":"0","rfid":"F103","usedRfidList":"F106,F105,F103","barcode":"640253A*34005600000309*QG00006*5000*23C4","cutTask":"0"}} 耗时[00:00:00.1]
JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> obj = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (!obj.TryGetValue("code", out object value)) return task;
if (value.ToString() != "0")
{
if (obj.TryGetValue("msg", out value))
LogUtil.error("http" + api + ": " + value.ToString());
return task;
}
if (!obj.TryGetValue("data", out value)) return task;
Dictionary<string, object> dict = (Dictionary<string, object>)value;
if (dict == null)
{
LogUtil.info("http" + api + ": data=null");
return task; return task;
} // DateTime startTime = DateTime.Now;
// try
// {
// string api = Addr_ShelfFinish;
// Dictionary<string, string> paramMap = new Dictionary<string, string>();
// paramMap.Add("barcode", barcode);
// paramMap.Add("rfid", rfid);
// paramMap.Add("rfidLoc", rfidLoc);
// paramMap.Add("robotIndex", robotIndex);
// //string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + rfid + "&rfidLoc=" + rfidLoc + "&robotIndex=" + robotIndex;
// string url = GetAddr(api, paramMap);
// LogUtil.debug("http :URL:" + url);
// string json = HttpHelper.Post(url, "", 10000);
// if (barcode != "")
// {
// LogUtil.info("http :URL:" + url + " :Response:" + json + " 耗时[" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "]");
// }
// else
// {
// LogUtil.debug("http :URL:" + url + " :Response:" + json);
// }
// if (string.IsNullOrWhiteSpace(json)) return task;
// //行 2234: [2021 - 04 - 07 15:09:31,412][9]INFO - http :URL:
// //http://192.168.100.14/myproject/rest/api/qisda/device/putShelfFinished?barcode=640253A*34005600000309*QG00006*5000*23C4&rfid=F103&rfidLoc=8&robotIndex=1 :
// //Response:{"code":0,"msg":"ok","data":{"smallTask":"0","cutPackageTask":"0","packageTask":"0","bigTask":"0","smallEmpty":"0","bigEmpty":"5","packageEmpty":"0","rfid":"F103","usedRfidList":"F106,F105,F103","barcode":"640253A*34005600000309*QG00006*5000*23C4","cutTask":"0"}} 耗时[00:00:00.1]
// JavaScriptSerializer serializer = new JavaScriptSerializer();
// Dictionary<string, object> obj = (Dictionary<string, object>)serializer.DeserializeObject(json);
// if (!obj.TryGetValue("code", out object value)) return task;
// if (value.ToString() != "0")
// {
// if (obj.TryGetValue("msg", out value))
// LogUtil.error("http" + api + ": " + value.ToString());
// return task;
// }
// if (!obj.TryGetValue("data", out value)) return task;
// Dictionary<string, object> dict = (Dictionary<string, object>)value;
// if (dict == null)
// {
// LogUtil.info("http" + api + ": data=null");
// return task;
// }
if (dict.TryGetValue("bigEmpty", out value)) // if (dict.TryGetValue("bigEmpty", out value))
int.TryParse(value.ToString(), out task.bigEmpty); // int.TryParse(value.ToString(), out task.bigEmpty);
if (dict.TryGetValue("smallEmpty", out value)) // if (dict.TryGetValue("smallEmpty", out value))
int.TryParse(value.ToString(), out task.smallEmpty); // int.TryParse(value.ToString(), out task.smallEmpty);
if (dict.TryGetValue("usedRfidList", out value)) // if (dict.TryGetValue("usedRfidList", out value))
task.usedRfidList = value.ToString(); // task.usedRfidList = value.ToString();
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
LogUtil.error("http error : " + ex.ToString()); // LogUtil.error("http error : " + ex.ToString());
} // }
return task; // return task;
} }
} }
public class ShelfTaskInfo public class ShelfTaskInfo
......
...@@ -1185,9 +1185,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -1185,9 +1185,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
IS14_ReelOK, IS14_ReelOK,
/// <summary> /// <summary>
/// 料串出库:如果当前位置<=P1,缓慢上升判断料串是否满,若已经满了,直接离开. /// 如果放料结束检测到料盘信号亮,需要等1500再次判断,防止误判断
/// </summary> /// </summary>
IS15_AxisUpMove, IS15_CheckShelfNeedLeave,
///// <summary>
///// 料串出库:如果当前位置<=P1,缓慢上升判断料串是否满,若已经满了,直接离开.
///// </summary>
//IS15_AxisUpMove,
/// <summary> /// <summary>
......
...@@ -566,6 +566,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -566,6 +566,10 @@ namespace OnlineStore.DeviceLibrary
{ {
} }
else if (MoveInfo.IsStep(StepEnum.IS15_CheckShelfNeedLeave))
{
CheckShelfIsFull();
}
#region 送料串离开 #region 送料串离开
...@@ -651,8 +655,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -651,8 +655,19 @@ namespace OnlineStore.DeviceLibrary
{ {
if (Robot.IOValue(Config.IO_ReelCheck).Equals(IO_VALUE.HIGH)) if (Robot.IOValue(Config.IO_ReelCheck).Equals(IO_VALUE.HIGH))
{ {
//IS14_ReelOK
//如果是刚刚放料结束的判断,需要等1500再次判断
if (MoveInfo.IsStep(StepEnum.IS14_ReelOK))
{
MoveInfo.NextMoveStep(StepEnum.IS15_CheckShelfNeedLeave);
WorkLog($"出库{MoveInfo.SLog} 放料完成,检测到料串出满需离开(信号到位),等待1500后再次判断");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
else
{
SendOutShelfLeave("料串出满需离开(信号到位)"); SendOutShelfLeave("料串出满需离开(信号到位)");
} }
}
else if (MoveInfo.IsStep(StepEnum.IB07_AxisUpMove)) else if (MoveInfo.IsStep(StepEnum.IB07_AxisUpMove))
{ {
SendOutShelfLeave("料串出满需离开"); SendOutShelfLeave("料串出满需离开");
......
using Asa; using Asa;
using HuichuanLibrary;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
...@@ -260,6 +261,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -260,6 +261,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StepEnum.IR04_MiddleToP1)) else if (MoveInfo.IsStep(StepEnum.IR04_MiddleToP1))
{ {
//旋转轴到达P1结束,设置反向补偿间隙
HCBoardManager.SetAxBacklash(MiddleAxis.Config.GetAxisValue(), Config.MiddleAxis_Reverse_Offset, MiddleAxis.Config.HomeLowSpeed, -1);
LogInfo($"复位{MoveInfo.SLog}:旋转轴回待机点P1完成,设置反向补偿:axisNo【{MiddleAxis.Config.GetAxisValue() }】补偿值【{Config.MiddleAxis_Reverse_Offset}】速度【{MiddleAxis.Config.HomeLowSpeed}】");
if (UpdownAxis.IsNeedHome) if (UpdownAxis.IsNeedHome)
{ {
MoveInfo.NextMoveStep(StepEnum.IR05_UpdownHome); MoveInfo.NextMoveStep(StepEnum.IR05_UpdownHome);
......
...@@ -339,6 +339,14 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -339,6 +339,14 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("Middle_P8_Speed")] [ConfigProAttribute("Middle_P8_Speed")]
public int Middle_P8_Speed { get; set; } public int Middle_P8_Speed { get; set; }
/// <summary>
/// PRO,0,取料旋转轴_反向间隙补偿值,MiddleAxis_Reverse_Offset,300,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("MiddleAxis_Reverse_Offset")]
public int MiddleAxis_Reverse_Offset { get; set; }
private List<string> CameraList = null; private List<string> CameraList = null;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<add key="App_AutoRun" value="0" /> <add key="App_AutoRun" value="0" />
<add key="App_Title" value="智能存储仓客户端" /> <add key="App_Title" value="智能存储仓客户端" />
<!--Server address--> <!--Server address-->
<add key="http.server" value="http://192.168.100.14/myproject/" /> <add key="http.server" value="http://192.168.1.123:8800/" />
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)--> <!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="4" /> <add key="StartBlowValue" value="4" />
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)--> <!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
......
...@@ -18,3 +18,9 @@ AA:第3和第4位存储机构A面或B面,AA或者BB ...@@ -18,3 +18,9 @@ AA:第3和第4位存储机构A面或B面,AA或者BB
点击复位按钮自动启动。 点击复位按钮自动启动。
20211208
旋转轴增加反向间隙补偿功能,
Config_InputEquip.csv 配置文件需要增加一行配置:
PRO,0,取料旋转轴_反向间隙补偿值,MiddleAxis_Reverse_Offset,300,,,,,,,,,,,,
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!