Commit b16c6142 几米阳光

1

1 个父辈 0fdd68d1
...@@ -318,5 +318,25 @@ namespace OnlineStore.AutoInOutStore ...@@ -318,5 +318,25 @@ namespace OnlineStore.AutoInOutStore
{ {
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW); KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
} }
private void button3_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.HIGH);
}
private void button2_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.LOW);
}
private void button5_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.HIGH);
}
private void button4_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
} }
} }
...@@ -223,6 +223,10 @@ ...@@ -223,6 +223,10 @@
this.btnGetOutTray = new System.Windows.Forms.Button(); this.btnGetOutTray = new System.Windows.Forms.Button();
this.lblDoorStatus = new System.Windows.Forms.Label(); this.lblDoorStatus = new System.Windows.Forms.Label();
this.btnBatchInStore = new System.Windows.Forms.Button(); this.btnBatchInStore = new System.Windows.Forms.Button();
this.批量上下轴ONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.批量上下轴OFFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
this.groupBox5.SuspendLayout(); this.groupBox5.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
...@@ -1894,55 +1898,55 @@ ...@@ -1894,55 +1898,55 @@
// 启动ToolStripMenuItem // 启动ToolStripMenuItem
// //
this.启动ToolStripMenuItem.Name = "启动ToolStripMenuItem"; this.启动ToolStripMenuItem.Name = "启动ToolStripMenuItem";
this.启动ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.启动ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.启动ToolStripMenuItem.Text = "启动"; this.启动ToolStripMenuItem.Text = "启动";
this.启动ToolStripMenuItem.Click += new System.EventHandler(this.启动ToolStripMenuItem_Click); this.启动ToolStripMenuItem.Click += new System.EventHandler(this.启动ToolStripMenuItem_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6);
// //
// 停止ToolStripMenuItem // 停止ToolStripMenuItem
// //
this.停止ToolStripMenuItem.Name = "停止ToolStripMenuItem"; this.停止ToolStripMenuItem.Name = "停止ToolStripMenuItem";
this.停止ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.停止ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.停止ToolStripMenuItem.Text = "停止"; this.停止ToolStripMenuItem.Text = "停止";
this.停止ToolStripMenuItem.Click += new System.EventHandler(this.停止ToolStripMenuItem_Click); this.停止ToolStripMenuItem.Click += new System.EventHandler(this.停止ToolStripMenuItem_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6);
// //
// 复位ToolStripMenuItem // 复位ToolStripMenuItem
// //
this.复位ToolStripMenuItem.Name = "复位ToolStripMenuItem"; this.复位ToolStripMenuItem.Name = "复位ToolStripMenuItem";
this.复位ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.复位ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.复位ToolStripMenuItem.Text = "复位"; this.复位ToolStripMenuItem.Text = "复位";
this.复位ToolStripMenuItem.Click += new System.EventHandler(this.复位ToolStripMenuItem_Click); this.复位ToolStripMenuItem.Click += new System.EventHandler(this.复位ToolStripMenuItem_Click);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6);
// //
// 回待机点ToolStripMenuItem // 回待机点ToolStripMenuItem
// //
this.回待机点ToolStripMenuItem.Name = "回待机点ToolStripMenuItem"; this.回待机点ToolStripMenuItem.Name = "回待机点ToolStripMenuItem";
this.回待机点ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.回待机点ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.回待机点ToolStripMenuItem.Text = "回待机点"; this.回待机点ToolStripMenuItem.Text = "回待机点";
this.回待机点ToolStripMenuItem.Click += new System.EventHandler(this.回待机点ToolStripMenuItem_Click); this.回待机点ToolStripMenuItem.Click += new System.EventHandler(this.回待机点ToolStripMenuItem_Click);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6);
// //
// 退出ToolStripMenuItem // 退出ToolStripMenuItem
// //
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem"; this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.退出ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.退出ToolStripMenuItem.Text = "退出系统"; this.退出ToolStripMenuItem.Text = "退出系统";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click); this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
// //
...@@ -1956,8 +1960,12 @@ ...@@ -1956,8 +1960,12 @@
this.料仓运转OFFToolStripMenuItem, this.料仓运转OFFToolStripMenuItem,
this.toolStripSeparator7, this.toolStripSeparator7,
this.打开舱门ToolStripMenuItem, this.打开舱门ToolStripMenuItem,
this.toolStripSeparator14,
this.关闭仓门ToolStripMenuItem,
this.toolStripSeparator8, this.toolStripSeparator8,
this.关闭仓门ToolStripMenuItem}); this.批量上下轴ONToolStripMenuItem,
this.toolStripSeparator13,
this.批量上下轴OFFToolStripMenuItem});
this.iO状态查看ToolStripMenuItem.Name = "iO状态查看ToolStripMenuItem"; this.iO状态查看ToolStripMenuItem.Name = "iO状态查看ToolStripMenuItem";
this.iO状态查看ToolStripMenuItem.Size = new System.Drawing.Size(104, 25); this.iO状态查看ToolStripMenuItem.Size = new System.Drawing.Size(104, 25);
this.iO状态查看ToolStripMenuItem.Text = "IO状态查看"; this.iO状态查看ToolStripMenuItem.Text = "IO状态查看";
...@@ -2528,6 +2536,30 @@ ...@@ -2528,6 +2536,30 @@
this.btnBatchInStore.UseVisualStyleBackColor = true; this.btnBatchInStore.UseVisualStyleBackColor = true;
this.btnBatchInStore.Click += new System.EventHandler(this.btnBatchInStore_Click); this.btnBatchInStore.Click += new System.EventHandler(this.btnBatchInStore_Click);
// //
// 批量上下轴ONToolStripMenuItem
//
this.批量上下轴ONToolStripMenuItem.Name = "批量上下轴ONToolStripMenuItem";
this.批量上下轴ONToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.批量上下轴ONToolStripMenuItem.Text = "批量上下轴ON";
this.批量上下轴ONToolStripMenuItem.Click += new System.EventHandler(this.批量上下轴ONToolStripMenuItem_Click);
//
// 批量上下轴OFFToolStripMenuItem
//
this.批量上下轴OFFToolStripMenuItem.Name = "批量上下轴OFFToolStripMenuItem";
this.批量上下轴OFFToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.批量上下轴OFFToolStripMenuItem.Text = "批量上下轴OFF";
this.批量上下轴OFFToolStripMenuItem.Click += new System.EventHandler(this.批量上下轴OFFToolStripMenuItem_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(189, 6);
//
// toolStripSeparator14
//
this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(189, 6);
//
// FrmStoreBox // FrmStoreBox
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
...@@ -2773,6 +2805,10 @@ ...@@ -2773,6 +2805,10 @@
private System.Windows.Forms.Button btnReadLimit1; private System.Windows.Forms.Button btnReadLimit1;
private System.Windows.Forms.TextBox txtLimit1; private System.Windows.Forms.TextBox txtLimit1;
public System.Windows.Forms.Button btnUpdateStatus; public System.Windows.Forms.Button btnUpdateStatus;
private System.Windows.Forms.ToolStripMenuItem 批量上下轴ONToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 批量上下轴OFFToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
} }
} }
...@@ -1524,5 +1524,32 @@ namespace OnlineStore.AutoInOutStore ...@@ -1524,5 +1524,32 @@ namespace OnlineStore.AutoInOutStore
btnReadLimit1_Click(null, null); btnReadLimit1_Click(null, null);
btnReadLimit2_Click(null, null); btnReadLimit2_Click(null, null);
} }
private void 批量上下轴ONToolStripMenuItem_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.HIGH);
Thread.Sleep(1000);
string portName = store.Config.Batch_Axis.DeviceName;
int slvAddr = store.Config.Batch_Axis.GetAxisValue();
ACServerManager.OpenPort(portName);
Thread.Sleep(50);
ACServerManager.InitSlvAddr(portName, slvAddr, store.Config.Batch_Axis.TargetSpeed, store.Config.Batch_Axis.AddSpeed, store.Config.Batch_Axis.DelSpeed);
Thread.Sleep(100);
ACServerManager.AlarmClear(portName, slvAddr);
Thread.Sleep(50);
ACServerManager.ServoOn(portName, slvAddr);
}
private void 批量上下轴OFFToolStripMenuItem_Click(object sender, EventArgs e)
{
ACServerManager.ServoOff(store.Config.Batch_Axis.DeviceName, store.Config.Batch_Axis.GetAxisValue());
//关闭串口,等下次重新打开
ACServerManager.ColsePort(store.Config.Batch_Axis.DeviceName);
Thread.Sleep(100);
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.LOW);
}
} }
} }
...@@ -71,9 +71,6 @@ ...@@ -71,9 +71,6 @@
<Compile Include="store\LineAlarm.cs"> <Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="store\IOUtil.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShuoKe\ShuoKeControls.cs" /> <Compile Include="ShuoKe\ShuoKeControls.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" /> <Compile Include="store\model\AxisAlarmInfo.cs" />
......
...@@ -9,6 +9,7 @@ using System.Diagnostics; ...@@ -9,6 +9,7 @@ using System.Diagnostics;
using log4net; using log4net;
using System.Reflection; using System.Reflection;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
......
...@@ -42,7 +42,7 @@ DI,左侧门关闭,DoorColse_Single,203,192.168.200.11,0,左侧门关闭,X20,DI-24,0, ...@@ -42,7 +42,7 @@ DI,左侧门关闭,DoorColse_Single,203,192.168.200.11,0,左侧门关闭,X20,DI-24,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM4,0,,,,, AXIS,(轴一)旋转轴,Middle_Axis,1,COM4,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM5,0,,,,, AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM5,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM6,0,,,,, AXIS,(轴三)进出轴,InOut_Axis,1,COM6,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM7,0,,,,, AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM3,0,,,,,
,,,,,,,,,, ,,,,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,, PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
...@@ -114,7 +114,7 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,, ...@@ -114,7 +114,7 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,, PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,, PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM3,,,,,,, PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM2,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,, PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,, PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,, PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
......
...@@ -13,13 +13,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,13 +13,14 @@ namespace OnlineStore.DeviceLibrary
/// 0=未知。1=门打开,2=门关闭 /// 0=未知。1=门打开,2=门关闭
/// </summary> /// </summary>
public static int DoorStatus = 2; public static int DoorStatus = 2;
public static int LastHeight = 0; private static int LastHeight = 0;
public static int LastSize = 0; private static int LastSize = 0;
public static string LastCode = ""; private static string LastCode = "";
public static string LastPosId = ""; private static string LastPosId = "";
public static int AxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.AxisChangeValue); public static int AxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.AxisChangeValue);
public static string WarnMsg = ""; public static string WarnMsg = "";
public static string Name = "自动上下料"; public static string CodeMsg = "";
public static string Name = "批量上下料 ";
public static StoreMoveInfo StoreMove = null; public static StoreMoveInfo StoreMove = null;
public static StoreRunStatus AutoBaitingStatus = StoreRunStatus.Wait; public static StoreRunStatus AutoBaitingStatus = StoreRunStatus.Wait;
...@@ -90,7 +91,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.EndMove(); StoreMove.EndMove();
ClearInOutInfo(); ClearInOutInfo();
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW); KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down,false); CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false);
BatchDoorClose(false); BatchDoorClose(false);
} }
public static bool Reset() public static bool Reset()
...@@ -98,7 +99,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -98,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
string msg = CanStart(); string msg = CanStart();
if (!String.IsNullOrEmpty(msg)) if (!String.IsNullOrEmpty(msg))
{ {
LogUtil.info(Name+"复位失败:"+msg); LogUtil.info(Name + "复位失败:" + msg);
return false; return false;
} }
ClearInOutInfo(); ClearInOutInfo();
...@@ -129,7 +130,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
{ {
case StoreMoveStep.AUTO_R01_CloseDoor: case StoreMoveStep.AUTO_R01_CloseDoor:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome);
LogUtil.info(Name + "复位中:自动轴原点返回"); LogUtil.info(Name + "复位中:批量上下料轴原点返回");
ACAxisHomeMove(StoreManager.Config.Batch_Axis); ACAxisHomeMove(StoreManager.Config.Batch_Axis);
break; break;
case StoreMoveStep.AUTO_R02_AutoAxisHome: case StoreMoveStep.AUTO_R02_AutoAxisHome:
...@@ -166,7 +167,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -166,7 +167,7 @@ namespace OnlineStore.DeviceLibrary
public static bool StartInOut() public static bool StartInOut()
{ {
if((!StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Runing))|| if ((!StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Runing)) ||
(!StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.None))) (!StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.None)))
{ {
LogUtil.error(Name + " 启动入料失败,料仓不在待机状态" + StoreManager.Store.storeRunStatus + ",MoveType" + StoreManager.Store.StoreMove.MoveType); LogUtil.error(Name + " 启动入料失败,料仓不在待机状态" + StoreManager.Store.storeRunStatus + ",MoveType" + StoreManager.Store.StoreMove.MoveType);
...@@ -190,7 +191,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,7 +191,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.error(Name + " 启动入料失败, Status=" + AutoBaitingStatus+ ",MoveType="+ StoreMove.MoveType); LogUtil.error(Name + " 启动入料失败, Status=" + AutoBaitingStatus + ",MoveType=" + StoreMove.MoveType);
return false; return false;
} }
} }
...@@ -253,11 +254,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -253,11 +254,11 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I05_GetPosId); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I05_GetPosId);
//计算高度 //计算高度
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()); EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
int height = Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue; LastHeight = Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue;
int size = GetSize(); LastSize = GetSize();
LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + size + "*" + height + "】二维码【" + LastCode + "】"); LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastSize + "*" + LastHeight + "】二维码【" + LastCode + "】");
LastHeight = height;
LastSize = size; GetInStorePosId(ProcessMsg());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
StoreMove.OneWaitCanEndStep = true; StoreMove.OneWaitCanEndStep = true;
} }
...@@ -266,7 +267,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -266,7 +267,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//判断是否开始入库 //判断是否开始入库
if(StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.InStore)) if (StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.InStore))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_WaitTrayLeave); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_WaitTrayLeave);
LogUtil.info(Name + "入料: 开始入料,等待料盘拿走"); LogUtil.info(Name + "入料: 开始入料,等待料盘拿走");
...@@ -322,7 +323,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -322,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I03_SuckingDisc_Work); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I03_SuckingDisc_Work);
SuckingDisc_WorkCount++; SuckingDisc_WorkCount++;
LogUtil.info(Name + "入料: 吸盘开始第"+SuckingDisc_WorkCount+"次工作"); LogUtil.info(Name + "入料: 吸盘开始第" + SuckingDisc_WorkCount + "次工作");
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.HIGH); KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.HIGH);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Air, IO_VALUE.HIGH)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Air, IO_VALUE.HIGH));
...@@ -475,7 +476,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -475,7 +476,6 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public static void BatchDoorClose(bool isWait) public static void BatchDoorClose(bool isWait)
{ {
ClearInOutInfo(); ClearInOutInfo();
......
...@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, int targetSpeed) private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, int targetSpeed)
{ {
AutoAxisIsMove = 1; AutoAxisIsMove = 1;
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName,moveAxis.GetAxisValue()); StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
EndMovePosition = StartMovePosition; EndMovePosition = StartMovePosition;
StoreMove.WaitList.Add(WaitResultInfo.WaitAutoAxisStop(moveAxis)); StoreMove.WaitList.Add(WaitResultInfo.WaitAutoAxisStop(moveAxis));
ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed); ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed);
...@@ -56,7 +56,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -56,7 +56,7 @@ namespace OnlineStore.DeviceLibrary
//else //else
//{ //{
msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error( msg); LogUtil.error(msg);
return false; return false;
//} //}
} }
...@@ -213,7 +213,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -213,7 +213,8 @@ namespace OnlineStore.DeviceLibrary
if (wait.IsHomeMove) if (wait.IsHomeMove)
{ {
wait.IsEnd = ACHomeMoveIsEnd(wait.AxisInfo, out msg); wait.IsEnd = ACHomeMoveIsEnd(wait.AxisInfo, out msg);
}else }
else
{ {
wait.IsEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg); wait.IsEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
} }
...@@ -276,7 +277,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -276,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
#region Halcon扫码枪代码 #region Halcon扫码枪代码
public bool IsTestCamera = false; public bool IsTestCamera = false;
private static string spiltStr = "##"; private static char spiltStr = '#';
public static void GetCameraCode() public static void GetCameraCode()
{ {
Task.Factory.StartNew(delegate () Task.Factory.StartNew(delegate ()
...@@ -290,7 +291,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -290,7 +291,7 @@ namespace OnlineStore.DeviceLibrary
} }
foreach (string str in codeList) foreach (string str in codeList)
{ {
message = message + spiltStr + str ; message = message + spiltStr + str;
//message = message + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + str + spiltStr; //message = message + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + str + spiltStr;
} }
LastCode = message; LastCode = message;
...@@ -315,5 +316,118 @@ namespace OnlineStore.DeviceLibrary ...@@ -315,5 +316,118 @@ namespace OnlineStore.DeviceLibrary
KND.IOMove(lowType, IO_VALUE.LOW); KND.IOMove(lowType, IO_VALUE.LOW);
KND.IOMove(highType, IO_VALUE.HIGH); KND.IOMove(highType, IO_VALUE.HIGH);
} }
private static string ProcessMsg()
{
string msg = "";
string[] codeArray = LastCode.Split(spiltStr);
foreach (string code in codeArray)
{
if (!code.Equals(""))
{
msg = msg + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + code + spiltStr + spiltStr;
}
}
return msg;
}
private static bool IsNotScanCode = false;
private static bool IsScanCode = false;
/// <summary>
/// 发送二维码到服务器获取PosID
/// </summary>
private static void GetInStorePosId(string message)
{
try
{
message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message))
{
IsNotScanCode = true;
IsScanCode = false;
CodeMsg = "没有收到二维码信息,请重新放入料盘";
LogUtil.info(Name + "没有收到二维码信息,请重新放入料盘");
return;
}
IsNotScanCode = false;
if (StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(Name + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器");
IsScanCode = false;
return;
}
// CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil.info(Name + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
//发送扫码内容到服务器进行入库操作
Operation operation = StoreManager.Store.getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", StoreManager.Store.StoreID.ToString() } };
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(Name + "二维码【" + message + "】没有收到服务器反馈!");
IsScanCode = false;
return;
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(Name + "服务器反馈 二维码【" + message + "】 :" + resultOperation.msg);
IsScanCode = false;
return;
}
IsScanCode = false;
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.posId) && data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
{
//服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
//postId格式BoxId#位置
string posId = data[ParamDefine.posId];
string plateW = data[ParamDefine.plateW];
string plateH = data[ParamDefine.plateH];
string[] posArray = posId.Split('#');
if (!(posArray.Length == 2))
{
WarnMsg = Name + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return;
}
int storeId = int.Parse(posArray[0]);
//根据发送的posId获取位置列表
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
if (position == null)
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
LogUtil.error("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return;
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (StoreManager.Store.CanStarInOut())
{
LastPosId = posId;
IsScanCode = false;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
StoreManager.Store.StartInStoreMove(param, true);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
}
else
{
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
IsScanCode = false;
}
}
}
catch (Exception ex)
{
IsScanCode = false;
LogUtil.error(Name + ex.StackTrace);
}
}
} }
} }
...@@ -17,8 +17,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -17,8 +17,6 @@ namespace OnlineStore.DeviceLibrary
/// 高位 /// 高位
/// </summary> /// </summary>
HIGH = 1, HIGH = 1,
} }
} }
...@@ -130,19 +130,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -130,19 +130,6 @@ namespace OnlineStore.DeviceLibrary
WaitList = new List<WaitResultInfo>(); WaitList = new List<WaitResultInfo>();
CanWhileCount = 0; CanWhileCount = 0;
} }
//public StoreMoveInfo clone()
//{
// return (StoreMoveInfo)this.MemberwiseClone();
//}
///// <summary>
///// 重置之后继续出入库时,退回上一个步骤执行
///// </summary>
//public void BackStep()
//{
// moveStep = PreMoveStep;
// IsInWait = false;
//}
} }
public class WaitResultInfo public class WaitResultInfo
...@@ -227,6 +214,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -227,6 +214,12 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false; wait.IsEnd = false;
return wait; return wait;
} }
/// <summary>
/// 6=等待轴原点信号亮
/// </summary>
/// <param name="axis"></param>
/// <param name="value"></param>
/// <returns></returns>
public static WaitResultInfo WaitAxisOrg(ConfigMoveAxis axis,IO_VALUE value ) public static WaitResultInfo WaitAxisOrg(ConfigMoveAxis axis,IO_VALUE value )
{ {
WaitResultInfo wait = new WaitResultInfo(); WaitResultInfo wait = new WaitResultInfo();
...@@ -248,7 +241,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -248,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
// return wait; // return wait;
//} //}
/// <summary> /// <summary>
/// 等待轴的反限位为指定值 ///8= 等待轴的反限位为指定值
/// </summary> /// </summary>
public static WaitResultInfo WaitAxistNegativeLimit(ConfigMoveAxis moveAxis ,IO_VALUE ioValue) public static WaitResultInfo WaitAxistNegativeLimit(ConfigMoveAxis moveAxis ,IO_VALUE ioValue)
{ {
...@@ -262,7 +255,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -262,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
return wait; return wait;
} }
/// <summary> /// <summary>
/// 等待轴的正限位为指定值 ///9= 等待轴的正限位为指定值
/// </summary> /// </summary>
public static WaitResultInfo WaitAxistPositiveLimit(ConfigMoveAxis moveAxis, IO_VALUE ioValue) public static WaitResultInfo WaitAxistPositiveLimit(ConfigMoveAxis moveAxis, IO_VALUE ioValue)
{ {
...@@ -278,7 +271,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -278,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 等待上料轴运动 停止 /// 10=等待上料轴运动 停止
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static WaitResultInfo WaitAutoAxisStop(ConfigMoveAxis moveAxis) public static WaitResultInfo WaitAutoAxisStop(ConfigMoveAxis moveAxis)
...@@ -291,6 +284,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -291,6 +284,10 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false; wait.IsEnd = false;
return wait; return wait;
} }
/// <summary>
/// 11=扫码OK
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitCodeOK() public static WaitResultInfo WaitCodeOK()
{ {
WaitResultInfo wait = new WaitResultInfo(); WaitResultInfo wait = new WaitResultInfo();
......
...@@ -7,6 +7,18 @@ using System.Text; ...@@ -7,6 +7,18 @@ using System.Text;
namespace OnlineStore.LoadCSVLibrary namespace OnlineStore.LoadCSVLibrary
{ {
public enum IO_VALUE
{
/// <summary>
/// 低位
/// </summary>
LOW = 0,
/// <summary>
/// 高位
/// </summary>
HIGH = 1,
}
public class IO_Type public class IO_Type
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!