Commit 8f31be6a LN

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

1 个父辈 0432b9cd
此文件类型无法预览
...@@ -105,9 +105,9 @@ namespace OnlineStore.AssemblyLine ...@@ -105,9 +105,9 @@ namespace OnlineStore.AssemblyLine
ReadIOList(); ReadIOList();
//lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID); //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() + ""; "\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 + ")"; lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus) + "(" + canOut + ")";
lblThisSta.Text = equipBean.WarnMsg; lblThisSta.Text = equipBean.WarnMsg;
string text = ""; string text = "";
...@@ -123,7 +123,7 @@ namespace OnlineStore.AssemblyLine ...@@ -123,7 +123,7 @@ namespace OnlineStore.AssemblyLine
if (!lblInstoreList.Text.Equals(text)) if (!lblInstoreList.Text.Equals(text))
{ {
lblInstoreList.Text = text; lblInstoreList.Text = text;
} }
lblMoveInfo.Text = equipBean.GetMoveStr(); lblMoveInfo.Text = equipBean.GetMoveStr();
} }
catch (Exception ex) catch (Exception ex)
...@@ -222,7 +222,7 @@ namespace OnlineStore.AssemblyLine ...@@ -222,7 +222,7 @@ namespace OnlineStore.AssemblyLine
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus); lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus);
lblThisSta.Text = equipBean.WarnMsg; lblThisSta.Text = equipBean.WarnMsg;
txtP1.Text = equipBean.Config.UpDownAxisP1.ToString(); txtP1.Text = equipBean.Config.UpDownAxisP1.ToString();
txtUpdownP3.Text = equipBean.Config.UpDownAxisP3.ToString();
if (equipBean.Config.SidesWayNum > 0) if (equipBean.Config.SidesWayNum > 0)
{ {
btnSwLocationCylinder.Visible = true; btnSwLocationCylinder.Visible = true;
...@@ -256,11 +256,11 @@ namespace OnlineStore.AssemblyLine ...@@ -256,11 +256,11 @@ namespace OnlineStore.AssemblyLine
e.Graphics.DrawString(io.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3); e.Graphics.DrawString(io.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
} }
} }
private void btnReadIO_Click(object sender, EventArgs e) private void btnReadIO_Click(object sender, EventArgs e)
{ {
ReadIOList(); ReadIOList();
} }
internal override void FormStatus(bool isStart) internal override void FormStatus(bool isStart)
{ {
btnStart.Enabled = !isStart; btnStart.Enabled = !isStart;
...@@ -277,7 +277,7 @@ namespace OnlineStore.AssemblyLine ...@@ -277,7 +277,7 @@ namespace OnlineStore.AssemblyLine
private void btnStart_Click(object sender, EventArgs e) private void btnStart_Click(object sender, EventArgs e)
{ {
StartDebug(); StartDebug();
} }
private void btnStop_Click(object sender, EventArgs e) private void btnStop_Click(object sender, EventArgs e)
{ {
StopRun(); StopRun();
...@@ -371,7 +371,14 @@ namespace OnlineStore.AssemblyLine ...@@ -371,7 +371,14 @@ namespace OnlineStore.AssemblyLine
} }
private void btnFeedSideWayCylinder_Click(object sender, EventArgs e) private void btnFeedSideWayCylinder_Click(object sender, EventArgs e)
{ {
BtnMove(btnFeedSideWayCylinder, "上料横移气缸取料端", "上料横移气缸放料端", IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); 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) private void btnTrayLocationCylinder_Click(object sender, EventArgs e)
{ {
...@@ -401,7 +408,7 @@ namespace OnlineStore.AssemblyLine ...@@ -401,7 +408,7 @@ namespace OnlineStore.AssemblyLine
int size = 0; int size = 0;
try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { } try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { }
txtSizePosition.Text = equipBean.Config.GetUpdownPositionP2(size).ToString(); txtSizePosition.Text = equipBean.Config.GetUpdownPositionP2(size).ToString();
btnMoveto.Text = size + "寸移栽位置 :"; btnMoveto.Text = size + "寸移栽位置P2 :";
} }
private void btnMoveto_Click(object sender, EventArgs e) private void btnMoveto_Click(object sender, EventArgs e)
...@@ -409,7 +416,7 @@ namespace OnlineStore.AssemblyLine ...@@ -409,7 +416,7 @@ namespace OnlineStore.AssemblyLine
int position = FormUtil.GetIntValue(txtSizePosition); int position = FormUtil.GetIntValue(txtSizePosition);
int speed = equipBean.Config.UpdownAxis_P2Speed; int speed = equipBean.Config.UpdownAxis_P2Speed;
LogUtil.info("点击【移栽位置】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】"); LogUtil.info("点击【移栽位置P2】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed); equipBean.UpdownAxis.AbsMove(position, speed);
} }
...@@ -424,7 +431,7 @@ namespace OnlineStore.AssemblyLine ...@@ -424,7 +431,7 @@ namespace OnlineStore.AssemblyLine
private void btnCloseAll_Click(object sender, EventArgs e) private void btnCloseAll_Click(object sender, EventArgs e)
{ {
foreach (Control con in groupBox5.Controls) foreach (Control con in groupBox5.Controls)
{ {
if (con is Button) if (con is Button)
...@@ -440,25 +447,23 @@ namespace OnlineStore.AssemblyLine ...@@ -440,25 +447,23 @@ namespace OnlineStore.AssemblyLine
private void button3_Click(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e)
{ {
int position = FormUtil.GetIntValue(txtP1); int position = FormUtil.GetIntValue(txtP1);
int speed = equipBean.Config.UpdownAxis_P1Speed;
int speed = equipBean.Config.UpdownAxis_P2Speed; LogUtil.info("点击【移栽升降轴待机位置P1:】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
LogUtil.info("点击【P1点测试】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed);
} }
private void btnSave_Click(object sender, EventArgs e) private void btnSave_Click(object sender, EventArgs e)
{ {
int p1Position = FormUtil.GetIntValue(txtP1); 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; int size = 0;
try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { } try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { }
int sizePosition = FormUtil.GetIntValue(txtSizePosition); int sizePosition = FormUtil.GetIntValue(txtSizePosition);
equipBean.Config.UpdateUpdownPositon(size, sizePosition); equipBean.Config.UpdateUpdownP2(size, sizePosition);
//equipBean.Config.UpdateUpdownBoxPositon(size, sizeBoxP);
LineManager.SaveFeedingEquipConfig(equipBean.Config); LineManager.SaveFeedingEquipConfig(equipBean.Config);
MessageBox.Show("保存成功!"); MessageBox.Show("保存成功!");
} }
...@@ -525,15 +530,34 @@ namespace OnlineStore.AssemblyLine ...@@ -525,15 +530,34 @@ namespace OnlineStore.AssemblyLine
string msg = ""; string msg = "";
if (LastCodeList.Count > 0) if (LastCodeList.Count > 0)
{ {
foreach(string str in LastCodeList) foreach (string str in LastCodeList)
{ {
msg = str + "\r\n"; msg = str + "\r\n";
} }
} }
LogUtil.info(equipBean.Name+ "扫码测试结果:" + msg); LogUtil.info(equipBean.Name + "扫码测试结果:" + msg);
MessageBox.Show(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,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,2,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,2,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,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 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,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,4,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,4,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,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 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,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,6,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,6,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,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 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,,,,, ...@@ -23,8 +23,9 @@ PRO,0,提升上料轴P3速度,BatchAxis_P3Speed,50,,,,,
PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,, PRO,0,提升上料轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,5000,,,,,
,,,,,,,,, ,,,,,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,8,COM5,0,,, AXIS,0,移栽上下轴,UpDown_Axis,8,COM5,0,,,
PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,20000,,,,, PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,2000,,,,,
PRO,0,移栽上下轴在移栽上下降的位置P2集合,UpDownP2ListP2,0=180000;,,,,, PRO,0,移栽上下轴P2移栽机构下降位置,UpDownP2List,0=180000;,,,,,
PRO,0,移栽上下轴P3取料位置,UpDownAxisP3,20000,,,,,
PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,, PRO,0,移栽上下轴目标速度,UpdownAxis_TargetSpeed,150,,,,,
PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,, PRO,0,移栽上下轴加速度,UpdownAxis_AddSpeed,400,,,,,
PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,, PRO,0,移栽上下轴减速度,UpdownAxis_DelSpeed,400,,,,,
...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,, ...@@ -33,6 +34,7 @@ PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,, PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,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 DI,0,SL4急停,SL_SuddenStop_BTN,0,PRO_AOI_IP_17,0,SL4急停,X221,X221
......
...@@ -59,11 +59,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -59,11 +59,17 @@ namespace OnlineStore.DeviceLibrary
StopMove(); StopMove();
} }
} }
public bool MoveStop = false;
/// <summary> /// <summary>
/// 运动处理 /// 运动处理
/// </summary> /// </summary>
protected override void BusyMoveProcess() protected override void BusyMoveProcess()
{ {
if (MoveStop)
{
return;
}
switch (MoveInfo.MoveType) switch (MoveInfo.MoveType)
{ {
case LineMoveType.InStore: case LineMoveType.InStore:
......
...@@ -94,17 +94,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -94,17 +94,17 @@ namespace OnlineStore.DeviceLibrary
ResetClearData(); ResetClearData();
lineStatus = LineStatus.ResetMove; lineStatus = LineStatus.ResetMove;
IOMove(IO_Type.SL_HddLed, IO_VALUE.HIGH); IOMove(IO_Type.SL_HddLed, IO_VALUE.HIGH);
MoveInfo.NextMoveStep(LineMoveStep.FR_01_BatchAxisHome); MoveInfo.NextMoveStep(LineMoveStep.FR_01_MoveCylinder_Up);
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":提升伺服回原点,升降伺服回原点,所有阻挡气缸上升"); LogInfo(MoveInfo.MoveType + ":" + MoveInfo.MoveStep + ":上料横移机构上升,所有阻挡气缸上升");
BatchAxis.HomeMove(MoveInfo); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
UpdownAxis.HomeMove(MoveInfo);
if (Config.SidesWayNum <= 0) if (Config.SidesWayNum <= 0)
{ {
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW); IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW); IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW);
//顶升气缸下降 //顶升气缸下降
CylinderMove(MoveInfo, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down); 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_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
...@@ -136,7 +136,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -136,7 +136,13 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.Wait: case LineMoveStep.Wait:
StartReset(); StartReset();
break; 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点,升降伺服上升到待机点"); LogInfo(MoveInfo.MoveType + ":FR_03_BatchAxisToP2:提升伺服下降到P2点,升降伺服上升到待机点");
MoveInfo.NextMoveStep(LineMoveStep.FR_03_BatchAxisToP2); MoveInfo.NextMoveStep(LineMoveStep.FR_03_BatchAxisToP2);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed); BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
...@@ -159,9 +165,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -159,9 +165,14 @@ namespace OnlineStore.DeviceLibrary
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed); BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
break; break;
case LineMoveStep.FR_06_BatchAxisToP1: case LineMoveStep.FR_06_BatchAxisToP1:
LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL"); // LogInfo(MoveInfo.MoveType + ":FR_07_MoveCylinder_Up:上料横移机构上升SOL");
MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up); // MoveInfo.NextMoveStep(LineMoveStep.FR_07_MoveCylinder_Up);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_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; break;
case LineMoveStep.FR_07_MoveCylinder_Up: case LineMoveStep.FR_07_MoveCylinder_Up:
LogInfo(MoveInfo.MoveType + ":FR_08_MoveCylinder_Slack:上料气缸放松SOL"); LogInfo(MoveInfo.MoveType + ":FR_08_MoveCylinder_Slack:上料气缸放松SOL");
...@@ -169,9 +180,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -169,9 +180,18 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
break; break;
case LineMoveStep.FR_08_MoveCylinder_Slack: case LineMoveStep.FR_08_MoveCylinder_Slack:
LogInfo(MoveInfo.MoveType + ":FR_09_MoveCylinder_Take: 上料横移气缸取料端SOL"); if (MoveCylineCanTakeOrGive())
MoveInfo.NextMoveStep(LineMoveStep.FR_09_MoveCylinder_Take); {
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take); 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; break;
case LineMoveStep.FR_09_MoveCylinder_Take: case LineMoveStep.FR_09_MoveCylinder_Take:
LogInfo(MoveInfo.MoveType + ":FR_10_OutTopCylinder_Down: 出口顶升下降SOL"); LogInfo(MoveInfo.MoveType + ":FR_10_OutTopCylinder_Down: 出口顶升下降SOL");
...@@ -331,6 +351,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -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 提升轴匀速上升处理 #region 提升轴匀速上升处理
private System.Timers.Timer axisCheckTimer = null; private System.Timers.Timer axisCheckTimer = null;
......
...@@ -27,9 +27,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -27,9 +27,10 @@ namespace OnlineStore.DeviceLibrary
public static void CheckEnum(Type type) public static void CheckEnum(Type type)
{ {
if (type.IsEnum) if (type.IsEnum)
{ {
List<int> valueList = new List<int>(); 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)) if (valueList.Contains(item))
{ {
......
...@@ -15,8 +15,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,8 +15,8 @@ namespace OnlineStore.DeviceLibrary
public partial class ACServerManager public partial class ACServerManager
{ {
public static bool IsShowMsg = false ; public static bool IsShowMsg = false ;
private static int SleepMSendons = 50; private static int SleepMSendons = 20;
private static int ReviceOutTimeMS = 200; private static int ReviceOutTimeMS = 100;
private static Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>(); private static Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
private static string mapObj = ""; private static string mapObj = "";
......
...@@ -98,10 +98,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -98,10 +98,10 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
int timeOut = ReviceOutTimeMS; int timeOut = ReviceOutTimeMS;
if (data[1].Equals((byte)10)) //if (data[1].Equals((byte)10))
{ //{
timeOut = 1000; // timeOut = 1000;
} //}
bool result = false; bool result = false;
byte[] returnData = SendCommand(portName, data, timeOut, 8, out result); byte[] returnData = SendCommand(portName, data, timeOut, 8, out result);
if (returnData != null) if (returnData != null)
......
...@@ -86,24 +86,34 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,24 +86,34 @@ namespace OnlineStore.DeviceLibrary
// rfidReader.LocalIP = "192.168.100.101"; // rfidReader.LocalIP = "192.168.100.101";
rfidReader.RemoteIP = rfid; rfidReader.RemoteIP = rfid;
string[] array = rfid.Split('.'); //string[] array = rfid.Split('.');
int index = Convert.ToInt32(array[3]); //int index = Convert.ToInt32(array[3]);
bool result = rfidReader.Connect(index); bool result = rfidReader.Connect();
if (result) if (result)
{ {
rfidReader.AutoScan(true); rfidReader.AutoScan(true);
LogUtil.info("连接 " + logName + " [" + index + "]成功"); LogUtil.info("连接 " + logName + "成功");
RFReaderMap.Add(rfid, rfidReader); RFReaderMap.Add(rfid, rfidReader);
if (RfIPList.Contains(rfid)) if (RfIPList.Contains(rfid))
{ {
RfIPList.Remove(rfid); RfIPList.Remove(rfid);
} }
return true; return true;
} }
else else
{ {
LogUtil.error("连接 " + logName + " [" + index + "] 失败" + ""); LogUtil.error("连接 " + logName + "失败" + "");
} }
Thread.Sleep(5); Thread.Sleep(5);
} }
......
...@@ -470,11 +470,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -470,11 +470,14 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 入料装置原点返回,10000开始 #region 入料装置原点返回,10000开始
/// <summary>
/// 横移装置上升
/// </summary>
FR_01_MoveCylinder_Up=10001,
/// <summary> /// <summary>
/// 提升伺服回原点,升降伺服回原点 /// 提升伺服回原点,升降伺服回原点
/// </summary> /// </summary>
FR_01_BatchAxisHome = 10001, FR_02_BatchAxisHome = 10002,
/// <summary> /// <summary>
/// 然后提升伺服下降到P2点,升降伺服上升到待机点 /// 然后提升伺服下降到P2点,升降伺服上升到待机点
...@@ -588,63 +591,77 @@ namespace OnlineStore.DeviceLibrary ...@@ -588,63 +591,77 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
FI_10_AxisUpMove = 11010, 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>
/// 料盘移栽:有料盘:上料横移机构取料 /// 料盘移栽:有料盘:上料横移机构取料
/// </summary> /// </summary>
FI_11_MoveCylinder_Take = 11011, FI_14_MoveCylinder_Take = 11014,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构下降 /// 料盘移栽:升降轴到P3
/// </summary> /// </summary>
FI_12_MoveCylinder_Down = 11012, FI_15_UpdownAxisToP3= 11015,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构夹紧 /// 料盘移栽:上料横移机构夹紧
/// </summary> /// </summary>
FI_13_MoveCylinder_Tighten = 11013, FI_16_MoveCylinder_Tighten = 11016,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构上升,同时伺服运动到P3 /// 料盘移栽:上料横移机构上升,同时伺服运动到P3
/// </summary> /// </summary>
FI_14_MoveCylinder_Up = 11014, FI_17_UpdownAxisToP1 ,
/// <summary> /// <summary>
/// 料盘移栽:记录高度尺寸 /// 料盘移栽:记录高度尺寸
/// </summary> /// </summary>
FI_15_SaveSize = 11015, FI_18_SaveSize ,
/// <summary> /// <summary>
/// 料盘移栽: 上料横移气缸放料SOL /// 料盘移栽: 上料横移气缸放料SOL
/// </summary> /// </summary>
FI_16_MoveCylinder_Emptying = 11016, FI_19_MoveCylinder_Emptying ,
/// <summary> /// <summary>
/// 料盘移栽:等待空托盘到达,并顶升上升,定位上升 /// 料盘移栽:等待空托盘到达,并顶升上升,定位上升
/// </summary> /// </summary>
FI_17_WaitTray = 11017, FI_20_WaitTray ,
/// <summary> /// <summary>
/// 料盘移栽: 上料机构下降 /// 料盘移栽: 上料机构下降
/// </summary> /// </summary>
FI_18_MoveCylinder_Down = 11018, FI_21_MoveCylinder_Down ,
/// <summary> /// <summary>
/// 料盘移栽: 移栽伺服下降到指定位置 /// 料盘移栽: 移栽伺服下降到指定位置
/// </summary> /// </summary>
FI_19_UpdownAxisToP2 = 11019, FI_22_UpdownAxisToP2 ,
/// <summary> /// <summary>
/// 料盘移栽: 上料气缸放松 /// 料盘移栽: 上料气缸放松
/// </summary> /// </summary>
FI_20_MoveCylinder_Slack = 11020, FI_23_MoveCylinder_Slack ,
/// <summary> /// <summary>
/// 料盘移栽:升降伺服到P1点 /// 料盘移栽:升降伺服到P1点
/// </summary> /// </summary>
FI_21_UpDownAxisToP1 = 11021, FI_24_UpDownAxisToP1 ,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构上升 /// 料盘移栽:上料横移机构上升
/// </summary> /// </summary>
FI_22_MoveCylinder_Up = 11022, FI_25_MoveCylinder_Up ,
/// <summary> ///// <summary>
/// 料盘移栽:上料横移机构到取料端 ///// 料盘移栽:上料横移机构到取料端
/// </summary> ///// </summary>
FI_23_MoveCylinder_Take = 11023, //FI_23_MoveCylinder_Take = 11023,
......
...@@ -135,11 +135,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -135,11 +135,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("Height_ChangeValue", true)] [ConfigProAttribute("Height_ChangeValue", true)]
public int Height_ChangeValue { get; set; } public int Height_ChangeValue { get; set; }
/// <summary>
/// PRO 0 提升上料轴在移栽上下降的位置 UpDownP2ListP2 0=180000
/// </summary>
[ConfigProAttribute("UpDownP2ListP2", true)]
public string UpDownP2ListP2 { get; set; }
/// <summary> /// <summary>
...@@ -153,6 +149,18 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -153,6 +149,18 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("UpDownAxisP1", true)] [ConfigProAttribute("UpDownAxisP1", true)]
public int UpDownAxisP1 { get; set; } public int UpDownAxisP1 { get; set; }
/// <summary> /// <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 /// PRO 0 移栽上下轴目标速度 UpdownAxis_TargetSpeed 150
/// </summary> /// </summary>
[ConfigProAttribute("UpdownAxis_TargetSpeed", true)] [ConfigProAttribute("UpdownAxis_TargetSpeed", true)]
...@@ -196,6 +204,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -196,6 +204,11 @@ namespace OnlineStore.LoadCSVLibrary
public int UpdownAxis_P2Speed { get; set; } public int UpdownAxis_P2Speed { get; set; }
/// <summary> /// <summary>
/// PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,400,,,,,
/// </summary>
[ConfigProAttribute("UpdownAxis_P3Speed", true)]
public int UpdownAxis_P3Speed { get; set; }
/// <summary>
/// PRO,0,是否是用来出料,IsCanOut,1,,,,, /// PRO,0,是否是用来出料,IsCanOut,1,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("IsCanOut", false)] [ConfigProAttribute("IsCanOut", false)]
...@@ -230,7 +243,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -230,7 +243,7 @@ namespace OnlineStore.LoadCSVLibrary
if (UpDownPositionP2Map == null) if (UpDownPositionP2Map == null)
{ {
UpDownPositionP2Map = new Dictionary<int, int>(); UpDownPositionP2Map = new Dictionary<int, int>();
string[] arrayList = UpDownP2ListP2.Split(';'); string[] arrayList = UpDownP2List.Split(';');
foreach (string str in arrayList) foreach (string str in arrayList)
{ {
string[] arrStr = str.Split('='); string[] arrStr = str.Split('=');
...@@ -257,7 +270,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -257,7 +270,7 @@ namespace OnlineStore.LoadCSVLibrary
return -1; return -1;
} }
public void UpdateUpdownPositon(int size, int sizePosition) public void UpdateUpdownP2(int size, int sizePosition)
{ {
string newPositionStr = ""; string newPositionStr = "";
if (UpDownPositionP2Map.ContainsKey(size)) if (UpDownPositionP2Map.ContainsKey(size))
...@@ -274,7 +287,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -274,7 +287,7 @@ namespace OnlineStore.LoadCSVLibrary
newPositionStr += key + "=" + UpDownPositionP2Map[key] + ";"; newPositionStr += key + "=" + UpDownPositionP2Map[key] + ";";
} }
newPositionStr = newPositionStr.Substring(0, newPositionStr.Length - 1); newPositionStr = newPositionStr.Substring(0, newPositionStr.Length - 1);
UpDownP2ListP2 = newPositionStr; UpDownP2List = newPositionStr;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!