Commit 9a5953e1 LN

压紧轴改为伺服。IO配置修改。

1 个父辈 3a3e1777
......@@ -238,7 +238,7 @@
//
// txtComPosition
//
this.txtComPosition.Location = new System.Drawing.Point(563, 290);
this.txtComPosition.Location = new System.Drawing.Point(563, 238);
this.txtComPosition.Name = "txtComPosition";
this.txtComPosition.Size = new System.Drawing.Size(108, 23);
this.txtComPosition.TabIndex = 26;
......@@ -246,11 +246,11 @@
// btnComMovej
//
this.btnComMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnComMovej.Location = new System.Drawing.Point(410, 279);
this.btnComMovej.Location = new System.Drawing.Point(410, 227);
this.btnComMovej.Name = "btnComMovej";
this.btnComMovej.Size = new System.Drawing.Size(144, 52);
this.btnComMovej.TabIndex = 25;
this.btnComMovej.Text = "压紧轴-(向)";
this.btnComMovej.Text = "压紧轴-(向)";
this.btnComMovej.UseVisualStyleBackColor = false;
this.btnComMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseDown);
this.btnComMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseUp);
......@@ -258,25 +258,25 @@
// btnComMove
//
this.btnComMove.BackColor = System.Drawing.SystemColors.Control;
this.btnComMove.Location = new System.Drawing.Point(263, 279);
this.btnComMove.Location = new System.Drawing.Point(263, 227);
this.btnComMove.Name = "btnComMove";
this.btnComMove.Size = new System.Drawing.Size(144, 52);
this.btnComMove.TabIndex = 24;
this.btnComMove.Text = "压紧轴+(向)";
this.btnComMove.Text = "压紧轴+(向)";
this.btnComMove.UseVisualStyleBackColor = false;
this.btnComMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseDown);
this.btnComMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseUp);
//
// txtComSpeed
//
this.txtComSpeed.Location = new System.Drawing.Point(156, 290);
this.txtComSpeed.Location = new System.Drawing.Point(156, 238);
this.txtComSpeed.Name = "txtComSpeed";
this.txtComSpeed.Size = new System.Drawing.Size(100, 23);
this.txtComSpeed.TabIndex = 23;
//
// label4
//
this.label4.Location = new System.Drawing.Point(9, 292);
this.label4.Location = new System.Drawing.Point(9, 240);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(141, 17);
this.label4.TabIndex = 22;
......@@ -285,7 +285,7 @@
//
// txtAutoPosition
//
this.txtAutoPosition.Location = new System.Drawing.Point(563, 235);
this.txtAutoPosition.Location = new System.Drawing.Point(563, 296);
this.txtAutoPosition.Name = "txtAutoPosition";
this.txtAutoPosition.Size = new System.Drawing.Size(108, 23);
this.txtAutoPosition.TabIndex = 31;
......@@ -293,7 +293,7 @@
// btnAutoMovej
//
this.btnAutoMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnAutoMovej.Location = new System.Drawing.Point(410, 224);
this.btnAutoMovej.Location = new System.Drawing.Point(410, 285);
this.btnAutoMovej.Name = "btnAutoMovej";
this.btnAutoMovej.Size = new System.Drawing.Size(144, 52);
this.btnAutoMovej.TabIndex = 30;
......@@ -305,7 +305,7 @@
// btnAutoMove
//
this.btnAutoMove.BackColor = System.Drawing.SystemColors.Control;
this.btnAutoMove.Location = new System.Drawing.Point(263, 224);
this.btnAutoMove.Location = new System.Drawing.Point(263, 285);
this.btnAutoMove.Name = "btnAutoMove";
this.btnAutoMove.Size = new System.Drawing.Size(144, 52);
this.btnAutoMove.TabIndex = 29;
......@@ -316,14 +316,14 @@
//
// txtAutoSpeed
//
this.txtAutoSpeed.Location = new System.Drawing.Point(156, 235);
this.txtAutoSpeed.Location = new System.Drawing.Point(156, 296);
this.txtAutoSpeed.Name = "txtAutoSpeed";
this.txtAutoSpeed.Size = new System.Drawing.Size(100, 23);
this.txtAutoSpeed.TabIndex = 28;
//
// label7
//
this.label7.Location = new System.Drawing.Point(9, 237);
this.label7.Location = new System.Drawing.Point(9, 298);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(141, 17);
this.label7.TabIndex = 27;
......@@ -344,7 +344,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(751, 450);
this.ClientSize = new System.Drawing.Size(751, 488);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.txtAutoPosition);
this.Controls.Add(this.btnAutoMovej);
......
......@@ -24,6 +24,7 @@ namespace OnlineStore.AutoInOutStore
//private ConfigMoveAxis compress = null;
private ConfigMoveAxis inout = null;
private ConfigMoveAxis auto = null;
private ConfigMoveAxis comp = null;
private int compress_Slv = 0;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
......@@ -31,7 +32,8 @@ namespace OnlineStore.AutoInOutStore
{
middle = boxBean.Config.Middle_Axis;
updown = boxBean.Config.UpDown_Axis;
compress_Slv = boxBean.Config.CompressAxis_Slv;
comp = boxBean.Config.Comp_Axis;
// compress_Slv = boxBean.Config.CompressAxis_Slv;
inout = boxBean.Config.InOut_Axis;
auto = boxBean.Config.Batch_Axis;
InitializeComponent();
......@@ -50,13 +52,13 @@ namespace OnlineStore.AutoInOutStore
txtInOutSpeed.Text = (inout.TargetSpeed / 5).ToString();
txtUpDownSpeed.Text = (updown.TargetSpeed / 5).ToString();
txtAutoSpeed.Text = (auto.TargetSpeed / 5).ToString();
txtComSpeed.Text = (StoreManager.Config.CompressAxis_EndSpeed/2).ToString();
txtComSpeed.Text = (comp.TargetSpeed/2).ToString();
//timer1.Start();
UpdateMiddlePosition();
UpdateInOutPosition();
UpdateUpdownPosition();
UpdateAutoPosition();
txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
// txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
}
/// <summary>
/// 判断进出轴是否在P1点
......@@ -252,19 +254,66 @@ namespace OnlineStore.AutoInOutStore
UpdateInOutPosition();
}
}
//private void btnComMove_MouseDown(object sender, MouseEventArgs e)
//{
// int speed = FormUtil.GetIntValue(txtComSpeed);
// if (speed <= 0)
// {
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
// return;
// }
// this.btnComMove.BackColor = Color.Green;
// ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetEndSpeed, speed);
// ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetMaxSpeed, speed);
// ShuoKeControls.VolMove(compress_Slv, speed);
//}
//private void btnComMove_MouseUp(object sender, MouseEventArgs e)
//{
// if (this.btnComMove.BackColor == Color.Green)
// {
// btnComMove.BackColor = System.Drawing.SystemColors.Control;
// ShuoKeControls.SuddownStop(compress_Slv);
// txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
// }
//}
//private void btnComMovej_MouseDown(object sender, MouseEventArgs e)
//{
// int speed = FormUtil.GetIntValue(txtComSpeed);
// if (speed <= 0)
// {
// MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
// return;
// }
// this.btnComMovej.BackColor = Color.Green;
// ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetEndSpeed, speed);
// ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetMaxSpeed, speed);
// ShuoKeControls.VolMove(compress_Slv,-speed);
//}
//private void btnComMovej_MouseUp(object sender, MouseEventArgs e)
//{
// if (btnComMovej.BackColor.Equals(Color.Green))
// {
// btnComMovej.BackColor = System.Drawing.SystemColors.Control;
// ShuoKeControls.SuddownStop(compress_Slv);
// txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
// }
//}
private void btnComMove_MouseDown(object sender, MouseEventArgs e)
{
if (btnComMove.BackColor.Equals(System.Drawing.SystemColors.Control))
{
int speed = FormUtil.GetIntValue(txtComSpeed);
if (speed <= 0)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
MessageBox.Show("提示", "请先输入正确的速度");
return;
}
this.btnComMove.BackColor = Color.Green;
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetEndSpeed, speed);
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetMaxSpeed, speed);
ShuoKeControls.VolMove(compress_Slv, speed);
AxisMove(comp, speed);
}
}
private void btnComMove_MouseUp(object sender, MouseEventArgs e)
......@@ -272,8 +321,8 @@ namespace OnlineStore.AutoInOutStore
if (this.btnComMove.BackColor == Color.Green)
{
btnComMove.BackColor = System.Drawing.SystemColors.Control;
ShuoKeControls.SuddownStop(compress_Slv);
txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
ACServerManager.SuddenStop(comp.DeviceName, comp.GetAxisValue());
UpdateCompPosition();
}
}
private void btnComMovej_MouseDown(object sender, MouseEventArgs e)
......@@ -281,13 +330,11 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtComSpeed);
if (speed <= 0)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
MessageBox.Show("提示", "请先输入正确的速度");
return;
}
this.btnComMovej.BackColor = Color.Green;
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetEndSpeed, speed);
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetMaxSpeed, speed);
ShuoKeControls.VolMove(compress_Slv,-speed);
AxisMove(comp, -speed);
}
private void btnComMovej_MouseUp(object sender, MouseEventArgs e)
......@@ -295,8 +342,8 @@ namespace OnlineStore.AutoInOutStore
if (btnComMovej.BackColor.Equals(Color.Green))
{
btnComMovej.BackColor = System.Drawing.SystemColors.Control;
ShuoKeControls.SuddownStop(compress_Slv);
txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
ACServerManager.SuddenStop(comp.DeviceName, comp.GetAxisValue());
UpdateCompPosition();
}
}
......@@ -319,11 +366,19 @@ namespace OnlineStore.AutoInOutStore
UpdateInOutPosition();
UpdateUpdownPosition();
UpdateAutoPosition();
UpdateCompPosition();
//txtComPosition.Text = ShuoKeControls.GetLastPosition(compress_Slv).ToString();
}
}
private void UpdateCompPosition()
{
int compPosition = ACServerManager.GetTargetPosition(comp.DeviceName, comp.GetAxisValue());
if (!txtComPosition.Text.Equals(compPosition.ToString()))
{
txtComPosition.Text = compPosition.ToString();
}
}
private void UpdateUpdownPosition()
{
int updownPosition = ACServerManager.GetTargetPosition(updown.DeviceName, updown.GetAxisValue());
......@@ -414,7 +469,7 @@ namespace OnlineStore.AutoInOutStore
UpdateInOutPosition();
UpdateUpdownPosition();
UpdateAutoPosition();
txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
// txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
}
}
}
......@@ -108,9 +108,9 @@
this.groupBox1.Controls.Add(this.btnCloseDoor);
this.groupBox1.Controls.Add(this.btnOpenDoor);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(576, 11);
this.groupBox1.Location = new System.Drawing.Point(515, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(437, 617);
this.groupBox1.Size = new System.Drawing.Size(437, 649);
this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入";
......@@ -424,9 +424,9 @@
//
this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label5.Location = new System.Drawing.Point(33, 116);
this.label5.Location = new System.Drawing.Point(5, 116);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(75, 17);
this.label5.Size = new System.Drawing.Size(103, 17);
this.label5.TabIndex = 237;
this.label5.Text = "定时(ms):";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -493,7 +493,7 @@
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(830, 634);
this.button1.Location = new System.Drawing.Point(765, 672);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(115, 34);
this.button1.TabIndex = 254;
......@@ -508,7 +508,7 @@
this.chbAutoRead.Checked = true;
this.chbAutoRead.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAutoRead.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRead.Location = new System.Drawing.Point(706, 639);
this.chbAutoRead.Location = new System.Drawing.Point(641, 677);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(75, 21);
this.chbAutoRead.TabIndex = 244;
......@@ -520,9 +520,9 @@
this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox4.Controls.Add(this.tableLayoutPanel2);
this.groupBox4.Location = new System.Drawing.Point(293, 8);
this.groupBox4.Location = new System.Drawing.Point(262, 3);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(273, 665);
this.groupBox4.Size = new System.Drawing.Size(245, 712);
this.groupBox4.TabIndex = 104;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "DO列表";
......@@ -539,7 +539,7 @@
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(262, 645);
this.tableLayoutPanel2.Size = new System.Drawing.Size(234, 692);
this.tableLayoutPanel2.TabIndex = 103;
//
// groupBox3
......@@ -547,9 +547,9 @@
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(12, 8);
this.groupBox3.Location = new System.Drawing.Point(12, 3);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(273, 665);
this.groupBox3.Size = new System.Drawing.Size(245, 712);
this.groupBox3.TabIndex = 103;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "DI列表";
......@@ -566,14 +566,14 @@
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(262, 645);
this.tableLayoutPanel1.Size = new System.Drawing.Size(234, 692);
this.tableLayoutPanel1.TabIndex = 102;
//
// FrmIOStatus
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1036, 683);
this.ClientSize = new System.Drawing.Size(971, 721);
this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupBox4);
......
......@@ -49,15 +49,8 @@ namespace OnlineStore.AutoInOutStore
this.tableLayoutPanel1.RowCount = boxBean.Config.StoreDIList.Count;
foreach (ConfigIO ioValue in boxBean.Config.StoreDIList.Values)
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl();
control.IOName = ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain);
control.IOValue = 0;
control.IoType = ioValue.ProName;
control.isCanClick = false;
control.Name = "IO_" + ioValue.ProName;
control.Size = new System.Drawing.Size(260, 25);
control.TabIndex = 0;
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName,240);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
DIControlList.Add(ioValue.ProName, control);
......@@ -69,15 +62,7 @@ namespace OnlineStore.AutoInOutStore
foreach (ConfigIO ioValue in boxBean.Config.StoreDOList.Values)
{
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl();
control.IOName = ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain);
control.IOValue = 0;
control.IoType = ioValue.ProName;
control.isCanClick = true;
//control.Location = new System.Drawing.Point(0, 25*roleindex);
control.Name = "IO_" + ioValue.ProName;
control.Size = new System.Drawing.Size(260, 25);
control.TabIndex = 0;
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName, 240);
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
roleindex++;
DOControlList.Add(ioValue.ProName, control);
......@@ -151,6 +136,8 @@ namespace OnlineStore.AutoInOutStore
txtDoName.Text = io.DeviceName;
txtSlaveId.Text = io.SlaveID.ToString();
IOTextControl newControl = DOControlList[io.ProName];
if (selectControl != null) { selectControl.BackColor = Color.White; }
newControl.BackColor = Color.SkyBlue;
selectControl = newControl;
}
}
......@@ -280,14 +267,14 @@ namespace OnlineStore.AutoInOutStore
private void btnSuckingDiscUp_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.SuckingDisc_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.SuckingDisc_Up, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.ClampingDisc_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.ClampingDisc_Up, IO_VALUE.HIGH);
}
private void btnSuckingDiscDown_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.SuckingDisc_Up, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.SuckingDisc_Down, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.ClampingDisc_Up, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.ClampingDisc_Down, IO_VALUE.HIGH);
}
private void btnDOpen_Click(object sender, EventArgs e)
......
......@@ -218,6 +218,9 @@ IO模块读取时间改为可配置。
后面自动上下料 RC1252 修改。
DI9 不要,只判断DI10
压紧轴改为伺服,压紧轴计量检测信号去掉。
20190801 新建分支:RC1252-AutoInOutStore
压紧轴改为伺服,压紧轴计量检测信号去掉。
IO配置修改,改为新的IO配置。
......@@ -73,8 +73,6 @@
<Compile Include="DeviceLibrary\PanasonicServo\ACServerManager.cs" />
<Compile Include="DeviceLibrary\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="DeviceLibrary\PanasonicServo\BatchAxisController.cs" />
<Compile Include="DeviceLibrary\ShuoKe\MeteringSignalBean.cs" />
<Compile Include="DeviceLibrary\ShuoKe\ShuoKeController.cs" />
<Compile Include="ResourceControl.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
......@@ -110,7 +108,9 @@
<Name>LoadCSVLibrary</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="DeviceLibrary\ShuoKe\" />
</ItemGroup>
<ItemGroup>
<None Include="StoreConfig\AC\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
......
......@@ -328,12 +328,12 @@ namespace OnlineStore.DeviceLibrary
public static void SetConfigSpeed(AUTO_SA_Config Config)
{
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetAddSpeed, Config.CompressAxis_AddSpeed);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetDelSpeed, Config.CompressAxis_DelSpeed);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetEndSpeed, Config.CompressAxis_EndSpeed);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetHomeSpeed, Config.CompressAxis_HomeSpeed);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetMaxSpeed, Config.CompressAxis_MaxSpeed);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetStartSpeed, Config.CompressAxis_StartSpeed);
//ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetAddSpeed, Config.CompressAxis_AddSpeed);
//ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetDelSpeed, Config.CompressAxis_DelSpeed);
//ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetEndSpeed, Config.CompressAxis_EndSpeed);
//ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetHomeSpeed, Config.CompressAxis_HomeSpeed);
//ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetMaxSpeed, Config.CompressAxis_MaxSpeed);
//ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetStartSpeed, Config.CompressAxis_StartSpeed);
}
......
......@@ -5,8 +5,8 @@ DI,自动启动,AutoRun_Single,2,192.168.200.11,0,自动启动,X03,DI-03,0,
DI,安全光栅,SafetyLightCurtains,3,192.168.200.11,0,安全光栅,X04,DI-04,0,
DI,进料口门上升端,Door_Up,4,192.168.200.11,0,进料口门上升端,X05,DI-05,0,
DI,进料口门下降端,Door_Down,5,192.168.200.11,0,进料口门下降端,X06,DI-06,0,
DI,吸盘气缸上升端,SuckingDisc_Up,6,192.168.200.11,0,吸盘气缸上升端,X07,DI-07,0,
DI,吸盘气缸下降端,SuckingDisc_Down,7,192.168.200.11,0,吸盘气缸下降端,X08,DI-08,0,
DI,抓取气缸上升端,ClampingDisc_Up,6,192.168.200.11,0,抓取气缸上升端,X07,DI-07,0,
DI,抓取气缸下降端,ClampingDisc_Down,7,192.168.200.11,0,抓取气缸下降端,X08,DI-08,0,
DI,料盘宽度检测1,WidthCheck1,8,192.168.200.11,0,料盘宽度检测1,X09,DI-09,0,
DI,料盘宽度检测2,WidthCheck2,9,192.168.200.11,0,料盘宽度检测2,X10,DI-10,0,
DI,料盘检测1(上料机构),TrayCheck_LoadMaterial,10,192.168.200.11,0,料盘检测1(上料机构),X11,DI-11,0,
......@@ -22,27 +22,50 @@ DO,吹气SOL ON,StartOrStopBlow,19,192.168.200.11,0,吹气SOL ON,Y04,DO-04,0,
DO,料仓运转ON,Run_Sign,20,192.168.200.11,0,料仓运转ON,Y05,DO-05,0,
DO,轴2刹车电源ON,Axis_Brake,21,192.168.200.11,0,轴2刹车电源ON,Y06,DO-06,0,
DO,相机照明开,CameraLight_Power,22,192.168.200.11,0,相机照明开,Y07,DO-07,0,
DO,吸盘吸料SOL,SuckingDisc_Work,23,192.168.200.11,0,吸盘吸料SOL,Y08,DO-08,0,
,备用,,23,192.168.200.11,0,备用,Y08,DO-08,0,
DO,进料口门上升SOL,Door_Up,24,192.168.200.11,0,进料口门上升SOL,Y09,DO-09,0,
DO,进料口门下降SOL,Door_Down,25,192.168.200.11,0,进料口门下降SOL,Y10,DO-10,0,
DO,吸盘气缸上升SOL,SuckingDisc_Up,26,192.168.200.11,0,吸盘气缸上升SOL,Y11,DO-11,0,
DO,吸盘气缸下降SOL,SuckingDisc_Down,27,192.168.200.11,0,吸盘气缸下降SOL,Y12,DO-12,0,
DO,抓取气缸上升SOL,ClampingDisc_Up,26,192.168.200.11,0,抓取气缸上升SOL,Y11,DO-11,0,
DO,抓取气缸下降SOL,ClampingDisc_Down,27,192.168.200.11,0,抓取气缸下降SOL,Y12,DO-12,0,
DO,门锁气缸打开SOL,BatchDoor_Open,28,192.168.200.11,0,门锁气缸打开SOL,Y13,DO-13,0,
DO,门锁气缸关闭SOL,BatchDoor_Close,29,192.168.200.11,0,门锁气缸关闭SOL,Y14,DO-14,0,
DO,门禁功能屏蔽,DisableDoorControl,30,192.168.200.11,0,门禁功能屏蔽,Y15,DO-15,0,
DO,报警蜂鸣器,Buzzer_Sign,31,192.168.200.11,0,报警蜂鸣器,Y16,DO-16,0,
DI,上料机构门关闭,DoorClose_LoadMaterial,0,192.168.200.12,0,上料机构门关闭,X21,DI-21,0,
DI,气压检测,Airpressure_Check,1,192.168.200.12,0,气压检测,X22,DI-22,0,
DI,吸盘压力确认信号,SuckingDisc_Air,2,192.168.200.12,0,吸盘压力确认信号,X23,DI-23,0,
DI,左侧门关闭,DoorColse_Single,3,192.168.200.12,0,左侧门关闭,X24,DI-24,0,
DI,左侧门关闭,LeftDoorColse_Single,2,192.168.200.12,0,左侧门关闭,X23,DI-23,0,
DI,右侧门关闭,RightDoorColse_Single,3,192.168.200.12,0,右侧门关闭,X24,DI-24,0,
DI,门锁气缸打开端2,BatchDoor_Open2,4,192.168.200.12,0,门锁气缸打开端2,X25,DI-25,0,
DI,门锁气缸关闭端2,BatchDoor_Close2,5,192.168.200.12,0,门锁气缸关闭端2,X26,DI-26,0,
DI,批量轴极限信号,BatchAxis_Limit,6,192.168.200.12,0,批量轴极限信号,X27,DI-27,0,
DI,仓门料盘检测信号,TrayCheck_Door,7,192.168.200.12,0,仓门料盘检测信号,X28,DI-28,0,
,,,16,192.168.200.12,0,,Y21,DO-21,0,
,,,17,192.168.200.12,0,,Y22,DO-22,0,
DI,上料机构上极限,BatchAxis_Limit,6,192.168.200.12,0,上料机构上极限,X27,DI-27,0,
DI,入料口料盘检测,TrayCheck_Door,7,192.168.200.12,0,入料口料盘检测,X28,DI-28,0,
DI,夹爪气缸夹紧端,Clamping_Work,8,192.168.200.12,0,夹爪气缸夹紧端,X29,DI-29,0,
DI,夹爪气缸放松端,Clamping_Relax,9,192.168.200.12,0,夹爪气缸放松端,X30,DI-30,0,
,,,10,192.168.200.12,0,,X31,DI-31,0,
,,,11,192.168.200.12,0,,X32,DI-32,0,
,,,12,192.168.200.12,0,,X33,DI-33,0,
,,,13,192.168.200.12,0,,X34,DI-34,0,
,,,14,192.168.200.12,0,,X35,DI-35,0,
,,,15,192.168.200.12,0,,X36,DI-36,0,
DO,夹爪气缸夹紧SOL,Clamping_Work,16,192.168.200.12,0,,Y21,DO-21,0,
DO,夹爪气缸放松SOL,Clamping_Relax,17,192.168.200.12,0,,Y22,DO-22,0,
,,,18,192.168.200.12,0,,Y23,DO-23,0,
,,,19,192.168.200.12,0,,Y24,DO-24,0,
,,,20,192.168.200.12,0,,Y25,DO-25,0,
,,,21,192.168.200.12,0,,Y26,DO-26,0,
,,,22,192.168.200.12,0,,Y27,DO-27,0,
,,,23,192.168.200.12,0,,Y28,DO-28,0,
,,,24,192.168.200.12,0,,Y29,DO-29,0,
,,,25,192.168.200.12,0,,Y30,DO-30,0,
,,,26,192.168.200.12,0,,Y31,DO-31,0,
,,,27,192.168.200.12,0,,Y32,DO-32,0,
,,,28,192.168.200.12,0,,Y33,DO-33,0,
,,,29,192.168.200.12,0,,Y34,DO-34,0,
,,,30,192.168.200.12,0,,Y35,DO-35,0,
,,,31,192.168.200.12,0,,Y36,DO-36,0,
PRO,IO模块对应的DI数量,IO_DILength,192.168.200.21#16;192.168.200.22#16,,,,,, ,
PRO,模块对应的DO数量,IO_DOLength,192.168.200.21#16;192.168.200.22#16,,,,,,,
,,,,,,,,,,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
......@@ -121,17 +144,7 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,30,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,1,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM5,,,,,,,
,,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM6,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,50000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,100000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,100000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,60000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,60000,,,,,,,
PRO,硕科步进电机(压紧轴)原点返回速度,CompressAxis_HomeSpeed,30000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,, ,
,,,,,,,,,,
,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,800,,,,,,,
PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,150,,,,,,,
......@@ -152,8 +165,16 @@ PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,10000
PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,,
PRO,最后一盘料需要补充的高度,LastTrayAddHeight,0,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,IO模块对应的DI数量,IO_DILength,192.168.200.21#16;192.168.200.22#4,,,,,, ,
PRO,模块对应的DO数量,IO_DOLength,192.168.200.21#16;192.168.200.22#4,,,,,,,
PRO,(轴二)升降轴单盘入库抬升料盘的高度,UpdownAxis_UpPosition,3000,,,,,,,
PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,1610000,,,,,,,
,,,,,,,,,,
AXIS,(轴四)压紧轴,Comp_Axis,5,COM1,0,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,100,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,300,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,300,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
PRO,压紧轴(轴4)P1速度,CompAxis_P1_Speed,100,,,,,,,
PRO,压紧轴(轴4)P2速度,CompAxis_P2_Speed,100,,,,,,,
PRO,压紧轴(轴4)P3速度,CompAxis_P3_Speed,100,,,,,,,
......@@ -225,9 +225,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (wait.WaitType == (int)Wait_Type.ShuoKe_5)
{
string msg = "";
wait.IsEnd = ShuoKeIsEnd(wait, out msg);
NotOkMsg = NotOkMsg + " " + msg;
//string msg = "";
//wait.IsEnd = ShuoKeIsEnd(wait, out msg);
//NotOkMsg = NotOkMsg + " " + msg;
}
if (wait.IsEnd)
{
......@@ -260,36 +260,6 @@ namespace OnlineStore.DeviceLibrary
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnObj.WarnMsg, StoreMove.MoveType);
}
}
private bool ShuoKeIsEnd(WaitResultInfo wait, out string msg)
{
//bool result = false;
msg = "";
if (wait.IsHomeMove)
{
return ShuoKeControls.IsHomeMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime, out msg);
}
else
{
bool isend = ShuoKeControls.IsMoveEnd(wait.SlvAddr, wait.TargetPosition, StoreMove.LastSetpTime, out msg);
if (isend)
{
bool isCheckOk = (MeteringSignal.TargetChangeCount <= MeteringSignal.SignalChangeCount);
if (isCheckOk || MeteringSignal.TargetChangeCount <= 0)
{
MeteringSignal.StopCheck();
return true;
}
else
{
msg = "压紧轴计量检测目标【" + MeteringSignal.TargetChangeCount + "】实际【" + MeteringSignal.SignalChangeCount + "】";
LogUtil.error("压紧轴已经停止运动,但是 " + msg,110);
return false;
}
}
}
return false;
}
#endregion
......@@ -360,10 +330,10 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库:SI_03 所有轴回待机点,轴2、轴1 到P1, 轴4到P3,吸盘在上升端");
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
bool needMove = false;
if (!ShuoKeControls.IsInPosition(Config.CompressAxis_Slv, moveP.ComPress_P3))
if (!ACServerManager.isInPosition(Config.Comp_Axis, moveP.ComPress_P3))
{
needMove = true;
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
}
if (!ACServerManager.isInPosition(Config.UpDown_Axis, moveP.UpDown_P1))
{
......@@ -375,10 +345,10 @@ namespace OnlineStore.DeviceLibrary
needMove = true;
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Down, IO_VALUE.LOW));
//如果不需要回待机点,直接到下一个步骤
if (!needMove && IOManager.IOValue(IO_Type.SuckingDisc_Down).Equals(IO_VALUE.LOW) && IOManager.IOValue(IO_Type.SuckingDisc_Up).Equals(IO_VALUE.HIGH))
if (!needMove && IOManager.IOValue(IO_Type.ClampingDisc_Down).Equals(IO_VALUE.LOW) && IOManager.IOValue(IO_Type.ClampingDisc_Up).Equals(IO_VALUE.HIGH))
{
SI_04_DeviceToDoor();
}
......@@ -459,7 +429,7 @@ namespace OnlineStore.DeviceLibrary
int targetPosition = moveP.UpDown_P1 - Config.UpDownAxis_DownValue;
InStoreLog("入库:SI_06 压紧轴压紧,压紧轴到P2,升降轴下降【" + Config.UpDownAxis_DownValue + "】目标【" + targetPosition + "】 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_CompressWork);
ComMoveToPosition(moveP.ComPress_P2, true);
ComMoveToPosition(moveP.ComPress_P2, Config.CompAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, targetPosition, Config.UpDownAxis_P4_Speed);
}
else
......@@ -535,7 +505,7 @@ namespace OnlineStore.DeviceLibrary
//Task.Factory.StartNew(delegate { SendLineStatus(); });
StoreMove.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag);
ComMoveToPosition(moveP.ComPress_P3, true);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P4, Config.UpDownAxis_P4_Speed);
Thread.Sleep(100);
}
......@@ -550,7 +520,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_14 返回待机点,轴2/轴1到P1,轴4到P3");
StoreMove.NextMoveStep(StoreMoveStep.SI_14_GoBack);
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
......@@ -578,7 +548,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("送出料盘:SI_22 ,压紧轴到压紧前点 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_23_ComToP3);
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
//if (IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
//{
// InStoreLog("送出料盘:SI_22 ,打开仓门 ");
......@@ -637,7 +607,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库:SIS_32 单盘入库:叉子走到门口位置P4, 打开仓门 ,压紧轴到P3");
StoreMove.NextMoveStep(StoreMoveStep.SIS_32_InoutToDoor);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P4, Config.InOutAxis_P2_Speed);
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
OpenDoorAndWait();
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_32_InoutToDoor))
......@@ -667,7 +637,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SIS_34_GetTray);
CloseDoorAndWait();
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P4_Speed);
ComMoveToPosition(moveP.ComPress_P2);
ComMoveToPosition(moveP.ComPress_P2,Config.CompAxis_P2_Speed);
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_34_GetTray))
......@@ -900,7 +870,7 @@ namespace OnlineStore.DeviceLibrary
}
OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
Thread.Sleep(100);
......@@ -923,7 +893,7 @@ namespace OnlineStore.DeviceLibrary
{
OutStoreLog("出库:SO_05 拿起物品,升降轴至P6(库位出料缓冲点),压紧轴至P2(压紧点) ");
StoreMove.NextMoveStep(StoreMoveStep.SO_05_BagWareToDevice);
ComMoveToPosition(moveP.ComPress_P2, true);
ComMoveToPosition(moveP.ComPress_P2, Config.CompAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P6, Config.UpDownAxis_P6_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_05_BagWareToDevice)
......@@ -986,7 +956,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.NextMoveStep(StoreMoveStep.SO_11_PutTray);
OutStoreLog("出库:SO_11_PutTray 放下料盘,升降轴到P8(出库低点),压紧轴至P3(压紧前点)");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3, true);
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_OutLow_P8, Config.UpDownAxis_P8_Speed);
AutomaticBaiting.BatchOutStoreHeight += StoreMove.MoveParam.PlateH;
AutomaticBaiting.BatchOutStoreCount++;
......@@ -996,7 +966,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.NextMoveStep(StoreMoveStep.SO_21_OpenDoor);
OutStoreLog("出库:SO_21打开仓门,压紧轴至P3(压紧前点),定位气缸下降");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3);
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3,Config.CompAxis_P3_Speed);
OpenDoorAndWait();
LocationDownAndWait();
}
......@@ -1106,7 +1076,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed);
if (IsHasCompress_Axis)
{
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3);
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3, Config.CompAxis_P3_Speed);
}
}
/// <summary>
......@@ -1130,10 +1100,10 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
//此处需要等待吸盘在上升位置
IOManager.IOMove(IO_Type.SuckingDisc_Up, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.SuckingDisc_Down, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW));
IOManager.IOMove(IO_Type.ClampingDisc_Up, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.ClampingDisc_Down, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Down, IO_VALUE.LOW));
}
private void SO_10_DeviceToDoorPro()
{
......
......@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.EndMove();
ClearInStoreInfo();
IOManager.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false);
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, false);
BatchDoorClose(false);
}
/// <summary>
......@@ -214,7 +214,7 @@ namespace OnlineStore.DeviceLibrary
//关闭门,轴回原点,检测
BatchDoorClose(true);
IOManager.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true);
LogUtil.info(Name + "复位中:关闭门锁");
break;
case StoreMoveStep.AUTO_R01_CloseDoor:
......@@ -352,7 +352,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I04_SuckingDisc_Down);
LogUtil.info(Name + "入料: 扫码结束,二维码【" + LastCode + "】 吸盘开始下降");
CylinderMove(IO_Type.SuckingDisc_Down, IO_Type.SuckingDisc_Up, true);
CylinderMove(IO_Type.ClampingDisc_Down, IO_Type.ClampingDisc_Up, true);
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I04_SuckingDisc_Down))
{
......@@ -365,8 +365,8 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up);
LogUtil.info(Name + "入料: 吸盘上升");
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false );
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW));
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, false );
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Down, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
......@@ -390,7 +390,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I07_BatchAxisUp);
LogUtil.info(Name + "入料: 批量轴匀速上升【" + StoreManager.Config.BatchAxis_SlowSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true);
if (StoreManager.Config.Default_TrayWidth.Equals(7))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck1, IO_VALUE.HIGH));
......
......@@ -119,14 +119,14 @@ namespace OnlineStore.DeviceLibrary
//如果是气缸动作,若Do未输出,重新写一遍
if (!wait.IsEnd && span.TotalSeconds > 2)
{
if (wait.IoType.Equals(IO_Type.SuckingDisc_Down) || wait.IoType.Equals(IO_Type.SuckingDisc_Up))
if (wait.IoType.Equals(IO_Type.ClampingDisc_Down) || wait.IoType.Equals(IO_Type.ClampingDisc_Up))
{
IO_VALUE doValue = IOManager.DOValue(wait.IoType);
if (!doValue.Equals(wait.IoValue))
{
LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + wait.IoType + "=" + wait.IoValue + ")");
IOManager.IOMove(wait.IoType, wait.IoValue);
string ioType = wait.IoType.Equals(IO_Type.SuckingDisc_Down) ? IO_Type.SuckingDisc_Up : IO_Type.SuckingDisc_Down;
string ioType = wait.IoType.Equals(IO_Type.ClampingDisc_Down) ? IO_Type.ClampingDisc_Up : IO_Type.ClampingDisc_Down;
IO_VALUE ioValue = wait.IoValue.Equals(IO_VALUE.LOW) ? IO_VALUE.HIGH : IO_VALUE.LOW;
LogUtil.error("等待[" + wait.ToStr() + "],重写气缸DO(" + ioType + "=" + ioValue + ")");
IOManager.IOMove(ioType, ioValue);
......
......@@ -30,24 +30,6 @@ namespace OnlineStore.DeviceLibrary
public StoreManager()
{
}
public static bool OpenShuoKe(AC_SA_BoxBean box)
{
//打开硕科步进驱动器端口
Parity parity = (Parity)box.Config.CompressAxis_PortParity;
StopBits bit = (StopBits)box.Config.CompressAxis_StopBits;
bool result = ShuoKeControls.InitPort(box.Config.CompressAxis_PortName, box.Config.CompressAxis_PortBaudrate,
box.Config.CompressAxis_PortParity, 8, bit);
if (result)
{
LogUtil.info(box.StoreName + "打开硕科步进控制器【" + box.Config.CompressAxis_PortName + "】成功");
return true;
}
else
{
LogUtil.error(LOGGER, box.StoreName + "打开硕科步进控制器【" + box.Config.CompressAxis_PortName + "】失败,启动失败!");
return false;
}
}
public static void CheckEnum(Type type)
{
if (type.IsEnum)
......
......@@ -198,16 +198,16 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = (int)Wait_Type.ShuoKe_5 ;
wait.SlvAddr =(byte) slvAddr;
wait.TargetPosition = targetPosition;
wait.IsHomeMove = isHome;
return wait;
}
//public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount = 0;
// wait.WaitType = (int)Wait_Type.ShuoKe_5 ;
// wait.SlvAddr =(byte) slvAddr;
// wait.TargetPosition = targetPosition;
// wait.IsHomeMove = isHome;
// return wait;
//}
public static WaitResultInfo WaitTime(int MScends)
{
WaitResultInfo wait = new WaitResultInfo();
......
......@@ -114,10 +114,8 @@ namespace OnlineStore.LoadCSVLibrary
/// DI 上料机构门关闭 DoorClose_LoadMaterial X17 DI-21
/// </summary>
public static string DoorClose_LoadMaterial = "DoorClose_LoadMaterial";
/// <summary>
/// 吸盘压力确认信号 SuckingDisc_Air 202 192.168.200.11 0 吸盘压力确认信号 X19 DI-23
/// </summary>
public static string SuckingDisc_Air = "SuckingDisc_Air";
///// <summary>
///// 左侧门关闭 DoorColse_Single X20 DI-24
///// </summary>
......@@ -126,11 +124,11 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// 吸盘气缸上升端 SuckingDisc_Up X07 DI-07
/// </summary>
public static string SuckingDisc_Up = "SuckingDisc_Up";
public static string ClampingDisc_Up = "SuckingDisc_Up";
/// <summary>
/// 吸盘气缸下降端 SuckingDisc_Down X08 DI-08
/// </summary>
public static string SuckingDisc_Down = "SuckingDisc_Down";
public static string ClampingDisc_Down = "SuckingDisc_Down";
/// <summary>
/// 料盘宽度检测1 WidthCheck1 208 X09 DI-09
/// </summary>
......@@ -175,10 +173,7 @@ namespace OnlineStore.LoadCSVLibrary
public static string CameraLight_Power = "CameraLight_Power";
/// <summary>
/// DO 吸盘吸料SOL SuckingDisc_Work 107 192.168.200.10 0 吸盘吸料SOL Y08 DO-08
/// </summary>
public static string SuckingDisc_Work = "SuckingDisc_Work";
/// <summary>
/// DO DisableDoorControl 禁用门禁功能
/// </summary>
......@@ -212,5 +207,35 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
public static string TrayCheck_Door = "TrayCheck_Door";
/// <summary>
/// DI 左侧门关闭 LeftDoorColse_Single
/// </summary>
public static string LeftDoorColse_Single = "LeftDoorColse_Single";
/// <summary>
/// DI 右侧门关闭 RightDoorColse_Single
/// </summary>
public static string RightDoorColse_Single = "RightDoorColse_Single";
/// <summary>
/// 夹爪气缸夹紧端 Clamping_Work
/// </summary>
public static string Clamping_Work = "Clamping_Work";
/// <summary>
/// 夹爪气缸放松端 Clamping_Relax
/// </summary>
public static string Clamping_Relax = "Clamping_Relax";
/// <summary>
/// 吸盘压力确认信号 SuckingDisc_Air 202 192.168.200.11 0 吸盘压力确认信号 X19 DI-23
/// </summary>
public static string SuckingDisc_Air = "SuckingDisc_Air";
/// <summary>
/// DO 吸盘吸料SOL SuckingDisc_Work 107 192.168.200.10 0 吸盘吸料SOL Y08 DO-08
/// </summary>
public static string SuckingDisc_Work = "SuckingDisc_Work";
}
}
......@@ -34,7 +34,26 @@ namespace UserFromControl
pictureBox2.Visible = false;
isCanClick = false;
}
public IOTextControl(string ioName, string name, int widht = 220, int height = 25, int ioValue = 0, bool canClick = false, int tabIndex = 0)
{
InitializeComponent();
if (ImageManager.IsInit == false)
{
ImageManager.Init();
}
this.pictureBox1.BackgroundImage = ImageManager.imgGrey;
this.pictureBox2.BackgroundImage = ImageManager.imgGreen;
pictureBox1.Visible = true;
pictureBox2.Visible = false;
isCanClick = false;
IOName = ioName;
IOValue = IOValue;
isCanClick = canClick;
Name = "IO_" + name;
Size = new System.Drawing.Size(widht, height);
TabIndex = tabIndex;
}
public void ShowData()
{
label1.Text = IOName;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!