Commit 8f31be6a LN

上料机构升降轴增加点取料位置P3

1 个父辈 0432b9cd
此文件类型无法预览
......@@ -79,6 +79,8 @@
this.txtBP2 = new System.Windows.Forms.TextBox();
this.axisMoveControl1 = new OnlineStore.AssemblyLine.AxisMoveControl();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtUpdownP3 = new System.Windows.Forms.TextBox();
this.btnUpdownP3 = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.txtP1 = new System.Windows.Forms.TextBox();
this.btnMoveToP1 = new System.Windows.Forms.Button();
......@@ -87,6 +89,7 @@
this.btnMoveto = new System.Windows.Forms.Button();
this.txtSizePosition = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.lblName = new System.Windows.Forms.Label();
this.btnScan = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
......@@ -546,7 +549,7 @@
//
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(914, 21);
this.chbDebug.Location = new System.Drawing.Point(881, 23);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 247;
......@@ -574,7 +577,7 @@
this.lblStoreStatus.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStoreStatus.ForeColor = System.Drawing.Color.Green;
this.lblStoreStatus.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblStoreStatus.Location = new System.Drawing.Point(1027, 23);
this.lblStoreStatus.Location = new System.Drawing.Point(1065, 25);
this.lblStoreStatus.Name = "lblStoreStatus";
this.lblStoreStatus.Size = new System.Drawing.Size(65, 20);
this.lblStoreStatus.TabIndex = 245;
......@@ -807,7 +810,7 @@
this.groupBox9.Size = new System.Drawing.Size(836, 150);
this.groupBox9.TabIndex = 220;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "上料轴位置配置";
this.groupBox9.Text = "上料提升轴位置配置";
//
// btnBP3
//
......@@ -816,7 +819,7 @@
this.btnBP3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBP3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBP3.ForeColor = System.Drawing.Color.Red;
this.btnBP3.Location = new System.Drawing.Point(349, 34);
this.btnBP3.Location = new System.Drawing.Point(324, 34);
this.btnBP3.Name = "btnBP3";
this.btnBP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnBP3.Size = new System.Drawing.Size(163, 34);
......@@ -831,7 +834,7 @@
this.txtBP3.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtBP3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtBP3.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtBP3.Location = new System.Drawing.Point(515, 38);
this.txtBP3.Location = new System.Drawing.Point(490, 38);
this.txtBP3.MaxLength = 12;
this.txtBP3.Name = "txtBP3";
this.txtBP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
......@@ -844,7 +847,7 @@
this.btnBSave.BackColor = System.Drawing.SystemColors.Control;
this.btnBSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBSave.ForeColor = System.Drawing.Color.Red;
this.btnBSave.Location = new System.Drawing.Point(349, 83);
this.btnBSave.Location = new System.Drawing.Point(645, 79);
this.btnBSave.Name = "btnBSave";
this.btnBSave.Size = new System.Drawing.Size(163, 34);
this.btnBSave.TabIndex = 310;
......@@ -921,6 +924,8 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtUpdownP3);
this.groupBox2.Controls.Add(this.btnUpdownP3);
this.groupBox2.Controls.Add(this.btnSave);
this.groupBox2.Controls.Add(this.txtP1);
this.groupBox2.Controls.Add(this.btnMoveToP1);
......@@ -933,14 +938,44 @@
this.groupBox2.Size = new System.Drawing.Size(836, 147);
this.groupBox2.TabIndex = 218;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "升降轴位置配置";
this.groupBox2.Text = "移栽升降轴位置配置";
//
// txtUpdownP3
//
this.txtUpdownP3.BackColor = System.Drawing.SystemColors.Window;
this.txtUpdownP3.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtUpdownP3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtUpdownP3.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtUpdownP3.Location = new System.Drawing.Point(490, 83);
this.txtUpdownP3.MaxLength = 12;
this.txtUpdownP3.Name = "txtUpdownP3";
this.txtUpdownP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpdownP3.Size = new System.Drawing.Size(111, 26);
this.txtUpdownP3.TabIndex = 312;
this.txtUpdownP3.Text = "-1";
//
// btnUpdownP3
//
this.btnUpdownP3.BackColor = System.Drawing.SystemColors.Control;
this.btnUpdownP3.Cursor = System.Windows.Forms.Cursors.Default;
this.btnUpdownP3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdownP3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdownP3.ForeColor = System.Drawing.Color.Blue;
this.btnUpdownP3.Location = new System.Drawing.Point(324, 79);
this.btnUpdownP3.Name = "btnUpdownP3";
this.btnUpdownP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpdownP3.Size = new System.Drawing.Size(163, 34);
this.btnUpdownP3.TabIndex = 311;
this.btnUpdownP3.Text = "移栽升降轴取料位置P3:";
this.btnUpdownP3.UseVisualStyleBackColor = true;
this.btnUpdownP3.Click += new System.EventHandler(this.btnUpdownP3_Click);
//
// btnSave
//
this.btnSave.BackColor = System.Drawing.SystemColors.Control;
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.ForeColor = System.Drawing.Color.Blue;
this.btnSave.Location = new System.Drawing.Point(349, 80);
this.btnSave.Location = new System.Drawing.Point(645, 80);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(163, 34);
this.btnSave.TabIndex = 310;
......@@ -954,7 +989,7 @@
this.txtP1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtP1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP1.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtP1.Location = new System.Drawing.Point(515, 36);
this.txtP1.Location = new System.Drawing.Point(493, 36);
this.txtP1.MaxLength = 12;
this.txtP1.Name = "txtP1";
this.txtP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
......@@ -969,7 +1004,7 @@
this.btnMoveToP1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMoveToP1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnMoveToP1.ForeColor = System.Drawing.Color.Blue;
this.btnMoveToP1.Location = new System.Drawing.Point(349, 32);
this.btnMoveToP1.Location = new System.Drawing.Point(327, 32);
this.btnMoveToP1.Name = "btnMoveToP1";
this.btnMoveToP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnMoveToP1.Size = new System.Drawing.Size(163, 34);
......@@ -1013,7 +1048,7 @@
this.btnMoveto.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnMoveto.Size = new System.Drawing.Size(163, 34);
this.btnMoveto.TabIndex = 306;
this.btnMoveto.Text = "移栽位置";
this.btnMoveto.Text = "移栽位置P2";
this.btnMoveto.UseVisualStyleBackColor = true;
this.btnMoveto.Click += new System.EventHandler(this.btnMoveto_Click);
//
......@@ -1035,6 +1070,7 @@
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.chbMoveStop);
this.panel1.Controls.Add(this.lblName);
this.panel1.Controls.Add(this.btnScan);
this.panel1.Controls.Add(this.chbDebug);
......@@ -1049,6 +1085,18 @@
this.panel1.Size = new System.Drawing.Size(1326, 68);
this.panel1.TabIndex = 258;
//
// chbMoveStop
//
this.chbMoveStop.AutoSize = true;
this.chbMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMoveStop.Location = new System.Drawing.Point(971, 23);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(84, 24);
this.chbMoveStop.TabIndex = 250;
this.chbMoveStop.Text = "暂停运动";
this.chbMoveStop.UseVisualStyleBackColor = true;
this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged);
//
// lblName
//
this.lblName.BackColor = System.Drawing.Color.DodgerBlue;
......@@ -1185,6 +1233,9 @@
private System.Windows.Forms.Button btnScan;
private System.Windows.Forms.Label lblName;
private System.Windows.Forms.Label lblMoveInfo;
internal System.Windows.Forms.TextBox txtUpdownP3;
internal System.Windows.Forms.Button btnUpdownP3;
private System.Windows.Forms.CheckBox chbMoveStop;
}
}
......@@ -105,9 +105,9 @@ namespace OnlineStore.AssemblyLine
ReadIOList();
//lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
}
lblAgvInfo.Text ="AGV-"+equipBean.Config.AgvInName +" 状态:"+ AgvClient.GetAction(equipBean.Config.AgvInName).ToString()+
lblAgvInfo.Text = "AGV-" + equipBean.Config.AgvInName + " 状态:" + AgvClient.GetAction(equipBean.Config.AgvInName).ToString() +
"\t AGV-" + equipBean.Config.AgvOutName + " 状态:" + AgvClient.GetAction(equipBean.Config.AgvOutName).ToString() + "";
string canOut =equipBean.Config.IsCanOut.Equals(1) ? "紧急出料模块" : "入料模块";
string canOut = equipBean.Config.IsCanOut.Equals(1) ? "紧急出料模块" : "入料模块";
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus) + "(" + canOut + ")";
lblThisSta.Text = equipBean.WarnMsg;
string text = "";
......@@ -222,7 +222,7 @@ namespace OnlineStore.AssemblyLine
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus);
lblThisSta.Text = equipBean.WarnMsg;
txtP1.Text = equipBean.Config.UpDownAxisP1.ToString();
txtUpdownP3.Text = equipBean.Config.UpDownAxisP3.ToString();
if (equipBean.Config.SidesWayNum > 0)
{
btnSwLocationCylinder.Visible = true;
......@@ -371,8 +371,15 @@ namespace OnlineStore.AssemblyLine
}
private void btnFeedSideWayCylinder_Click(object sender, EventArgs e)
{
if (equipBean.MoveCylineCanTakeOrGive())
{
BtnMove(btnFeedSideWayCylinder, "上料横移气缸取料端", "上料横移气缸放料端", IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
MessageBox.Show("上料横移机构不在上升端", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnTrayLocationCylinder_Click(object sender, EventArgs e)
{
BtnMove(btnTrayLocationCylinder, "SL升降盘定位气缸前进", "SL升降盘定位气缸后退", IO_Type.SL_TrayLocation_After, IO_Type.SL_TrayLocation_Before);
......@@ -401,7 +408,7 @@ namespace OnlineStore.AssemblyLine
int size = 0;
try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { }
txtSizePosition.Text = equipBean.Config.GetUpdownPositionP2(size).ToString();
btnMoveto.Text = size + "寸移栽位置 :";
btnMoveto.Text = size + "寸移栽位置P2 :";
}
private void btnMoveto_Click(object sender, EventArgs e)
......@@ -409,7 +416,7 @@ namespace OnlineStore.AssemblyLine
int position = FormUtil.GetIntValue(txtSizePosition);
int speed = equipBean.Config.UpdownAxis_P2Speed;
LogUtil.info("点击【移栽位置】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】");
LogUtil.info("点击【移栽位置P2】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
}
......@@ -441,24 +448,22 @@ namespace OnlineStore.AssemblyLine
private void button3_Click(object sender, EventArgs e)
{
int position = FormUtil.GetIntValue(txtP1);
int speed = equipBean.Config.UpdownAxis_P2Speed;
LogUtil.info("点击【P1点测试】, 位置【" + position + "】速度【" + speed + "】");
int speed = equipBean.Config.UpdownAxis_P1Speed;
LogUtil.info("点击【移栽升降轴待机位置P1:】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
}
private void btnSave_Click(object sender, EventArgs e)
{
int p1Position = FormUtil.GetIntValue(txtP1);
equipBean.Config.BatchAxisP1 = p1Position;
equipBean.Config.UpDownAxisP1 = p1Position;
int p3Position = FormUtil.GetIntValue(txtUpdownP3);
equipBean.Config.UpDownAxisP3 = p3Position;
int size = 0;
try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { }
int sizePosition = FormUtil.GetIntValue(txtSizePosition);
equipBean.Config.UpdateUpdownPositon(size, sizePosition);
//equipBean.Config.UpdateUpdownBoxPositon(size, sizeBoxP);
equipBean.Config.UpdateUpdownP2(size, sizePosition);
LineManager.SaveFeedingEquipConfig(equipBean.Config);
MessageBox.Show("保存成功!");
}
......@@ -525,15 +530,34 @@ namespace OnlineStore.AssemblyLine
string msg = "";
if (LastCodeList.Count > 0)
{
foreach(string str in LastCodeList)
foreach (string str in LastCodeList)
{
msg = str + "\r\n";
}
}
LogUtil.info(equipBean.Name+ "扫码测试结果:" + msg);
LogUtil.info(equipBean.Name + "扫码测试结果:" + msg);
MessageBox.Show(equipBean.Name + "扫码测试结果:" + msg);
}
private void btnUpdownP3_Click(object sender, EventArgs e)
{
int position = FormUtil.GetIntValue(txtUpdownP3);
int speed = equipBean.Config.UpdownAxis_P3Speed;
LogUtil.info("点击【移栽升降轴取料位置P3:】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
}
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
equipBean.MoveStop = chbMoveStop.Checked;
LogUtil.info(equipBean.Name + "用户切换是否暂停: " + equipBean.MoveStop);
}
}
}
......
......@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,2,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
......@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,,
,,,,,,,,,
DI,0,SL1急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_11,0,SL1急停,X101,X101
......
......@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,4,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
......@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,,
,,,,,,,,,
DI,0,SL2急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_13,0,SL2急停,X141,X141
......
......@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,6,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
......@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,,
,,,,,,,,,
DI,0,SL3急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_15,0,SL3急停,X181,X181
......
......@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,8,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
......@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,400,,,,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
,,,,,,,,,
,,,,,,,,,
DI,0,SL4急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_17,0,SL4急停,X221,X221
......
......@@ -59,11 +59,17 @@ namespace OnlineStore.DeviceLibrary
StopMove();
}
}
public bool MoveStop = false;
/// <summary>
/// 运动处理
/// </summary>
protected override void BusyMoveProcess()
{
if (MoveStop)
{
return;
}
switch (MoveInfo.MoveType)
{
case LineMoveType.InStore:
......
......@@ -94,17 +94,17 @@ namespace OnlineStore.DeviceLibrary
ResetClearData();
lineStatus = LineStatus.ResetMove;
IOMove(IO_Type.SL_HddLed, IO_VALUE.HIGH);
MoveInfo.NextMoveStep(LineMoveStep.FR_01_BatchAxisHome);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":提升伺服回原点,升降伺服回原点,所有阻挡气缸上升");
BatchAxis.HomeMove(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
MoveInfo.NextMoveStep(LineMoveStep.FR_01_MoveCylinder_Up);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":上料横移机构上升,所有阻挡气缸上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
if (Config.SidesWayNum <= 0)
{
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW);
//顶升气缸下降
CylinderMove(MoveInfo, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down);
}else if (LineManager.Line.runStatus <= LineRunStatus.Wait)
}
else if (LineManager.Line.runStatus <= LineRunStatus.Wait)
{
CylinderMove(MoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
......@@ -136,7 +136,13 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.Wait:
StartReset();
break;
case LineMoveStep.FR_01_BatchAxisHome:
case LineMoveStep.FR_01_MoveCylinder_Up:
MoveInfo.NextMoveStep(LineMoveStep.FR_02_BatchAxisHome);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":提升伺服回原点,升降伺服回原点,所有阻挡气缸上升");
BatchAxis.HomeMove(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
break;
case LineMoveStep.FR_02_BatchAxisHome:
LogInfo(MoveInfo.MoveType + ":FR_03_BatchAxisToP2:提升伺服下降到P2点,升降伺服上升到待机点");
MoveInfo.NextMoveStep(LineMoveStep.FR_03_BatchAxisToP2);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
......@@ -159,9 +165,14 @@ namespace OnlineStore.DeviceLibrary
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
break;
case LineMoveStep.FR_06_BatchAxisToP1:
LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
// LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL");
// MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up);
// CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
// break;
//case LineMoveStep.FR_07_MoveCylinder_Up:
// LogInfo(MoveInfo.MoveType + ":FR_08_MoveCylinder_Slack:上料气缸放松SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_08_MoveCylinder_Slack);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
break;
case LineMoveStep.FR_07_MoveCylinder_Up:
LogInfo(MoveInfo.MoveType + ":FR_08_MoveCylinder_Slack:上料气缸放松SOL");
......@@ -169,9 +180,18 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
break;
case LineMoveStep.FR_08_MoveCylinder_Slack:
if (MoveCylineCanTakeOrGive())
{
LogInfo(MoveInfo.MoveType + ":FR_09_MoveCylinder_Take: 上料横移气缸取料端SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_09_MoveCylinder_Take);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
break;
case LineMoveStep.FR_09_MoveCylinder_Take:
LogInfo(MoveInfo.MoveType + ":FR_10_OutTopCylinder_Down: 出口顶升下降SOL");
......@@ -331,6 +351,18 @@ namespace OnlineStore.DeviceLibrary
}
}
/// <summary>
/// 判断上料横移机构是否可以横移运动
/// </summary>
/// <returns></returns>
public bool MoveCylineCanTakeOrGive()
{
if (IOValue(IO_Type.SL_MoveCylinder_Down).Equals(IO_VALUE.LOW) && IOValue(IO_Type.SL_MoveCylinder_Up).Equals(IO_VALUE.HIGH))
{
return true;
}
return false;
}
#region 提升轴匀速上升处理
private System.Timers.Timer axisCheckTimer = null;
......
......@@ -215,21 +215,21 @@ namespace OnlineStore.DeviceLibrary
#region 不需要出出料,直接放行
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_MoveOk))
{
//更新托盘条码信息
string code = CodeManager.ProcessCode(LastCodeList);
////更新托盘条码信息
//string code = CodeManager.ProcessCode(LastCodeList);
TrayManager.UpdateTrayCode(currTrayNum, code);
if (code.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
}
//从服务器获取库位号
string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
if (!result.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
LogUtil.error(result);
}
//TrayManager.UpdateTrayCode(currTrayNum, code);
//if (code.Equals(""))
//{
// TrayManager.UpdateInStoreNG(currTrayNum, true);
//}
////从服务器获取库位号
//string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
//if (!result.Equals(""))
//{
// TrayManager.UpdateInStoreNG(currTrayNum, true);
// LogUtil.error(result);
//}
InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
......@@ -300,10 +300,19 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_201_UpDownToP1) && MoveInfo.MoveStep >= (LineMoveStep.FO_07_LocationCylinder_Up))
{
if ( MoveCylineCanTakeOrGive())
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_202_MoveCylinder_Give);
InStoreLog(" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_202_MoveCylinder_Give))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_203_MoveCylinder_Down);
......@@ -340,10 +349,20 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_207_MoveCylinder_Up))
{
if (MoveCylineCanTakeOrGive())
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_208_MoveCylinder_Take);
InStoreLog(" MO_208_MoveCylinder_Take 紧急出料移栽:上料横移机构到取料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up);
InStoreLog(" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_208_MoveCylinder_Take))
{
InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 托盘开始放行,定位气缸下降");
......@@ -451,6 +470,7 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
#region 入料:料架进入并开始检测托盘
if (MoveInfo.MoveStep.Equals(LineMoveStep.Wait))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
......@@ -462,7 +482,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_02_LocationCylinder_Down);
InStoreLog(" FI_02_LocationCylinder_Down 开始:定位气缸下降,提升伺服移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(Config.BatchAxisP1, Config.BatchAxis_P1Speed);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_02_LocationCylinder_Down))
{
......@@ -489,125 +509,155 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_09_TrayLocation_Before))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_10_AxisUpMove);
InStoreLog(" FI_10_AxisUpMove 开始:上料轴开始慢速上升到P3点,等待测到料盘");
InStoreLog(" FI_10_AxisUpMove 开始:上料轴开始慢速上升到P3点,等待测到料盘");
BatchAxisToP3();
}
#endregion
#region 检测到托盘,扫码,取料并放入托盘
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_10_AxisUpMove))
{
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
CheckHasTray();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_11_MoveCylinder_Up))
{
//有料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_11_MoveCylinder_Take);
InStoreLog(" FI_11_MoveCylinder_Take 料盘移栽:检测到料盘,上料横移气缸到取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
FI_12_MoveCylinder_Give();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_12_MoveCylinder_Give))
{
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
InStoreLog(" FI_13_ScanCode 料盘移栽:开始扫码");
LastCodeList = new List<string>();
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return LastCodeList;
});
}
else
{
//无料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
InStoreLog(" FI_31_BatchAxisToP2 料盘移栽:未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
FI_12_MoveCylinder_Give();
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_11_MoveCylinder_Take))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_ScanCode))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_12_MoveCylinder_Down);
InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:上料横移机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
MoveInfo.NextMoveStep(LineMoveStep.FI_14_MoveCylinder_Take);
InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_MoveCylinder_Take))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_15_UpdownAxisToP3);
InStoreLog(" FI_12_MoveCylinder_Down 料盘移栽:升降轴到P3");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP3, Config.UpdownAxis_P3Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_12_MoveCylinder_Down))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_15_UpdownAxisToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_MoveCylinder_Tighten);
MoveInfo.NextMoveStep(LineMoveStep.FI_16_MoveCylinder_Tighten);
InStoreLog(" FI_13_MoveCylinder_Tighten 料盘移栽:上料横移机构夹紧");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_MoveCylinder_Tighten))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_16_MoveCylinder_Tighten))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_14_MoveCylinder_Up);
InStoreLog(" FI_14_MoveCylinder_Up 料盘移栽:上料横移机构上升,同时伺服运动到P3");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
MoveInfo.NextMoveStep(LineMoveStep.FI_17_UpdownAxisToP1);
InStoreLog(" FI_14_MoveCylinder_Up 料盘移栽:升降伺服到P1点,同时伺服运动到P3");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
BatchAxisToP3();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_MoveCylinder_Up))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_UpdownAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_15_SaveSize);
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
LastHeight = GetHeight();
LastWidth = GetWidth();
InStoreLog(" FI_15_SaveSize 料盘移栽:记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_15_SaveSize))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_SaveSize))
{
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_16_MoveCylinder_Emptying);
MoveInfo.NextMoveStep(LineMoveStep.FI_19_MoveCylinder_Emptying);
InStoreLog(" FI_16_MoveCylinder_Emptying 料盘移栽:上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Take);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
InStoreLog(" FI_15_SaveSize 料盘移栽:上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_16_MoveCylinder_Emptying))
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_MoveCylinder_Emptying))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_17_WaitTray);
MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray);
InStoreLog(" FI_17_WaitTray 料盘移栽:等待空托盘到达,并顶升上升,定位上升");
//TODO 此处需要等待空托盘
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_WaitTray) && SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))//TODO
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray) && SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))//TODO
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_MoveCylinder_Down);
MoveInfo.NextMoveStep(LineMoveStep.FI_21_MoveCylinder_Down);
InStoreLog(" FI_18_MoveCylinder_Down 料盘移栽:上料机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_MoveCylinder_Down))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_MoveCylinder_Down))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_19_UpdownAxisToP2);
MoveInfo.NextMoveStep(LineMoveStep.FI_22_UpdownAxisToP2);
int targetPositon = Config.GetUpdownPositionP2(LastHeight);
InStoreLog(" FI_19_UpdownAxisToP2 料盘移栽:移栽伺服下降到指定位置:" + targetPositon);
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_UpdownAxisToP2))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_UpdownAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_MoveCylinder_Slack);
MoveInfo.NextMoveStep(LineMoveStep.FI_23_MoveCylinder_Slack);
InStoreLog(" FI_20_MoveCylinder_Slack 料盘移栽:上料气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_MoveCylinder_Slack))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_MoveCylinder_Slack))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_UpDownAxisToP1);
MoveInfo.NextMoveStep(LineMoveStep.FI_24_UpDownAxisToP1);
InStoreLog(" FI_21_UpDownAxisToP1 料盘移栽:升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_UpDownAxisToP1))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_UpDownAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_22_MoveCylinder_Up);
MoveInfo.NextMoveStep(LineMoveStep.FI_25_MoveCylinder_Up);
InStoreLog(" FI_22_MoveCylinder_Up 料盘移栽:上料横移机构上升,记录托盘尺寸, 开始放行,");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
TrayManager.UpdateTrayInfo(currTrayNum, true, 1, "", "", LastHeight, LastWidth);
LastCodeList = new List<string>();
InStoreLog(" SecondStoreMove=MO_12_MoveOk 开始扫码");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
//更新托盘条码信息
string code = CodeManager.ProcessCode(LastCodeList);
TrayManager.UpdateTrayCode(currTrayNum, code);
if (code.Equals(""))
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
TrayManager.UpdateInStoreNG(currTrayNum, true);
}
//从服务器获取库位号
string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
if (!result.Equals(""))
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
TrayManager.UpdateInStoreNG(currTrayNum, true);
LogUtil.error(result);
}
return LastCodeList;
});
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_MoveCylinder_Up))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_MoveCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_MoveCylinder_Take);
InStoreLog(" FI_23_MoveCylinder_Take 料盘移栽:上料横移机构到取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_MoveCylinder_Take))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
InStoreLog(" FI_31_BatchAxisToP2 上料完成:未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
CheckHasTray();
}
#endregion
#region 未检测到托盘或放料完成
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_31_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_32_TrayLocationCylinder_After);
......@@ -681,7 +731,39 @@ namespace OnlineStore.DeviceLibrary
// runStatus = LineRunStatus.Runing;
// LogUtil.info("空料架已送出,入料结束");
//}
#endregion
}
private void FI_12_MoveCylinder_Give()
{
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_12_MoveCylinder_Give);
InStoreLog(" FI_12_MoveCylinder_Up 料盘移栽:横移机构到放料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
//有料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_11_MoveCylinder_Up);
InStoreLog(" FI_11_MoveCylinder_Up 料盘移栽:检测到料盘,横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
private void CheckHasTray()
{
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
FI_12_MoveCylinder_Give();
}
else
{
//无料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
InStoreLog(" FI_31_BatchAxisToP2 料盘移栽:未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
}
private void BatchAxisToP3()
{
MoveInfo.CanWhileCount = 0;
......@@ -689,7 +771,7 @@ namespace OnlineStore.DeviceLibrary
StartMovePosition = BatchAxis.GetAclPosition();
MoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxis(Config.Batch_Axis, Config.BatchAxisP3, Config.BatchAxis_P3Speed));
Config.Batch_Axis.TargetPosition = Config.BatchAxisP3;
BatchAxis.AbsMove(Config.BatchAxisP3, Config.BatchAxis_P3Speed);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP3, Config.BatchAxis_P3Speed);
//开始检测信号
BatchAxisStartCheck();
}
......@@ -783,7 +865,7 @@ namespace OnlineStore.DeviceLibrary
if (!isFull && runStatus.Equals(LineRunStatus.Runing) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{
//入料执行中, 且需要空托盘
if (MoveInfo.MoveStep >= LineMoveStep.FI_11_MoveCylinder_Take && MoveInfo.MoveStep <= LineMoveStep.FI_17_WaitTray)
if (MoveInfo.MoveStep >= LineMoveStep.FI_11_MoveCylinder_Up && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
{
if (checkAndMove)
{
......@@ -873,7 +955,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FO_02_LocationCylinder_Down);
InStoreLog(" FO_02_LocationCylinder_Down 开始:定位气缸下降,提升轴移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(Config.BatchAxisP1, Config.BatchAxis_P1Speed);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_02_LocationCylinder_Down))
{
......
......@@ -29,7 +29,8 @@ namespace OnlineStore.DeviceLibrary
if (type.IsEnum)
{
List<int> valueList = new List<int>();
foreach (int item in Enum.GetValues(type))
Array array = Enum.GetValues(type);
foreach (int item in array)
{
if (valueList.Contains(item))
{
......
......@@ -15,8 +15,8 @@ namespace OnlineStore.DeviceLibrary
public partial class ACServerManager
{
public static bool IsShowMsg = false ;
private static int SleepMSendons = 50;
private static int ReviceOutTimeMS = 200;
private static int SleepMSendons = 20;
private static int ReviceOutTimeMS = 100;
private static Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
private static string mapObj = "";
......
......@@ -98,10 +98,10 @@ namespace OnlineStore.DeviceLibrary
return false;
}
int timeOut = ReviceOutTimeMS;
if (data[1].Equals((byte)10))
{
timeOut = 1000;
}
//if (data[1].Equals((byte)10))
//{
// timeOut = 1000;
//}
bool result = false;
byte[] returnData = SendCommand(portName, data, timeOut, 8, out result);
if (returnData != null)
......
......@@ -86,24 +86,34 @@ namespace OnlineStore.DeviceLibrary
// rfidReader.LocalIP = "192.168.100.101";
rfidReader.RemoteIP = rfid;
string[] array = rfid.Split('.');
int index = Convert.ToInt32(array[3]);
bool result = rfidReader.Connect(index);
//string[] array = rfid.Split('.');
//int index = Convert.ToInt32(array[3]);
bool result = rfidReader.Connect();
if (result)
{
rfidReader.AutoScan(true);
LogUtil.info("连接 " + logName + " [" + index + "]成功");
LogUtil.info("连接 " + logName + "成功");
RFReaderMap.Add(rfid, rfidReader);
if (RfIPList.Contains(rfid))
{
RfIPList.Remove(rfid);
}
return true;
}
else
{
LogUtil.error("连接 " + logName + " [" + index + "] 失败" + "");
LogUtil.error("连接 " + logName + "失败" + "");
}
Thread.Sleep(5);
}
......
......@@ -470,11 +470,14 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 入料装置原点返回,10000开始
/// <summary>
/// 横移装置上升
/// </summary>
FR_01_MoveCylinder_Up=10001,
/// <summary>
/// 提升伺服回原点,升降伺服回原点
/// </summary>
FR_01_BatchAxisHome = 10001,
FR_02_BatchAxisHome = 10002,
/// <summary>
/// 然后提升伺服下降到P2点,升降伺服上升到待机点
......@@ -589,62 +592,76 @@ namespace OnlineStore.DeviceLibrary
FI_10_AxisUpMove = 11010,
/// <summary>
/// 入料取料:横移机构先上升
/// </summary>
FI_11_MoveCylinder_Up=11011,
/// <summary>
/// 入料取料:上料机构到放料端
/// </summary>
FI_12_MoveCylinder_Give = 11012,
/// <summary>
/// 入料检测到料盘:扫码
/// </summary>
FI_13_ScanCode =11013,
/// <summary>
/// 料盘移栽:有料盘:上料横移机构取料
/// </summary>
FI_11_MoveCylinder_Take = 11011,
FI_14_MoveCylinder_Take = 11014,
/// <summary>
/// 料盘移栽:上料横移机构下降
/// 料盘移栽:升降轴到P3
/// </summary>
FI_12_MoveCylinder_Down = 11012,
FI_15_UpdownAxisToP3= 11015,
/// <summary>
/// 料盘移栽:上料横移机构夹紧
/// </summary>
FI_13_MoveCylinder_Tighten = 11013,
FI_16_MoveCylinder_Tighten = 11016,
/// <summary>
/// 料盘移栽:上料横移机构上升,同时伺服运动到P3
/// </summary>
FI_14_MoveCylinder_Up = 11014,
FI_17_UpdownAxisToP1 ,
/// <summary>
/// 料盘移栽:记录高度尺寸
/// </summary>
FI_15_SaveSize = 11015,
FI_18_SaveSize ,
/// <summary>
/// 料盘移栽: 上料横移气缸放料SOL
/// </summary>
FI_16_MoveCylinder_Emptying = 11016,
FI_19_MoveCylinder_Emptying ,
/// <summary>
/// 料盘移栽:等待空托盘到达,并顶升上升,定位上升
/// </summary>
FI_17_WaitTray = 11017,
FI_20_WaitTray ,
/// <summary>
/// 料盘移栽: 上料机构下降
/// </summary>
FI_18_MoveCylinder_Down = 11018,
FI_21_MoveCylinder_Down ,
/// <summary>
/// 料盘移栽: 移栽伺服下降到指定位置
/// </summary>
FI_19_UpdownAxisToP2 = 11019,
FI_22_UpdownAxisToP2 ,
/// <summary>
/// 料盘移栽: 上料气缸放松
/// </summary>
FI_20_MoveCylinder_Slack = 11020,
FI_23_MoveCylinder_Slack ,
/// <summary>
/// 料盘移栽:升降伺服到P1点
/// </summary>
FI_21_UpDownAxisToP1 = 11021,
FI_24_UpDownAxisToP1 ,
/// <summary>
/// 料盘移栽:上料横移机构上升
/// </summary>
FI_22_MoveCylinder_Up = 11022,
/// <summary>
/// 料盘移栽:上料横移机构到取料端
/// </summary>
FI_23_MoveCylinder_Take = 11023,
FI_25_MoveCylinder_Up ,
///// <summary>
///// 料盘移栽:上料横移机构到取料端
///// </summary>
//FI_23_MoveCylinder_Take = 11023,
......
......@@ -135,11 +135,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("Height_ChangeValue", true)]
public int Height_ChangeValue { get; set; }
/// <summary>
/// PRO 0 提升上料轴在移栽上下降的位置 UpDownP2ListP2 0=180000
/// </summary>
[ConfigProAttribute("UpDownP2ListP2", true)]
public string UpDownP2ListP2 { get; set; }
/// <summary>
......@@ -153,6 +149,18 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("UpDownAxisP1", true)]
public int UpDownAxisP1 { get; set; }
/// <summary>
/// PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
/// </summary>
[ConfigProAttribute("UpDownP2List", true)]
public string UpDownP2List { get; set; }
/// <summary>
/// PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
/// </summary>
[ConfigProAttribute("UpDownAxisP3", true)]
public int UpDownAxisP3 { get; set; }
/// <summary>
/// PRO 0 移栽上下轴目标速度 UpdownAxis_TargetSpeed 150
/// </summary>
[ConfigProAttribute("UpdownAxis_TargetSpeed", true)]
......@@ -196,6 +204,11 @@ namespace OnlineStore.LoadCSVLibrary
public int UpdownAxis_P2Speed { get; set; }
/// <summary>
/// PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
/// </summary>
[ConfigProAttribute("UpdownAxis_P3Speed", true)]
public int UpdownAxis_P3Speed { get; set; }
/// <summary>
/// PRO,0,是否是用来出料,IsCanOut,1,,,,,
/// </summary>
[ConfigProAttribute("IsCanOut", false)]
......@@ -230,7 +243,7 @@ namespace OnlineStore.LoadCSVLibrary
if (UpDownPositionP2Map == null)
{
UpDownPositionP2Map = new Dictionary<int, int>();
string[] arrayList = UpDownP2ListP2.Split(';');
string[] arrayList = UpDownP2List.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('=');
......@@ -257,7 +270,7 @@ namespace OnlineStore.LoadCSVLibrary
return -1;
}
public void UpdateUpdownPositon(int size, int sizePosition)
public void UpdateUpdownP2(int size, int sizePosition)
{
string newPositionStr = "";
if (UpDownPositionP2Map.ContainsKey(size))
......@@ -274,7 +287,7 @@ namespace OnlineStore.LoadCSVLibrary
newPositionStr += key + "=" + UpDownPositionP2Map[key] + ";";
}
newPositionStr = newPositionStr.Substring(0, newPositionStr.Length - 1);
UpDownP2ListP2 = newPositionStr;
UpDownP2List = newPositionStr;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!