Commit b16c6142 几米阳光

1

1 个父辈 0fdd68d1
...@@ -130,7 +130,7 @@ namespace ACServoDriveTest ...@@ -130,7 +130,7 @@ namespace ACServoDriveTest
formStatus(false); formStatus(false);
} }
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
ACServerManager.IsShowMsg = true; ACServerManager.IsShowMsg = true;
LogUtil.logBox = this.richTextBox1; LogUtil.logBox = this.richTextBox1;
//ACServerManager.richeBox = this.richTextBox1; //ACServerManager.richeBox = this.richTextBox1;
......
...@@ -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,21 +13,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,21 +13,22 @@ 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 StoreMoveInfo StoreMove = null; public static string Name = "批量上下料 ";
public static StoreMoveInfo StoreMove = null;
public static StoreRunStatus AutoBaitingStatus = StoreRunStatus.Wait; public static StoreRunStatus AutoBaitingStatus = StoreRunStatus.Wait;
//记录没开门状态下,已经出库的数量 //记录没开门状态下,已经出库的数量
public static int BatchOutStoreCount = 0; public static int BatchOutStoreCount = 0;
public static int BatchOutStoreHeight = 0; public static int BatchOutStoreHeight = 0;
/// <summary> /// <summary>
/// 初始化数据 /// 初始化数据
/// </summary> /// </summary>
...@@ -61,16 +62,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -61,16 +62,16 @@ namespace OnlineStore.DeviceLibrary
/// 判断是否可以启动 /// 判断是否可以启动
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static string CanStart() public static string CanStart()
{ {
string msg = ""; string msg = "";
//需要判断门关闭 //需要判断门关闭
if (!DoorIsClose()) if (!DoorIsClose())
{ {
msg = "上料机构门未关闭"; msg = "上料机构门未关闭";
return msg; return msg;
} }
return msg; return msg;
} }
...@@ -80,7 +81,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -80,7 +81,7 @@ namespace OnlineStore.DeviceLibrary
BatchOutStoreHeight = 0; BatchOutStoreHeight = 0;
LastCode = ""; LastCode = "";
LastPosId = ""; LastPosId = "";
LastHeight = 0; LastHeight = 0;
LastSize = 0; LastSize = 0;
} }
...@@ -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,11 +130,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,11 +130,11 @@ 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:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome);
LogUtil.info(Name + "复位中:匀速向上运动,检测 是否有料盘"); LogUtil.info(Name + "复位中:匀速向上运动,检测 是否有料盘");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
break; break;
...@@ -142,7 +143,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -142,7 +143,7 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW)) if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW))
{ {
LogUtil.info(Name + "复位中: 没有料盘,不需要上料,上料轴回0点"); LogUtil.info(Name + "复位中: 没有料盘,不需要上料,上料轴回0点");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R04_AutoBack); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R04_AutoBack);
ACAxisHomeMove(StoreManager.Config.Batch_Axis); ACAxisHomeMove(StoreManager.Config.Batch_Axis);
} }
else else
...@@ -152,8 +153,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -152,8 +153,8 @@ namespace OnlineStore.DeviceLibrary
AutoBaitingStatus = StoreRunStatus.Runing; AutoBaitingStatus = StoreRunStatus.Runing;
//TODO //TODO
StartInOut(); StartInOut();
} }
break; break;
case StoreMoveStep.AUTO_R04_AutoBack: case StoreMoveStep.AUTO_R04_AutoBack:
LogUtil.info(Name + "复位完成"); LogUtil.info(Name + "复位完成");
StoreMove.EndMove(); StoreMove.EndMove();
...@@ -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,11 +191,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,11 +191,11 @@ 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;
} }
} }
private static int SuckingDisc_WorkCount = 0; private static int SuckingDisc_WorkCount = 0;
private static void InStoreProcess() private static void InStoreProcess()
{ {
...@@ -249,24 +250,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -249,24 +250,24 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(IO_Type.Door_Up, IO_Type.Door_Down, true); CylinderMove(IO_Type.Door_Up, IO_Type.Door_Down, true);
} }
else if (StoreManager.Store.CanStarInOut()) else if (StoreManager.Store.CanStarInOut())
{ {
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;
} }
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I05_GetPosId)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I05_GetPosId))
{ {
//判断是否开始入库 //判断是否开始入库
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 + "入料: 开始入料,等待料盘拿走");
...@@ -319,15 +320,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -319,15 +320,15 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private static void SuckingDiscWork() private static void SuckingDiscWork()
{ {
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));
StoreMove.OneWaitCanEndStep = true; StoreMove.OneWaitCanEndStep = true;
} }
private static void IsNeedScanCode() private static void IsNeedScanCode()
{ {
LastCode = ""; LastCode = "";
...@@ -338,7 +339,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -338,7 +339,7 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I01_ScanCode); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I01_ScanCode);
LogUtil.info(Name + "入料: 开始扫码 "); LogUtil.info(Name + "入料: 开始扫码 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK()); StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
GetCameraCode(); GetCameraCode();
...@@ -352,7 +353,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -352,7 +353,7 @@ namespace OnlineStore.DeviceLibrary
AutoBaitingStatus = StoreRunStatus.Runing; AutoBaitingStatus = StoreRunStatus.Runing;
} }
} }
//public static bool StartOutStore(string PosId) //public static bool StartOutStore(string PosId)
//{ //{
...@@ -452,10 +453,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -452,10 +453,10 @@ namespace OnlineStore.DeviceLibrary
// } // }
//} //}
public static bool DoorIsClose() public static bool DoorIsClose()
{ {
if (KND.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH)) if (KND.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
return true; return true;
} }
...@@ -473,11 +474,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -473,11 +474,10 @@ namespace OnlineStore.DeviceLibrary
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.BatchDoor_Close, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.BatchDoor_Close, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.BatchDoor_Open, IO_VALUE.HIGH)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.BatchDoor_Open, IO_VALUE.HIGH));
} }
} }
public static void BatchDoorClose(bool isWait) public static void BatchDoorClose(bool isWait)
{ {
ClearInOutInfo(); ClearInOutInfo();
DoorStatus = 2; DoorStatus = 2;
if (isWait) if (isWait)
...@@ -488,6 +488,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -488,6 +488,6 @@ namespace OnlineStore.DeviceLibrary
KND.IOMove(IO_Type.BatchDoor_Open, IO_VALUE.LOW); KND.IOMove(IO_Type.BatchDoor_Open, IO_VALUE.LOW);
KND.IOMove(IO_Type.BatchDoor_Close, IO_VALUE.HIGH); KND.IOMove(IO_Type.BatchDoor_Close, IO_VALUE.HIGH);
} }
} }
} }
...@@ -6,19 +6,17 @@ using System.Text; ...@@ -6,19 +6,17 @@ using System.Text;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
public enum IO_VALUE public enum IO_VALUE
{ {
/// <summary> /// <summary>
/// 低位 /// 低位
/// </summary> /// </summary>
LOW = 0, LOW = 0,
/// <summary>
/// 高位
/// </summary>
HIGH = 1,
/// <summary>
/// 高位
/// </summary>
HIGH = 1,
} }
} }
...@@ -129,20 +129,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,20 +129,7 @@ namespace OnlineStore.DeviceLibrary
IsInWait = false; IsInWait = false;
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!