Commit aca05b44 几米阳光

批量上料轴极限信号改为IODI27。

批量上下料功能修改。
1 个父辈 17d8ddf4
此文件类型无法预览
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(576, 11); this.groupBox1.Location = new System.Drawing.Point(576, 11);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(437, 573); this.groupBox1.Size = new System.Drawing.Size(437, 617);
this.groupBox1.TabIndex = 105; this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入"; this.groupBox1.Text = "DO写入";
...@@ -493,7 +493,7 @@ ...@@ -493,7 +493,7 @@
// button1 // button1
// //
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(830, 590); this.button1.Location = new System.Drawing.Point(830, 634);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(115, 34); this.button1.Size = new System.Drawing.Size(115, 34);
this.button1.TabIndex = 254; this.button1.TabIndex = 254;
...@@ -508,7 +508,7 @@ ...@@ -508,7 +508,7 @@
this.chbAutoRead.Checked = true; this.chbAutoRead.Checked = true;
this.chbAutoRead.CheckState = System.Windows.Forms.CheckState.Checked; this.chbAutoRead.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAutoRead.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbAutoRead.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRead.Location = new System.Drawing.Point(706, 595); this.chbAutoRead.Location = new System.Drawing.Point(706, 639);
this.chbAutoRead.Name = "chbAutoRead"; this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(75, 21); this.chbAutoRead.Size = new System.Drawing.Size(75, 21);
this.chbAutoRead.TabIndex = 244; this.chbAutoRead.TabIndex = 244;
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
this.groupBox4.Controls.Add(this.tableLayoutPanel2); this.groupBox4.Controls.Add(this.tableLayoutPanel2);
this.groupBox4.Location = new System.Drawing.Point(293, 8); this.groupBox4.Location = new System.Drawing.Point(293, 8);
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(273, 621); this.groupBox4.Size = new System.Drawing.Size(273, 665);
this.groupBox4.TabIndex = 104; this.groupBox4.TabIndex = 104;
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
this.groupBox4.Text = "DO列表"; this.groupBox4.Text = "DO列表";
...@@ -539,7 +539,7 @@ ...@@ -539,7 +539,7 @@
this.tableLayoutPanel2.RowCount = 2; this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(262, 601); this.tableLayoutPanel2.Size = new System.Drawing.Size(262, 645);
this.tableLayoutPanel2.TabIndex = 103; this.tableLayoutPanel2.TabIndex = 103;
// //
// groupBox3 // groupBox3
...@@ -549,7 +549,7 @@ ...@@ -549,7 +549,7 @@
this.groupBox3.Controls.Add(this.tableLayoutPanel1); this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(12, 8); this.groupBox3.Location = new System.Drawing.Point(12, 8);
this.groupBox3.Name = "groupBox3"; this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(273, 621); this.groupBox3.Size = new System.Drawing.Size(273, 665);
this.groupBox3.TabIndex = 103; this.groupBox3.TabIndex = 103;
this.groupBox3.TabStop = false; this.groupBox3.TabStop = false;
this.groupBox3.Text = "DI列表"; this.groupBox3.Text = "DI列表";
...@@ -566,14 +566,14 @@ ...@@ -566,14 +566,14 @@
this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(262, 601); this.tableLayoutPanel1.Size = new System.Drawing.Size(262, 645);
this.tableLayoutPanel1.TabIndex = 102; this.tableLayoutPanel1.TabIndex = 102;
// //
// FrmIOStatus // FrmIOStatus
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1036, 639); this.ClientSize = new System.Drawing.Size(1036, 683);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox4);
......
...@@ -240,7 +240,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -240,7 +240,7 @@ namespace OnlineStore.AutoInOutStore
{ {
cmbJianGe.Items.Add(i.ToString()); cmbJianGe.Items.Add(i.ToString());
} }
cmbJianGe.SelectedIndex = 0; cmbJianGe.SelectedIndex = 1;
DebugStatus(false); DebugStatus(false);
} }
...@@ -1710,7 +1710,6 @@ namespace OnlineStore.AutoInOutStore ...@@ -1710,7 +1710,6 @@ namespace OnlineStore.AutoInOutStore
DialogResult res = MessageBox.Show("确定开始自动出入库?", "提示", MessageBoxButtons.YesNo); DialogResult res = MessageBox.Show("确定开始自动出入库?", "提示", MessageBoxButtons.YesNo);
if (res.Equals(DialogResult.Yes)) if (res.Equals(DialogResult.Yes))
{ {
store.autoNext = true;
int jiange = cmbJianGe.SelectedIndex; int jiange = cmbJianGe.SelectedIndex;
store.autoJiange = jiange; store.autoJiange = jiange;
if (cmbPosition.SelectedIndex >= 0) if (cmbPosition.SelectedIndex >= 0)
...@@ -1724,7 +1723,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -1724,7 +1723,8 @@ namespace OnlineStore.AutoInOutStore
store.autoMsg = "自动入库:" + poText; store.autoMsg = "自动入库:" + poText;
string msg = AutomaticBaiting.doStartBatchIn(); string msg = AutomaticBaiting.doStartBatchIn();
if (msg.Equals("")) if (msg.Equals(""))
{ {
store.autoNext = true;
btnStart.Text = StopAuto; btnStart.Text = StopAuto;
LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!"); LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
} }
......
...@@ -155,7 +155,8 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,, ...@@ -155,7 +155,8 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
20190505 20190505
温湿度报警功能修改:报警时在界面显示提示。 温湿度报警功能修改:报警时在界面显示提示。
批量上料轴极限信号改为IODI27。
批量上下料功能修改。
......
...@@ -81,8 +81,12 @@ namespace OnlineStore.Common ...@@ -81,8 +81,12 @@ namespace OnlineStore.Common
return null; return null;
} }
public static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open); public static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public static string Post(string url, string paramData, Encoding encoding) public static string Post(string url, string paramData="", Encoding encoding=null)
{ {
if (encoding == null)
{
encoding = Encoding.UTF8;
}
if (isLog == 1) if (isLog == 1)
{ {
LOGGER.Info("给服务器发送数据【" + paramData + "】 "); LOGGER.Info("给服务器发送数据【" + paramData + "】 ");
......
...@@ -192,7 +192,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -192,7 +192,10 @@ namespace OnlineStore.DeviceLibrary
} }
public static void SuddenStop(ConfigMoveAxis axis) public static void SuddenStop(ConfigMoveAxis axis)
{ {
SuddenStop(axis.DeviceName, axis.GetAxisValue()); if (GetBusyStatus(axis.DeviceName, axis.GetAxisValue()).Equals(1))
{
SuddenStop(axis.DeviceName, axis.GetAxisValue());
}
} }
public static void SuddenStop(string portName, int slvAddr) public static void SuddenStop(string portName, int slvAddr)
{ {
......
...@@ -47,18 +47,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -47,18 +47,18 @@ namespace OnlineStore.DeviceLibrary
IsInProcess = true; IsInProcess = true;
bool result = false; bool result = false;
if (IOManager.IOValue(TargetIoType).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(TargetIoType).Equals(IO_VALUE.HIGH))
{ {
LogUtil.info("批量上料轴,检测到【" + TargetIoType + "】信号,可以停止运动"); LogUtil.info("批量上料轴,检测到【" + TargetIoType + "】信号,可以停止运动");
result = true; result = true;
} }
TimeSpan span = DateTime.Now - preTime; //TimeSpan span = DateTime.Now - preTime;
if (span.TotalMilliseconds > 100) //if (span.TotalMilliseconds > 100)
//{
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
//if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
{ {
if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1)) LogUtil.info("批量上料轴,检测到正极限信号,可以停止运动");
{ result = true;
LogUtil.info("批量上料轴,检测到正极限信号,可以停止运动");
result = true;
}
} }
if (result) if (result)
{ {
......
...@@ -37,7 +37,7 @@ DI,吸盘压力确认信号,SuckingDisc_Air,2,192.168.200.12,0,吸盘压力确认信号,X23,DI-2 ...@@ -37,7 +37,7 @@ DI,吸盘压力确认信号,SuckingDisc_Air,2,192.168.200.12,0,吸盘压力确认信号,X23,DI-2
DI,左侧门关闭,DoorColse_Single,3,192.168.200.12,0,左侧门关闭,X24,DI-24,0, DI,左侧门关闭,DoorColse_Single,3,192.168.200.12,0,左侧门关闭,X24,DI-24,0,
DI,门锁气缸打开端2,BatchDoor_Open2,4,192.168.200.12,0,门锁气缸打开端2,X25,DI-25,0, DI,门锁气缸打开端2,BatchDoor_Open2,4,192.168.200.12,0,门锁气缸打开端2,X25,DI-25,0,
DI,门锁气缸关闭端2,BatchDoor_Close2,5,192.168.200.12,0,门锁气缸关闭端2,X26,DI-26,0, DI,门锁气缸关闭端2,BatchDoor_Close2,5,192.168.200.12,0,门锁气缸关闭端2,X26,DI-26,0,
,,,6,192.168.200.12,0,,X27,DI-27,0, DI,批量轴极限信号,BatchAxis_Limit,6,192.168.200.12,0,批量轴极限信号,X27,DI-27,0,
,,,7,192.168.200.12,0,,X28,DI-28,0, ,,,7,192.168.200.12,0,,X28,DI-28,0,
,,,16,192.168.200.12,0,,Y21,DO-21,0, ,,,16,192.168.200.12,0,,Y21,DO-21,0,
,,,17,192.168.200.12,0,,Y22,DO-22,0, ,,,17,192.168.200.12,0,,Y22,DO-22,0,
......
...@@ -1138,6 +1138,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1138,6 +1138,14 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
preProTime = DateTime.Now; preProTime = DateTime.Now;
if (!AutomaticBaiting.CanOpenBatchDoor())
{
return;
}
if (!CanStarInOut())
{
return;
}
if (CurrInOutACount >= this.Config.Box_ResetACount) if (CurrInOutACount >= this.Config.Box_ResetACount)
{ {
if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore) if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore)
...@@ -1150,18 +1158,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -1150,18 +1158,18 @@ namespace OnlineStore.DeviceLibrary
Reset(); Reset();
} }
} }
else if (CurrInOutCount >= this.Config.Box_ResetMCount) //else if (CurrInOutCount >= this.Config.Box_ResetMCount)
{ //{
if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore) // if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore)
{ // {
LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴"); // LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴");
} // }
else // else
{ // {
LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴"); // LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴");
} // }
} //}
else else if (waitOutStoreList.Count > 0 && CanStarInOut())
{ {
FixtureCodeInfo currInOutFixture = null; FixtureCodeInfo currInOutFixture = null;
lock (waitOutListLock) lock (waitOutListLock)
...@@ -1172,19 +1180,53 @@ namespace OnlineStore.DeviceLibrary ...@@ -1172,19 +1180,53 @@ namespace OnlineStore.DeviceLibrary
waitOutStoreList.RemoveAt(0); waitOutStoreList.RemoveAt(0);
} }
} }
if (currInOutFixture != null) if (currInOutFixture != null && currInOutFixture.WareNum.Equals(""))
{ //出库 { //出库
if (currInOutFixture.WareNum.Equals("")) LogUtil.info(LOGGER, StoreName + "开始执行排队中的出库【" + currInOutFixture.ToStr() + "】");
bool result = StartOutStoreMove(new InOutStoreParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW), currInOutFixture.BatchInOut);
if (!result)
{ {
LogUtil.info(LOGGER, StoreName + "开始执行排队中的出库【" + currInOutFixture.ToStr() + "】"); LogUtil.info(LOGGER, StoreName + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列");
bool result = StartOutStoreMove(new InOutStoreParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW), currInOutFixture.BatchInOut); AddWaitOutInfo(currInOutFixture);
if (!result) }
}
}
else if (autoNext && CanStarInOut() )
{
//获取出库的库位号
string readId = "";
//http://[SMD-BOX-IP]:[SMD-BOX-Port]/rest/api/v2/mes/inventory
string result = HttpHelper.Post(StoreManager.GetAPI("", StoreManager.api_inventory));
if (!String.IsNullOrEmpty(result))
{
string[] rArray = result.Split('}');
foreach (string obj in rArray)
{
string[] objArray = obj.Split(',');
if (objArray.Length >= 4)
{ {
LogUtil.info(LOGGER, StoreName + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列"); string rId = objArray[1];
AddWaitOutInfo(currInOutFixture); if (rId.Length > 7)
{
readId = rId.Substring(6, rId.Length - 7);
LogUtil.info("自动出入库:查找到:RI: " + readId );
break;
}
} }
} }
} }
if (readId.Equals(""))
{
//开始自动入库
string msg = AutomaticBaiting.doStartBatchIn();
LogUtil.info("自动出入库:库位号【" + GetAutoPosid(false) + "】,开始入库" + msg);
}
else
{
autoMsg = "自动出库:RI:" + readId;
result = HttpHelper.Post(StoreManager.GetAPI("", StoreManager.api_stackOut)+ "?RIS=" + readId);
LogUtil.info("自动出入库:自动出库:RI: " + readId + " ," + result);
}
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -1264,11 +1306,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -1264,11 +1306,11 @@ namespace OnlineStore.DeviceLibrary
return isInAlarm; return isInAlarm;
} }
public void AxisSuddenStop() public void AxisSuddenStop()
{ {
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.Middle_Axis);
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.UpDown_Axis);
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.InOut_Axis);
ACServerManager.SuddenStop(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.Batch_Axis);
} }
public override void StopMove(bool IsCloseAxis) public override void StopMove(bool IsCloseAxis)
{ {
...@@ -1796,10 +1838,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -1796,10 +1838,10 @@ namespace OnlineStore.DeviceLibrary
bool result = StartOutStoreMove(new InOutStoreParam("", posId, plateH, plateW), !isSingleOut); bool result = StartOutStoreMove(new InOutStoreParam("", posId, plateH, plateW), !isSingleOut);
if (!result) if (!result)
{ {
LogUtil.info(LOGGER, StoreName + " 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列"); LogUtil.info(LOGGER, StoreName + " 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列");
AddWaitOutInfo(currInOutFixture); AddWaitOutInfo(currInOutFixture);
} }
if(autoNext) autoMsg = "自动出库:" + posId;
} }
else else
{ {
......
...@@ -998,6 +998,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -998,6 +998,29 @@ namespace OnlineStore.DeviceLibrary
} }
#region 自动出入库循环代码 #region 自动出入库循环代码
public string GetAutoPosid(bool isNext)
{
string posid = "";
if (autoNext)
{
if (PositionNumList.Count > autoPositionIndex)
{
posid = PositionNumList[autoPositionIndex];
autoMsg = "自动入库:" +posid;
//到下一个库位
if (isNext)
{
int newIndex = autoPositionIndex - autoJiange;
if (newIndex < 0)
{
newIndex = AutoStartIndex;
}
autoPositionIndex = newIndex;
}
}
}
return posid;
}
private void InOutEndProcess(StoreMoveType storeMoveType) private void InOutEndProcess(StoreMoveType storeMoveType)
{ {
try try
...@@ -1005,38 +1028,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -1005,38 +1028,38 @@ namespace OnlineStore.DeviceLibrary
CurrInOutCount++; CurrInOutCount++;
CurrInOutACount++; CurrInOutACount++;
//是否自动进入出库状态 //是否自动进入出库状态
if (!autoNext) //if (!autoNext)
{ //{
return; // return;
} //}
if (storeMoveType.Equals(StoreMoveType.InStore)) //if (storeMoveType.Equals(StoreMoveType.InStore))
{ //{
string posid = PositionNumList[autoPositionIndex]; // string posid = PositionNumList[autoPositionIndex];
autoMsg = "自动出库:" + posid; // autoMsg = "自动出库:" + posid;
//自动出入口,入库结束把出库加入队列 // //自动出入口,入库结束把出库加入队列
FixtureCodeInfo currInOutFixture = new FixtureCodeInfo(0, "", posid); // FixtureCodeInfo currInOutFixture = new FixtureCodeInfo(0, "", posid);
AddWaitOutInfo(currInOutFixture); // AddWaitOutInfo(currInOutFixture);
LogUtil.info("自动出入口,入库结束,将库位号【"+ posid + "】加入出库等待中"); // LogUtil.info("自动出入口,入库结束,将库位号【"+ posid + "】加入出库等待中");
} //}
else if (storeMoveType.Equals(StoreMoveType.OutStore)) //else if (storeMoveType.Equals(StoreMoveType.OutStore))
{ //{
int newIndex = autoPositionIndex - autoJiange; // int newIndex = autoPositionIndex - autoJiange;
if (newIndex < 0) // if (newIndex < 0)
{ // {
newIndex = AutoStartIndex; // newIndex = AutoStartIndex;
} // }
else // else
{ // {
autoPositionIndex = newIndex; // autoPositionIndex = newIndex;
string posid = PositionNumList[newIndex]; // string posid = PositionNumList[newIndex];
ConfigAppSettings.SaveValue(Setting_Init.DebugPosId, posid); // ConfigAppSettings.SaveValue(Setting_Init.DebugPosId, posid);
//开始自动入库 // //开始自动入库
autoMsg = "自动入库:" + posid; // autoMsg = "自动入库:" + posid;
string msg = AutomaticBaiting.doStartBatchIn(); // string msg = AutomaticBaiting.doStartBatchIn();
LogUtil.info("自动出入库:库位号【"+posid+"】,开始入库"+msg); // LogUtil.info("自动出入库:库位号【"+posid+"】,开始入库"+msg);
} // }
} //}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -667,8 +667,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -667,8 +667,8 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O03_SpeedMove)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O03_SpeedMove))
{ {
//先判断极限是否亮 //先判断极限是否亮
int value = ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis); //int value = ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis);
if (value.Equals(1)) if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_O05_BackToP2); StoreMove.NextMoveStep(StoreMoveStep.AUTO_O05_BackToP2);
LogUtil.info(Name + "出料:上料轴移动到p2点【" + StoreManager.Config.BatchAxis_P2 + "】"); LogUtil.info(Name + "出料:上料轴移动到p2点【" + StoreManager.Config.BatchAxis_P2 + "】");
......
...@@ -232,7 +232,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,7 +232,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(wait.ToStr() + " 检测到【" + wait.IoType + "】信号,可以停止运动"); LogUtil.info(wait.ToStr() + " 检测到【" + wait.IoType + "】信号,可以停止运动");
result = true; result = true;
} }
else if (ACServerManager.GetLimitPositiveSingle(wait.AxisInfo).Equals(1)) else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
//else if (ACServerManager.GetLimitPositiveSingle(wait.AxisInfo).Equals(1))
{ {
LogUtil.info(wait.ToStr() + " 检测到正极限信号,可以停止运动"); LogUtil.info(wait.ToStr() + " 检测到正极限信号,可以停止运动");
ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
...@@ -275,7 +276,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -275,7 +276,7 @@ namespace OnlineStore.DeviceLibrary
} }
LastCodeList = hasList; LastCodeList = hasList;
LastCode = message; LastCode = message;
if (LastCode.Equals("") && (StoreManager.Store.IsDebug || StoreManager.Store.autoNext)) if (LastCode.Equals("") && (StoreManager.Store.IsDebug ))
{ {
LastCode = "NoCode"; LastCode = "NoCode";
LogUtil.info(Name + "模拟二维码:NoCode"); LogUtil.info(Name + "模拟二维码:NoCode");
...@@ -331,8 +332,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -331,8 +332,9 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
if (StoreManager.Store.IsDebug || StoreManager.Store.autoNext) //if (StoreManager.Store.IsDebug || StoreManager.Store.autoNext)
{ if (StoreManager.Store.IsDebug )
{
string posId = ConfigAppSettings.GetValue(Setting_Init.DebugPosId); string posId = ConfigAppSettings.GetValue(Setting_Init.DebugPosId);
if (!posId.Equals("")) if (!posId.Equals(""))
{ {
...@@ -380,6 +382,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -380,6 +382,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "收到二维码【 " + message + "】,发送给服务器获取入库PosID"); LogUtil.info(Name + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
//发送扫码内容到服务器进行入库操作 //发送扫码内容到服务器进行入库操作
Operation operation = StoreManager.Store.getLineBoxStatus(); Operation operation = StoreManager.Store.getLineBoxStatus();
operation.op = 1; operation.op = 1;
if (operation.data == null) if (operation.data == null)
{ {
...@@ -387,13 +390,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -387,13 +390,15 @@ namespace OnlineStore.DeviceLibrary
} }
operation.data.Add("code", message); operation.data.Add("code", message);
operation.data.Add("boxId", StoreManager.Store.StoreID.ToString()); operation.data.Add("boxId", StoreManager.Store.StoreID.ToString());
string autoposId = StoreManager.Store.GetAutoPosid(true);
//{ { "code", message }, { "boxId", StoreManager.Store.StoreID.ToString() } }; if (StoreManager.Store.autoNext && (!String.IsNullOrEmpty(autoposId)))
{
operation.data.Add(ParamDefine.posId, autoposId);
LogUtil.info("添加自动入库库位号:"+autoposId);
}
string server = ConfigAppSettings.GetValue(Setting_Init.http_server); string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false); Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
//HttpHelper.isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
if (resultOperation == null) if (resultOperation == null)
{ {
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈"; // CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
...@@ -403,7 +408,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -403,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
else if (!string.IsNullOrEmpty(resultOperation.msg)) else if (!string.IsNullOrEmpty(resultOperation.msg))
{ {
//如果有提示消息,直接显示提示 //如果有提示消息,直接显示提示
LogUtil.info(Name + "服务器反馈 二维码【" + message + "】 :" + resultOperation.msg); LogUtil.info(Name + "服务器反馈 二维码【" + message + "】【"+ autoposId + "】 :" + resultOperation.msg);
return; return;
} }
Dictionary<string, string> data = resultOperation.data; Dictionary<string, string> data = resultOperation.data;
...@@ -423,8 +428,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -423,8 +428,7 @@ namespace OnlineStore.DeviceLibrary
if (!(posArray.Length == 2)) if (!(posArray.Length == 2))
{ {
WarnMsg = Name + ResourceControl.GetString(ResourceControl.InStoreError, "入库库位格式错误:") + "【" + message + "】【" + posId + "】"; WarnMsg = Name + ResourceControl.GetString(ResourceControl.InStoreError, "入库库位格式错误:") + "【" + message + "】【" + posId + "】";
LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return; return;
} }
......
...@@ -23,6 +23,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,6 +23,11 @@ namespace OnlineStore.DeviceLibrary
private static string api_communication = "service/store/communication"; //流水线状态通信接口 private static string api_communication = "service/store/communication"; //流水线状态通信接口
private static string api_nextFeeder = "service/store/nextFeeder"; // 出库站位列表切换接口 private static string api_nextFeeder = "service/store/nextFeeder"; // 出库站位列表切换接口
public static string api_inventory = "rest/api/v2/mes/inventory";//获取单个或全总SMD-BOX 中的实时库存信息
public static string api_stackOut = "rest/api/v2/mes/stackOut";//本接⼜提供物料出库功能,可⼀次性出单/多盘物料
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static AC_SA_BoxBean Store = null; public static AC_SA_BoxBean Store = null;
public static AUTO_SA_Config Config = null; public static AUTO_SA_Config Config = null;
...@@ -144,22 +149,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -144,22 +149,18 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public static string GetPostApi(string host) public static string GetPostApi(string host)
{ {
if (host == "") host = GetHostUrl(host);
{
host = ConfigAppSettings.GetValue(Setting_Init.http_server);
}
if (!host.StartsWith("http://"))
{
host = "http://" + host;
}
if (!host.EndsWith("/"))
{
host = host + "/";
}
return host + api_communication; return host + api_communication;
} }
public static string GetNextFeederApi(string host)
public static string GetAPI(string host, string api)
{
host = GetHostUrl(host);
return host + api;
}
private static string GetHostUrl(string host)
{ {
if (host == "") if (host == "")
{ {
...@@ -173,7 +174,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -173,7 +174,7 @@ namespace OnlineStore.DeviceLibrary
{ {
host = host + "/"; host = host + "/";
} }
return host + api_nextFeeder; return host;
} }
} }
} }
...@@ -199,5 +199,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -199,5 +199,11 @@ namespace OnlineStore.LoadCSVLibrary
/// 报警蜂鸣器 Buzzer_Sign Y16 /// 报警蜂鸣器 Buzzer_Sign Y16
/// </summary> /// </summary>
public static string Buzzer_Sign = "Buzzer_Sign"; public static string Buzzer_Sign = "Buzzer_Sign";
/// <summary>
/// DI 批量轴极限信号 BatchAxis_Limit
/// </summary>
public static string BatchAxis_Limit = "BatchAxis_Limit";
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!