Commit 5bda3d61 LN

增加hc板卡代码

1 个父辈 4385548a
正在显示 40 个修改的文件 包含 6751 行增加1345 行删除
......@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "source\Lo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProCopyClient", "ProCopyClient\ProCopyClient.csproj", "{63ED00F8-B7E2-4674-859C-22B11625CAE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuichuanLibrary", "source\HuichuanLibrary\HuichuanLibrary.csproj", "{C9575C5E-9D4B-4B4F-BE41-926652B8985F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -45,6 +47,10 @@ Global
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Release|Any CPU.Build.0 = Release|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -129,6 +129,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="userControl\AxisMoveControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="userControl\AxisMoveControl.Designer.cs">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="FrmAxisDebug.resx">
<DependentUpon>FrmAxisDebug.cs</DependentUpon>
</EmbeddedResource>
......@@ -166,6 +172,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="userControl\AxisMoveControl.resx">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......@@ -190,6 +199,10 @@
<Project>{513bc1c9-800d-43a6-9499-3700baec3554}</Project>
<Name>DeviceLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\HuichuanLibrary\HuichuanLibrary.csproj">
<Project>{C9575C5E-9D4B-4B4F-BE41-926652B8985F}</Project>
<Name>HuichuanLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\LoadCVSLibrary\LoadCSVLibrary.csproj">
<Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project>
<Name>LoadCSVLibrary</Name>
......@@ -221,9 +234,7 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Folder Include="userControl\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
......@@ -31,8 +31,8 @@
<!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10" />
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="0" />
<add key="UseAIOBOX" value="1" />
<add key="HumitureControllerType" value="0" />
<add key ="UseHCBoard" value ="1"/>
<!--流水线地址和端口配置-->
<add key="LineServerIp" value="192.168.8.108" />
<add key="LineServerPort" value="5246" />
......
......@@ -43,12 +43,12 @@ namespace OnlineStore.ACSingleStore
private void AxisMove(ConfigMoveAxis axis, int speed)
{
LogUtil.debug(LOGGER, "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
ACServerManager.SpeedMove(axis.DeviceName, axis.GetAxisValue(), speed);
AxisManager.instance.SpeedMove(axis.DeviceName, axis.GetAxisValue(), speed);
}
private void FrmAxisDebug_Load(object sender, EventArgs e)
{
ACServerManager.ClearSpeed();
AxisManager.instance.ClearSpeed();
txtMiddleSpeed.Text = (middle.TargetSpeed / 5).ToString();
txtInOutSpeed.Text = (inout.TargetSpeed / 5).ToString();
txtUpDownSpeed.Text = (updown.TargetSpeed / 5).ToString();
......@@ -65,7 +65,7 @@ namespace OnlineStore.ACSingleStore
//{
// InOutDefaultPosition = 3000;
//}
int currValue = ACServerManager.GetActualtPosition(inout.DeviceName, inout.GetAxisValue());
int currValue = AxisManager.instance.GetActualtPosition(inout.DeviceName, inout.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
return true;
......@@ -98,7 +98,7 @@ namespace OnlineStore.ACSingleStore
if (btnMiddleMove.BackColor == Color.Green)
{
btnMiddleMove.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(middle.DeviceName, middle.GetAxisValue());
AxisManager.instance.SuddenStop(middle.DeviceName, middle.GetAxisValue());
UpdateMiddlePosition();
}
}
......@@ -127,7 +127,7 @@ namespace OnlineStore.ACSingleStore
if (btnUpDownMove.BackColor == Color.Green)
{
btnUpDownMove.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(updown.DeviceName, updown.GetAxisValue());
AxisManager.instance.SuddenStop(updown.DeviceName, updown.GetAxisValue());
UpdateUpdownPosition();
}
}
......@@ -157,7 +157,7 @@ namespace OnlineStore.ACSingleStore
if (this.btnInOutMove.BackColor == Color.Green)
{
btnInOutMove.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(inout.DeviceName, inout.GetAxisValue());
AxisManager.instance.SuddenStop(inout.DeviceName, inout.GetAxisValue());
UpdateInOutPosition();
}
}
......@@ -185,7 +185,7 @@ namespace OnlineStore.ACSingleStore
if (btnMiddleMovej.BackColor == Color.Green)
{
btnMiddleMovej.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(middle.DeviceName, middle.GetAxisValue());
AxisManager.instance.SuddenStop(middle.DeviceName, middle.GetAxisValue());
UpdateMiddlePosition();
}
}
......@@ -214,7 +214,7 @@ namespace OnlineStore.ACSingleStore
if (btnUpDownMovej.BackColor == Color.Green)
{
btnUpDownMovej.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(updown.DeviceName, updown.GetAxisValue());
AxisManager.instance.SuddenStop(updown.DeviceName, updown.GetAxisValue());
UpdateUpdownPosition();
}
}
......@@ -244,7 +244,7 @@ namespace OnlineStore.ACSingleStore
if (btnInOutMovej.BackColor.Equals(Color.Green))
{
btnInOutMovej.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(inout.DeviceName, inout.GetAxisValue());
AxisManager.instance.SuddenStop(inout.DeviceName, inout.GetAxisValue());
UpdateInOutPosition();
}
}
......@@ -268,7 +268,7 @@ namespace OnlineStore.ACSingleStore
if (this.btnComMove.BackColor == Color.Green)
{
btnComMove.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(comp.DeviceName, comp.GetAxisValue());
AxisManager.instance.SuddenStop(comp.DeviceName, comp.GetAxisValue());
UpdateCompPosition();
}
}
......@@ -289,7 +289,7 @@ namespace OnlineStore.ACSingleStore
if (btnComMovej.BackColor.Equals(Color.Green))
{
btnComMovej.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(comp.DeviceName,comp.GetAxisValue());
AxisManager.instance.SuddenStop(comp.DeviceName,comp.GetAxisValue());
UpdateCompPosition();
}
}
......@@ -317,7 +317,7 @@ namespace OnlineStore.ACSingleStore
}
private void UpdateCompPosition()
{
int compPosition = ACServerManager.GetTargetPosition(comp.DeviceName, comp.GetAxisValue());
int compPosition = AxisManager.instance.GetTargetPosition(comp.DeviceName, comp.GetAxisValue());
if (!txtComPosition.Text.Equals(compPosition.ToString()))
{
txtComPosition.Text = compPosition.ToString();
......@@ -325,7 +325,7 @@ namespace OnlineStore.ACSingleStore
}
private void UpdateUpdownPosition()
{
int updownPosition = ACServerManager.GetTargetPosition(updown.DeviceName, updown.GetAxisValue());
int updownPosition = AxisManager.instance.GetTargetPosition(updown.DeviceName, updown.GetAxisValue());
if (!txtUpdownPosition.Text.Equals(updownPosition.ToString()))
{
txtUpdownPosition.Text = updownPosition.ToString();
......@@ -334,7 +334,7 @@ namespace OnlineStore.ACSingleStore
private void UpdateMiddlePosition()
{
int middlePosition = ACServerManager.GetTargetPosition(middle.DeviceName, middle.GetAxisValue());
int middlePosition = AxisManager.instance.GetTargetPosition(middle.DeviceName, middle.GetAxisValue());
if (!txtMiddlePosition.Text.Equals(middlePosition.ToString()))
{
txtMiddlePosition.Text = middlePosition.ToString();
......@@ -343,7 +343,7 @@ namespace OnlineStore.ACSingleStore
private void UpdateInOutPosition()
{
int inoutPosition = ACServerManager.GetTargetPosition(inout.DeviceName, inout.GetAxisValue());
int inoutPosition = AxisManager.instance.GetTargetPosition(inout.DeviceName, inout.GetAxisValue());
if (!txtInOutPosition.Text.Equals(inoutPosition.ToString()))
{
txtInOutPosition.Text = inoutPosition.ToString();
......@@ -354,7 +354,7 @@ namespace OnlineStore.ACSingleStore
{
int value = trackBar1.Value;
lblSpeed.Text = "点动速度=" + (value / 10f) + "倍目标速度";
ACServerManager.ClearSpeed();
AxisManager.instance.ClearSpeed();
txtMiddleSpeed.Text = (middle.TargetSpeed * value / 10).ToString();
txtInOutSpeed.Text = (inout.TargetSpeed * value / 10).ToString();
txtUpDownSpeed.Text = (updown.TargetSpeed * value / 10).ToString();
......
......@@ -44,7 +44,7 @@ namespace OnlineStore.ACSingleStore
}
return str;
}
internal static string GetCodeNum(string codeName = "RC1250-ACSingleStore")
internal static string GetCodeNum(string codeName = "SO664-HCSingleStore")
{
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = "";
......
......@@ -83,43 +83,7 @@
this.btnUpDownP3 = new System.Windows.Forms.Button();
this.btnUpDownP4 = new System.Windows.Forms.Button();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupAxis = new System.Windows.Forms.GroupBox();
this.label5 = new System.Windows.Forms.Label();
this.txtServoStatue = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.txtLimit2 = new System.Windows.Forms.TextBox();
this.label19 = new System.Windows.Forms.Label();
this.txtLimit1 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.txtHomeSingle = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtHomeStatus = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.txtBusyStatus = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtAlarmStatus = new System.Windows.Forms.TextBox();
this.btnGetAlarm = new System.Windows.Forms.Button();
this.btnReadPosition = new System.Windows.Forms.Button();
this.label8 = new System.Windows.Forms.Label();
this.btnOpenAxis = new System.Windows.Forms.Button();
this.btnCloseAxis = new System.Windows.Forms.Button();
this.txtP = new System.Windows.Forms.TextBox();
this.txtASpeed = new System.Windows.Forms.TextBox();
this.label47 = new System.Windows.Forms.Label();
this.btnAxisVMove = new System.Windows.Forms.Button();
this.btnAxisRMove = new System.Windows.Forms.Button();
this.btnAxisReturnHome = new System.Windows.Forms.Button();
this.btnAxisAMove = new System.Windows.Forms.Button();
this.btnComAlarmClear = new System.Windows.Forms.Button();
this.txtAPosition = new System.Windows.Forms.TextBox();
this.label48 = new System.Windows.Forms.Label();
this.btnAxisStop = new System.Windows.Forms.Button();
this.txtAxisValue = new System.Windows.Forms.TextBox();
this.txtAxisDeviceName = new System.Windows.Forms.TextBox();
this.label45 = new System.Windows.Forms.Label();
this.label46 = new System.Windows.Forms.Label();
this.cmbAxisList = new System.Windows.Forms.ComboBox();
this.label49 = new System.Windows.Forms.Label();
this.axisMoveControl1 = new OnlineStore.AutoCountClient.AxisMoveControl();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txt4Target = new System.Windows.Forms.TextBox();
this.lblTargetP4 = new System.Windows.Forms.TextBox();
......@@ -167,7 +131,6 @@
this.tabPage3.SuspendLayout();
this.groupInout.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupAxis.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox7.SuspendLayout();
......@@ -240,7 +203,7 @@
// btnUpdown
//
this.btnUpdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdown.Location = new System.Drawing.Point(639, 70);
this.btnUpdown.Location = new System.Drawing.Point(743, 64);
this.btnUpdown.Name = "btnUpdown";
this.btnUpdown.Size = new System.Drawing.Size(118, 39);
this.btnUpdown.TabIndex = 14;
......@@ -251,7 +214,7 @@
// btnAxisOff
//
this.btnAxisOff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOff.Location = new System.Drawing.Point(759, 23);
this.btnAxisOff.Location = new System.Drawing.Point(872, 19);
this.btnAxisOff.Name = "btnAxisOff";
this.btnAxisOff.Size = new System.Drawing.Size(116, 39);
this.btnAxisOff.TabIndex = 11;
......@@ -262,7 +225,7 @@
// btnAxisOn
//
this.btnAxisOn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOn.Location = new System.Drawing.Point(639, 23);
this.btnAxisOn.Location = new System.Drawing.Point(743, 19);
this.btnAxisOn.Name = "btnAxisOn";
this.btnAxisOn.Size = new System.Drawing.Size(116, 39);
this.btnAxisOn.TabIndex = 10;
......@@ -273,7 +236,7 @@
// btnAxisP
//
this.btnAxisP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisP.Location = new System.Drawing.Point(881, 23);
this.btnAxisP.Location = new System.Drawing.Point(872, 64);
this.btnAxisP.Name = "btnAxisP";
this.btnAxisP.Size = new System.Drawing.Size(116, 39);
this.btnAxisP.TabIndex = 8;
......@@ -293,14 +256,14 @@
this.tabControl1.Location = new System.Drawing.Point(6, 145);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1071, 467);
this.tabControl1.Size = new System.Drawing.Size(1071, 505);
this.tabControl1.TabIndex = 272;
//
// tabPage4
//
this.tabPage4.Location = new System.Drawing.Point(4, 29);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(1063, 434);
this.tabPage4.Size = new System.Drawing.Size(1063, 472);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = " IO状态查看 ";
this.tabPage4.UseVisualStyleBackColor = true;
......@@ -310,7 +273,7 @@
this.tabPage3.Controls.Add(this.groupInout);
this.tabPage3.Location = new System.Drawing.Point(4, 29);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(1063, 434);
this.tabPage3.Size = new System.Drawing.Size(1063, 472);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = " 库位位置配置 ";
this.tabPage3.UseVisualStyleBackColor = true;
......@@ -367,7 +330,7 @@
this.groupInout.Enabled = false;
this.groupInout.Location = new System.Drawing.Point(3, 3);
this.groupInout.Name = "groupInout";
this.groupInout.Size = new System.Drawing.Size(1053, 425);
this.groupInout.Size = new System.Drawing.Size(1053, 419);
this.groupInout.TabIndex = 100;
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
......@@ -1053,8 +1016,8 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.axisMoveControl1);
this.tabPage1.Controls.Add(this.btnUpdown);
this.tabPage1.Controls.Add(this.groupAxis);
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Controls.Add(this.btnAxisOn);
this.tabPage1.Controls.Add(this.btnAxisOff);
......@@ -1062,477 +1025,17 @@
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1063, 434);
this.tabPage1.Size = new System.Drawing.Size(1063, 472);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服调试 ";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupAxis
//
this.groupAxis.Controls.Add(this.label5);
this.groupAxis.Controls.Add(this.txtServoStatue);
this.groupAxis.Controls.Add(this.label17);
this.groupAxis.Controls.Add(this.txtLimit2);
this.groupAxis.Controls.Add(this.label19);
this.groupAxis.Controls.Add(this.txtLimit1);
this.groupAxis.Controls.Add(this.label6);
this.groupAxis.Controls.Add(this.txtHomeSingle);
this.groupAxis.Controls.Add(this.label11);
this.groupAxis.Controls.Add(this.txtHomeStatus);
this.groupAxis.Controls.Add(this.label10);
this.groupAxis.Controls.Add(this.txtBusyStatus);
this.groupAxis.Controls.Add(this.label2);
this.groupAxis.Controls.Add(this.txtAlarmStatus);
this.groupAxis.Controls.Add(this.btnGetAlarm);
this.groupAxis.Controls.Add(this.btnReadPosition);
this.groupAxis.Controls.Add(this.label8);
this.groupAxis.Controls.Add(this.btnOpenAxis);
this.groupAxis.Controls.Add(this.btnCloseAxis);
this.groupAxis.Controls.Add(this.txtP);
this.groupAxis.Controls.Add(this.txtASpeed);
this.groupAxis.Controls.Add(this.label47);
this.groupAxis.Controls.Add(this.btnAxisVMove);
this.groupAxis.Controls.Add(this.btnAxisRMove);
this.groupAxis.Controls.Add(this.btnAxisReturnHome);
this.groupAxis.Controls.Add(this.btnAxisAMove);
this.groupAxis.Controls.Add(this.btnComAlarmClear);
this.groupAxis.Controls.Add(this.txtAPosition);
this.groupAxis.Controls.Add(this.label48);
this.groupAxis.Controls.Add(this.btnAxisStop);
this.groupAxis.Controls.Add(this.txtAxisValue);
this.groupAxis.Controls.Add(this.txtAxisDeviceName);
this.groupAxis.Controls.Add(this.label45);
this.groupAxis.Controls.Add(this.label46);
this.groupAxis.Controls.Add(this.cmbAxisList);
this.groupAxis.Controls.Add(this.label49);
this.groupAxis.Enabled = false;
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(6, 5);
this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(551, 279);
this.groupAxis.TabIndex = 216;
this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(48, 147);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(59, 17);
this.label5.TabIndex = 326;
this.label5.Text = "伺服状态:";
//
// txtServoStatue
//
this.txtServoStatue.Enabled = false;
this.txtServoStatue.Location = new System.Drawing.Point(113, 144);
this.txtServoStatue.Name = "txtServoStatue";
this.txtServoStatue.Size = new System.Drawing.Size(25, 23);
this.txtServoStatue.TabIndex = 325;
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(155, 248);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(71, 17);
this.label17.TabIndex = 324;
this.label17.Text = "负极限信号:";
this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtLimit2
//
this.txtLimit2.Enabled = false;
this.txtLimit2.Location = new System.Drawing.Point(232, 245);
this.txtLimit2.Name = "txtLimit2";
this.txtLimit2.Size = new System.Drawing.Size(25, 23);
this.txtLimit2.TabIndex = 321;
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(155, 214);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(71, 17);
this.label19.TabIndex = 320;
this.label19.Text = "正极限信号:";
this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtLimit1
//
this.txtLimit1.Enabled = false;
this.txtLimit1.Location = new System.Drawing.Point(232, 211);
this.txtLimit1.Name = "txtLimit1";
this.txtLimit1.Size = new System.Drawing.Size(25, 23);
this.txtLimit1.TabIndex = 317;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(167, 180);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(59, 17);
this.label6.TabIndex = 300;
this.label6.Text = "原点信号:";
//
// txtHomeSingle
//
this.txtHomeSingle.Enabled = false;
this.txtHomeSingle.Location = new System.Drawing.Point(232, 177);
this.txtHomeSingle.Name = "txtHomeSingle";
this.txtHomeSingle.Size = new System.Drawing.Size(25, 23);
this.txtHomeSingle.TabIndex = 297;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(2, 248);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(105, 17);
this.label11.TabIndex = 292;
this.label11.Text = "HOME-CMP状态:";
//
// txtHomeStatus
//
this.txtHomeStatus.Enabled = false;
this.txtHomeStatus.Location = new System.Drawing.Point(113, 245);
this.txtHomeStatus.Name = "txtHomeStatus";
this.txtHomeStatus.Size = new System.Drawing.Size(25, 23);
this.txtHomeStatus.TabIndex = 291;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(41, 214);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(66, 17);
this.label10.TabIndex = 289;
this.label10.Text = "BUSY状态:";
//
// txtBusyStatus
//
this.txtBusyStatus.Enabled = false;
this.txtBusyStatus.Location = new System.Drawing.Point(113, 211);
this.txtBusyStatus.Name = "txtBusyStatus";
this.txtBusyStatus.Size = new System.Drawing.Size(25, 23);
this.txtBusyStatus.TabIndex = 288;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(48, 180);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(59, 17);
this.label2.TabIndex = 286;
this.label2.Text = "报警状态:";
//
// txtAlarmStatus
//
this.txtAlarmStatus.Enabled = false;
this.txtAlarmStatus.Location = new System.Drawing.Point(113, 177);
this.txtAlarmStatus.Name = "txtAlarmStatus";
this.txtAlarmStatus.Size = new System.Drawing.Size(25, 23);
this.txtAlarmStatus.TabIndex = 285;
//
// btnGetAlarm
//
this.btnGetAlarm.BackColor = System.Drawing.SystemColors.Control;
this.btnGetAlarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGetAlarm.Location = new System.Drawing.Point(290, 192);
this.btnGetAlarm.Name = "btnGetAlarm";
this.btnGetAlarm.Size = new System.Drawing.Size(105, 33);
this.btnGetAlarm.TabIndex = 284;
this.btnGetAlarm.Text = "读取伺服状态";
this.btnGetAlarm.UseVisualStyleBackColor = false;
this.btnGetAlarm.Click += new System.EventHandler(this.btnGetAlarm_Click);
//
// btnReadPosition
//
this.btnReadPosition.BackColor = System.Drawing.SystemColors.Control;
this.btnReadPosition.Cursor = System.Windows.Forms.Cursors.Default;
this.btnReadPosition.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReadPosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReadPosition.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnReadPosition.Location = new System.Drawing.Point(428, 227);
this.btnReadPosition.Name = "btnReadPosition";
this.btnReadPosition.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnReadPosition.Size = new System.Drawing.Size(105, 33);
this.btnReadPosition.TabIndex = 278;
this.btnReadPosition.Text = "读取位置";
this.btnReadPosition.UseVisualStyleBackColor = false;
this.btnReadPosition.Click += new System.EventHandler(this.btnReadPosition_Click);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(167, 144);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(59, 17);
this.label8.TabIndex = 255;
this.label8.Text = "实时位置:";
//
// btnOpenAxis
//
this.btnOpenAxis.BackColor = System.Drawing.SystemColors.Control;
this.btnOpenAxis.Cursor = System.Windows.Forms.Cursors.Default;
this.btnOpenAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenAxis.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnOpenAxis.Location = new System.Drawing.Point(319, 18);
this.btnOpenAxis.Name = "btnOpenAxis";
this.btnOpenAxis.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnOpenAxis.Size = new System.Drawing.Size(105, 33);
this.btnOpenAxis.TabIndex = 253;
this.btnOpenAxis.Text = "打开伺服";
this.btnOpenAxis.UseVisualStyleBackColor = false;
this.btnOpenAxis.Click += new System.EventHandler(this.btnOpenAxis_Click);
//
// btnCloseAxis
//
this.btnCloseAxis.BackColor = System.Drawing.SystemColors.Control;
this.btnCloseAxis.Cursor = System.Windows.Forms.Cursors.Default;
this.btnCloseAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAxis.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnCloseAxis.Location = new System.Drawing.Point(428, 18);
this.btnCloseAxis.Name = "btnCloseAxis";
this.btnCloseAxis.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnCloseAxis.Size = new System.Drawing.Size(105, 33);
this.btnCloseAxis.TabIndex = 252;
this.btnCloseAxis.Text = "关闭伺服";
this.btnCloseAxis.UseVisualStyleBackColor = false;
this.btnCloseAxis.Click += new System.EventHandler(this.btnCloseAxis_Click);
//
// txtP
//
this.txtP.Location = new System.Drawing.Point(232, 141);
this.txtP.Name = "txtP";
this.txtP.ReadOnly = true;
this.txtP.Size = new System.Drawing.Size(87, 23);
this.txtP.TabIndex = 38;
//
// txtASpeed
//
this.txtASpeed.AcceptsReturn = true;
this.txtASpeed.BackColor = System.Drawing.SystemColors.Window;
this.txtASpeed.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtASpeed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtASpeed.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtASpeed.Location = new System.Drawing.Point(222, 98);
this.txtASpeed.MaxLength = 12;
this.txtASpeed.Name = "txtASpeed";
this.txtASpeed.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtASpeed.Size = new System.Drawing.Size(87, 23);
this.txtASpeed.TabIndex = 251;
this.txtASpeed.Text = "30";
//
// label47
//
this.label47.Cursor = System.Windows.Forms.Cursors.Default;
this.label47.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label47.ForeColor = System.Drawing.SystemColors.ControlText;
this.label47.Location = new System.Drawing.Point(167, 99);
this.label47.Name = "label47";
this.label47.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label47.Size = new System.Drawing.Size(53, 20);
this.label47.TabIndex = 250;
this.label47.Text = "速度:";
this.label47.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnAxisVMove
//
this.btnAxisVMove.BackColor = System.Drawing.SystemColors.Control;
this.btnAxisVMove.Cursor = System.Windows.Forms.Cursors.Default;
this.btnAxisVMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisVMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisVMove.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisVMove.Location = new System.Drawing.Point(319, 93);
this.btnAxisVMove.Name = "btnAxisVMove";
this.btnAxisVMove.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisVMove.Size = new System.Drawing.Size(105, 33);
this.btnAxisVMove.TabIndex = 249;
this.btnAxisVMove.Text = "匀速运动";
this.btnAxisVMove.UseVisualStyleBackColor = false;
this.btnAxisVMove.Click += new System.EventHandler(this.btnAxisVMove_Click);
//
// btnAxisRMove
//
this.btnAxisRMove.BackColor = System.Drawing.SystemColors.Control;
this.btnAxisRMove.Cursor = System.Windows.Forms.Cursors.Default;
this.btnAxisRMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisRMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisRMove.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisRMove.Location = new System.Drawing.Point(428, 56);
this.btnAxisRMove.Name = "btnAxisRMove";
this.btnAxisRMove.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisRMove.Size = new System.Drawing.Size(105, 33);
this.btnAxisRMove.TabIndex = 248;
this.btnAxisRMove.Text = "相对运动";
this.btnAxisRMove.UseVisualStyleBackColor = false;
this.btnAxisRMove.Click += new System.EventHandler(this.btnAxisRMove_Click);
//
// btnAxisReturnHome
//
this.btnAxisReturnHome.BackColor = System.Drawing.SystemColors.Control;
this.btnAxisReturnHome.Cursor = System.Windows.Forms.Cursors.Default;
this.btnAxisReturnHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisReturnHome.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisReturnHome.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisReturnHome.Location = new System.Drawing.Point(428, 136);
this.btnAxisReturnHome.Name = "btnAxisReturnHome";
this.btnAxisReturnHome.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisReturnHome.Size = new System.Drawing.Size(105, 33);
this.btnAxisReturnHome.TabIndex = 247;
this.btnAxisReturnHome.Text = "原点返回";
this.btnAxisReturnHome.UseVisualStyleBackColor = false;
this.btnAxisReturnHome.Click += new System.EventHandler(this.btnAxisReturnHome_Click);
//
// btnAxisAMove
//
this.btnAxisAMove.BackColor = System.Drawing.SystemColors.Control;
this.btnAxisAMove.Cursor = System.Windows.Forms.Cursors.Default;
this.btnAxisAMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisAMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisAMove.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisAMove.Location = new System.Drawing.Point(319, 56);
this.btnAxisAMove.Name = "btnAxisAMove";
this.btnAxisAMove.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisAMove.Size = new System.Drawing.Size(105, 33);
this.btnAxisAMove.TabIndex = 245;
this.btnAxisAMove.Text = "绝对运动";
this.btnAxisAMove.UseVisualStyleBackColor = false;
this.btnAxisAMove.Click += new System.EventHandler(this.btnAxisAMove_Click);
//
// btnComAlarmClear
//
this.btnComAlarmClear.BackColor = System.Drawing.SystemColors.Control;
this.btnComAlarmClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnComAlarmClear.Location = new System.Drawing.Point(290, 231);
this.btnComAlarmClear.Name = "btnComAlarmClear";
this.btnComAlarmClear.Size = new System.Drawing.Size(105, 33);
this.btnComAlarmClear.TabIndex = 50;
this.btnComAlarmClear.Text = "清除报警";
this.btnComAlarmClear.UseVisualStyleBackColor = false;
this.btnComAlarmClear.Click += new System.EventHandler(this.btnComAlarmClear_Click);
//
// txtAPosition
//
this.txtAPosition.BackColor = System.Drawing.SystemColors.Window;
this.txtAPosition.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtAPosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAPosition.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtAPosition.Location = new System.Drawing.Point(222, 61);
this.txtAPosition.MaxLength = 12;
this.txtAPosition.Name = "txtAPosition";
this.txtAPosition.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtAPosition.Size = new System.Drawing.Size(87, 23);
this.txtAPosition.TabIndex = 244;
this.txtAPosition.Text = "3000";
//
// label48
//
this.label48.Cursor = System.Windows.Forms.Cursors.Default;
this.label48.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label48.ForeColor = System.Drawing.SystemColors.ControlText;
this.label48.Location = new System.Drawing.Point(167, 62);
this.label48.Name = "label48";
this.label48.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label48.Size = new System.Drawing.Size(53, 20);
this.label48.TabIndex = 243;
this.label48.Text = "位置:";
this.label48.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnAxisStop
//
this.btnAxisStop.BackColor = System.Drawing.SystemColors.Control;
this.btnAxisStop.Cursor = System.Windows.Forms.Cursors.Default;
this.btnAxisStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisStop.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisStop.Location = new System.Drawing.Point(428, 93);
this.btnAxisStop.Name = "btnAxisStop";
this.btnAxisStop.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisStop.Size = new System.Drawing.Size(105, 33);
this.btnAxisStop.TabIndex = 246;
this.btnAxisStop.Text = " 停止运动";
this.btnAxisStop.UseVisualStyleBackColor = false;
this.btnAxisStop.Click += new System.EventHandler(this.btnAxisStop_Click);
//
// txtAxisValue
//
this.txtAxisValue.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAxisValue.Location = new System.Drawing.Point(86, 96);
this.txtAxisValue.MaxLength = 10;
this.txtAxisValue.Name = "txtAxisValue";
this.txtAxisValue.ReadOnly = true;
this.txtAxisValue.Size = new System.Drawing.Size(75, 26);
this.txtAxisValue.TabIndex = 242;
this.txtAxisValue.Text = "0";
//
// txtAxisDeviceName
//
this.txtAxisDeviceName.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAxisDeviceName.Location = new System.Drawing.Point(86, 59);
this.txtAxisDeviceName.MaxLength = 10;
this.txtAxisDeviceName.Name = "txtAxisDeviceName";
this.txtAxisDeviceName.ReadOnly = true;
this.txtAxisDeviceName.Size = new System.Drawing.Size(75, 26);
this.txtAxisDeviceName.TabIndex = 241;
this.txtAxisDeviceName.Text = "0";
//
// label45
//
this.label45.AutoSize = true;
this.label45.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label45.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label45.Location = new System.Drawing.Point(29, 64);
this.label45.Name = "label45";
this.label45.Size = new System.Drawing.Size(47, 17);
this.label45.TabIndex = 240;
this.label45.Text = "端口号:";
this.label45.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label46
//
this.label46.AutoSize = true;
this.label46.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label46.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label46.Location = new System.Drawing.Point(41, 101);
this.label46.Name = "label46";
this.label46.Size = new System.Drawing.Size(35, 17);
this.label46.TabIndex = 239;
this.label46.Text = "地址:";
this.label46.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmbAxisList
//
this.cmbAxisList.DisplayMember = "ProName";
this.cmbAxisList.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
this.cmbAxisList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAxisList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbAxisList.FormattingEnabled = true;
this.cmbAxisList.ItemHeight = 25;
this.cmbAxisList.Location = new System.Drawing.Point(88, 19);
this.cmbAxisList.Name = "cmbAxisList";
this.cmbAxisList.Size = new System.Drawing.Size(220, 31);
this.cmbAxisList.TabIndex = 234;
this.cmbAxisList.ValueMember = "ProName";
this.cmbAxisList.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cmbAxisList_DrawItem);
this.cmbAxisList.SelectedIndexChanged += new System.EventHandler(this.cmbAxisList_SelectedIndexChanged);
//
// label49
//
this.label49.AutoSize = true;
this.label49.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label49.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label49.Location = new System.Drawing.Point(27, 25);
this.label49.Name = "label49";
this.label49.Size = new System.Drawing.Size(51, 17);
this.label49.TabIndex = 233;
this.label49.Text = "AC伺服:";
this.label49.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// axisMoveControl1
//
this.axisMoveControl1.Location = new System.Drawing.Point(6, 6);
this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(731, 429);
this.axisMoveControl1.TabIndex = 218;
//
// groupBox1
//
......@@ -1556,9 +1059,9 @@
this.groupBox1.Controls.Add(this.label43);
this.groupBox1.Controls.Add(this.label42);
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(6, 288);
this.groupBox1.Location = new System.Drawing.Point(603, 311);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(551, 136);
this.groupBox1.Size = new System.Drawing.Size(487, 136);
this.groupBox1.TabIndex = 217;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
......@@ -1737,10 +1240,10 @@
this.tabPage2.Controls.Add(this.btnCloseDoor);
this.tabPage2.Controls.Add(this.groupBox2);
this.tabPage2.Controls.Add(this.lblMoveEquipInfo);
this.tabPage2.Location = new System.Drawing.Point(4, 29);
this.tabPage2.Location = new System.Drawing.Point(4, 26);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1063, 434);
this.tabPage2.Size = new System.Drawing.Size(1063, 475);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 温湿度 ";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -2011,7 +1514,7 @@
// FrmBox
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1089, 615);
this.ClientSize = new System.Drawing.Size(1089, 653);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.groupBox3);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -2029,8 +1532,6 @@
this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout();
this.tabPage1.ResumeLayout(false);
this.groupAxis.ResumeLayout(false);
this.groupAxis.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPage2.ResumeLayout(false);
......@@ -2058,9 +1559,6 @@
private System.Windows.Forms.ComboBox cmbPosition;
private System.Windows.Forms.Label label43;
private System.Windows.Forms.Label label42;
private System.Windows.Forms.TextBox txtP;
private System.Windows.Forms.Button btnComAlarmClear;
private System.Windows.Forms.GroupBox groupAxis;
public System.Windows.Forms.Button btnComP1;
public System.Windows.Forms.TextBox txtComP1;
public System.Windows.Forms.Button btnInOutP2;
......@@ -2093,32 +1591,14 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtAxisValue;
private System.Windows.Forms.TextBox txtAxisDeviceName;
private System.Windows.Forms.Label label45;
private System.Windows.Forms.Label label46;
private System.Windows.Forms.ComboBox cmbAxisList;
private System.Windows.Forms.Label label49;
public System.Windows.Forms.TextBox txtASpeed;
public System.Windows.Forms.Label label47;
public System.Windows.Forms.Button btnAxisVMove;
public System.Windows.Forms.Button btnAxisRMove;
public System.Windows.Forms.Button btnAxisReturnHome;
public System.Windows.Forms.Button btnAxisAMove;
public System.Windows.Forms.TextBox txtAPosition;
public System.Windows.Forms.Label label48;
public System.Windows.Forms.Button btnAxisStop;
private System.Windows.Forms.Label lblThisSta;
private System.Windows.Forms.Button btnSavePosition;
public System.Windows.Forms.Button btnCloseAxis;
public System.Windows.Forms.Button btnOpenAxis;
private System.Windows.Forms.TextBox lblTargetP3;
private System.Windows.Forms.TextBox lblActual3;
private System.Windows.Forms.TextBox lblTargetP2;
private System.Windows.Forms.TextBox lblActual2;
private System.Windows.Forms.TextBox lblTargetP1;
private System.Windows.Forms.TextBox lblActual1;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtJiange;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button btnStartAuTo;
......@@ -2128,18 +1608,8 @@
private System.Windows.Forms.TextBox txtUpdownTarget;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label lblWarnMsg;
public System.Windows.Forms.Button btnReadPosition;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtHomeStatus;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtBusyStatus;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtAlarmStatus;
private System.Windows.Forms.Button btnGetAlarm;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label lblTemp;
private System.Windows.Forms.TextBox txtHomeSingle;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
......@@ -2163,12 +1633,6 @@
private System.Windows.Forms.CheckBox chbDebug;
private System.Windows.Forms.Label lblMoveEquipInfo;
private System.Windows.Forms.Button btnUpdown;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.TextBox txtLimit2;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.TextBox txtLimit1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtServoStatue;
private System.Windows.Forms.TextBox txt4Target;
private System.Windows.Forms.TextBox lblTargetP4;
private System.Windows.Forms.TextBox lblActual4;
......@@ -2185,6 +1649,7 @@
private System.Windows.Forms.Button button5;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private AutoCountClient.AxisMoveControl axisMoveControl1;
}
}
......@@ -59,11 +59,7 @@ namespace OnlineStore.ACSingleStore
this.Close();
return;
}
//txtSpeed.Text = store.Config.CompressAxis_EndSpeed.ToString();
cmbAxisList.DataSource = new List<ConfigMoveAxis>(boxBean.moveAxisList);
cmbAxisList.DisplayMember = "Explain";
cmbAxisList.ValueMember = "Explain";
cmbAxisList.SelectedIndex = 0;
ACStorePosition ktkPosition = null;
if (boxBean.PositionNumList.Count > 0)
......@@ -229,22 +225,13 @@ namespace OnlineStore.ACSingleStore
}
lblWarnMsg.Text = boxBean.WarnMsg;
//if (store.Config.IsHasDoorLimit.Equals(1))
//{
// if (IOManager.IOValue(IO_Type.Door_LimitSingle).Equals(IO_VALUE.LOW))
// {
// lblWarnMsg.Text = lblWarnMsg.Text + " 前门未关";
// }
//}
//如果不在出入库中,且叉子上有信号,需要提示检查叉子
if (boxBean.storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
lblWarnMsg.Text = lblWarnMsg.Text + " 叉子料盘检测有料,请检查";
}
//if (IOManager.IOValue(IO_Type.DoorLimit).Equals(IO_VALUE.LOW))
//{
// lblWarnMsg.Text = lblWarnMsg.Text + " 无门禁信号,请检查";
//}
if (boxBean.TempOrHumidityIsAlarm)
{
lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + boxBean.TempAlarmTime.ToLongTimeString() + "]";
......@@ -305,69 +292,23 @@ namespace OnlineStore.ACSingleStore
}
}
private void ReadPosistion()
{
string portName = GetPortName();
int SlvAddr = GetSlaveAddr();
//判断私服是否打开、
if (ACServerManager.ServerOnStatus(portName, SlvAddr))
{
txtServoStatue.Text = "✔";
}
else
{
txtServoStatue.Text = "✘";
}
ReadA(boxBean.Config.Middle_Axis, lblActual1, lblTargetP1, txtMiddleTarget);
ReadA(boxBean.Config.UpDown_Axis, lblActual2, lblTargetP2, txtUpdownTarget);
ReadA(boxBean.Config.InOut_Axis, lblActual3, lblTargetP3, txtInoutTarget);
ReadA(boxBean.Config.Comp_Axis, lblActual4, lblTargetP4, txt4Target);
}
private void ReadA(ConfigMoveAxis axis,TextBox lblActual, TextBox lblTarget,TextBox lblT )
{
string portName = GetPortName();
int SlvAddr = GetSlaveAddr();
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
if (AxisManager.instance.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{
//sta.IOValue = ACServerManager.GetAlarmStatus(axis.DeviceName, axis.GetAxisValue());
int tP = ACServerManager.GetTargetPosition(axis.DeviceName, axis.GetAxisValue());
//sta.IOValue = AxisManager.instance.GetAlarmStatus(axis.DeviceName, axis.GetAxisValue());
int tP = AxisManager.instance.GetTargetPosition(axis.DeviceName, axis.GetAxisValue());
lblTarget.Text = string.Format("{0:d}", tP);
int aP = ACServerManager.GetActualtPosition(axis.DeviceName, axis.GetAxisValue());
int aP = AxisManager.instance.GetActualtPosition(axis.DeviceName, axis.GetAxisValue());
lblActual.Text = string.Format("{0:d}", aP);
lblT.Text = axis.TargetPosition.ToString();
if (axis.IsSameAxis(portName, SlvAddr))
{
txtP.Text = lblActual.Text;
}
}
}
private void Bt_ClearCounter_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
//KTKSMCManager.WSetCountPulse(portName, SlvAddr, 0);
//KTKSMCManager.WSetOutPulse(portName, SlvAddr, 0);
}
private void FunctionFail(System.Int32 ReturnCode)
{
if (ReturnCode != 0)
{
MessageBox.Show("错误码:" + ReturnCode.ToString(), "", MessageBoxButtons.OK);
LogUtil.error(LOGGER, "错误码:" + ReturnCode.ToString());
}
}
private void FunctionFail(string funName, System.Int32 ReturnCode)
{
if (ReturnCode != 0)
{
MessageBox.Show("方法:" + funName + ",错误码:" + ReturnCode.ToString(), "", MessageBoxButtons.OK);
LogUtil.error(LOGGER, "方法:" + funName + ",错误码:" + ReturnCode.ToString());
}
}
private void FrmTest_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)//当用户点击窗体右上角X按钮或(Alt + F4)时 发生
......@@ -428,15 +369,7 @@ namespace OnlineStore.ACSingleStore
// ktk.UpDown_P9 = FormUtil.GetIntValue(txtUpDownP9);
return ktk;
}
private void btnComAlarmClear_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
short slvAddr = FormUtil.GetShortValue(txtAxisValue);
LogUtil.info("点击【清理报警】,端口号【" + portName + "】地址【" + slvAddr + "】 ");
ACServerManager.AlarmClear(portName, slvAddr);
Thread.Sleep(100);
ACServerManager.ServoOn(portName, slvAddr);
}
private void cmbPosition_SelectedIndexChanged(object sender, EventArgs e)
{
......@@ -467,149 +400,7 @@ namespace OnlineStore.ACSingleStore
}
}
}
private void cmbAxisList_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.cmbAxisList.SelectedIndex >= 0)
{
ConfigMoveAxis axis = boxBean.moveAxisList[cmbAxisList.SelectedIndex];
txtAxisDeviceName.Text = axis.DeviceName;
txtAxisValue.Text = axis.GetAxisValue().ToString();
txtASpeed.Text = axis.TargetSpeed.ToString();
Color color = Color.Black;
if (boxBean.Config.Middle_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Red;
}
else if (boxBean.Config.UpDown_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Blue;
}
else if (boxBean.Config.InOut_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Green;
}
else if (boxBean.Config.Comp_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Purple;
}
btnOpenAxis.ForeColor = color;
btnCloseAxis.ForeColor = color;
btnAxisAMove.ForeColor = color;
btnAxisRMove.ForeColor = color;
btnAxisVMove.ForeColor = color;
btnAxisReturnHome.ForeColor = color;
btnAxisStop.ForeColor = color;
btnComAlarmClear.ForeColor = color;
btnReadPosition.ForeColor = color;
btnGetAlarm.ForeColor = color;
}
}
private void btnAxisAMove_Click(object sender, EventArgs e)
{
//ConfigMoveAxis axisC = store.moveAxisList[cmbAxisList.SelectedIndex];
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
int position = FormUtil.GetIntValue(txtAPosition);
int speed = FormUtil.GetIntValue(txtASpeed);
//if (axisC.PositionIsHasLimit() && (axisC.PositionMin > position || axisC.PositionMax < position))
//{
// MessageBox.Show("位置超出" + axisC.Explain + "上下限(" + axisC.PositionMin + "-" + axisC.PositionMax + ")");
// return;
//}
if ( boxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (boxBean.InOutAxisCanMove().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if ( boxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || boxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{
if (!InOutIsIsP1())
{
return;
}
}
LogUtil.info("点击【绝对运动】,端口号【"+ portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.AbsMove(portName, SlvAddr, position, speed );
}
private void btnAxisVMove_Click(object sender, EventArgs e)
{
//ConfigMoveAxis axisC = store.moveAxisList[cmbAxisList.SelectedIndex];
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
int speed = FormUtil.GetIntValue(txtASpeed);
if (boxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (boxBean.InOutAxisCanMove().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if (boxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || boxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{
if (!InOutIsIsP1())
{
return;
}
}
LogUtil.info("点击【匀速运动】,端口号【" + portName + "】地址【" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.SpeedMove(portName, SlvAddr, speed);
}
private void btnAxisRMove_Click(object sender, EventArgs e)
{
//ConfigMoveAxis axisC = store.moveAxisList[cmbAxisList.SelectedIndex];
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
int position = FormUtil.GetIntValue(txtAPosition);
int speed = FormUtil.GetIntValue(txtASpeed);
//int currPositon = ACServerManager.GetActualtPosition(portName, SlvAddr);
// int newPosition = position + currPositon;
// if (axisC.PositionIsHasLimit() && (axisC.PositionMin > newPosition || axisC.PositionMax < newPosition))
//{
// MessageBox.Show("位置超出"+axisC.Explain+"上下限(" + axisC.PositionMin + "-" + axisC.PositionMax + ")");
// return;
//}
if (boxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (boxBean.InOutAxisCanMove().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if (boxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || boxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{
if (!InOutIsIsP1())
{
return;
}
}
LogUtil.info("点击【相对运动】,端口号【" + portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.RelMove(portName, SlvAddr, position, speed);
}
private void btnAxisStop_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
LogUtil.info("点击【停止运动】,端口号【" + portName + "】地址【" + SlvAddr + "】 ");
ACServerManager.SuddenStop(portName, SlvAddr);
}
private void cmbAxisList_DrawItem(object sender, DrawItemEventArgs e)
{
if (e.Index < 0)
{
return;
}
e.DrawBackground();
e.DrawFocusRectangle();
if (this.cmbAxisList.Items.Count > e.Index)
{
ConfigMoveAxis SlvAddr = (ConfigMoveAxis)cmbAxisList.Items[e.Index];
e.Graphics.DrawString(SlvAddr.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
}
}
private void btnSavePosition_Click(object sender, EventArgs e)
{
//料仓格子位置保存
......@@ -706,43 +497,22 @@ namespace OnlineStore.ACSingleStore
}
private void btnOpenAxis_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
LogUtil.info("点击【打开伺服】,端口号【" + portName + "】地址【" + SlvAddr + "】 ");
ACServerManager.OpenPort(portName);
//ACServerManager.InitSlvAddr(portName, SlvAddr);
//Thread.Sleep(100);
ACServerManager.AlarmClear(portName, SlvAddr);
Thread.Sleep(100);
ACServerManager.ServoOn(portName, SlvAddr);
}
/// <summary>
/// 判断进出轴是否在P1点
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int currValue = ACServerManager.GetActualtPosition(boxBean.Config.InOut_Axis.DeviceName, boxBean.Config.InOut_Axis.GetAxisValue());
int currValue = AxisManager.instance.GetActualtPosition(boxBean.Config.InOut_Axis.DeviceName, boxBean.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
return true;
}
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位("+InOutDefaultPosition+")", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
private void btnCloseAxis_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
LogUtil.info("点击【关闭伺服】,端口号【" + portName + "】地址【" + SlvAddr + "】 ");
ACServerManager.ServoOff(portName, SlvAddr);
}
}
private void AxisABSMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{
moveAxis.TargetPosition = targetPosition;
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
AxisManager.instance.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
}
private void btnUpDownP1_Click(object sender, EventArgs e)
{
......@@ -814,14 +584,7 @@ namespace OnlineStore.ACSingleStore
AxisABSMove(boxBean.Config.UpDown_Axis, value, boxBean.Config.UpDownAxis_P6_Speed);
}
}
//private void btnUpDownP9_Click(object sender, EventArgs e)
//{
// if (InOutIsIsP1())
// {
// int value = FormUtil.GetIntValue(txtUpDownP9);
// AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P5_Speed);
// }
//}
private void btnMiddleP1_Click(object sender, EventArgs e)
{
if (InOutIsIsP1())
......@@ -1052,59 +815,12 @@ namespace OnlineStore.ACSingleStore
this.btnMiddleP1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.btnMiddleP2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
axisMoveControl1.LoadData(boxBean);
}
private int GetSlaveAddr()
{
return FormUtil.GetShortValue(txtAxisValue);
}
private string GetPortName()
{
return txtAxisDeviceName.Text;
}
private void btnAxisReturnHome_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
if (boxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (boxBean.InOutAxisCanMove().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if (boxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || boxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{
if (!InOutIsIsP1())
{
return;
}
}
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【原点返回】,端口号【" + portName + "】地址【" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.HomeMove(portName, SlvAddr, speed);
}
private void btnReadPosition_Click(object sender, EventArgs e)
{
ReadPosistion();
}
private void btnGetAlarm_Click(object sender, EventArgs e)
{
string PortName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
txtServoStatue.Text = ACServerManager.ServerOnStatus(PortName, SlvAddr) ? "✔" : "✘";
this.txtAlarmStatus.Text = ACServerManager.GetAlarmStatus(PortName, SlvAddr).ToString();
this.txtBusyStatus.Text = ACServerManager.GetBusyStatus(PortName, SlvAddr).ToString();
this.txtHomeStatus.Text = ACServerManager.GetHomeEndStatus(PortName, SlvAddr).ToString();
this.txtHomeSingle.Text = ACServerManager.GetHomeSingle(PortName, SlvAddr).ToString();
this.txtLimit1.Text = ACServerManager.GetLimitPositiveSingle(PortName, SlvAddr).ToString();
this.txtLimit2.Text = ACServerManager.GetLimitNegativeSingle(PortName, SlvAddr).ToString();
}
private void ExitApp()
{
try
......@@ -1117,12 +833,12 @@ namespace OnlineStore.ACSingleStore
{
stop_button_Click(null, null);
}
axisMoveControl1.StopTimer( );
IOManager.instance.CloseAllDO();
StoreOpenStatus(false);
IOManager.instance.CloseAllConnection();
ACServerManager.CloseAllPort();
AxisManager.instance.CloseAllPort();
// KNDAIManager.CloseAllConnection();
//WCFControl.CloseWCF();
System.Environment.Exit(System.Environment.ExitCode);
......@@ -1140,18 +856,7 @@ namespace OnlineStore.ACSingleStore
{
ExitApp();
}
}
/// <summary>
/// 隐藏窗口
/// </summary>
//private void HideForm()
//{
// this.Opacity = 0;
// this.ShowInTaskbar = false;
// this.notifyIcon1.Visible = true;
// this.Hide();
// DebugStatus(false);
//}
}
private void FrmStoreBox_FormClosed(object sender, FormClosedEventArgs e)
{
ExitApp();
......@@ -1188,9 +893,7 @@ namespace OnlineStore.ACSingleStore
}
private void btnOpenDoor_Click(object sender, EventArgs e)
{
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
{
boxBean.OpenDoor(false);
}
......@@ -1207,9 +910,7 @@ namespace OnlineStore.ACSingleStore
private void btnCloseDoor_Click(object sender, EventArgs e)
{
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
{
boxBean.CloseDoor(false);
}
......@@ -1295,7 +996,7 @@ namespace OnlineStore.ACSingleStore
ioIP = boxBean.Config.DIList[IO_Type.TrayCheck_Fixture].IO_IP;
ioIndex = boxBean.Config.DIList[IO_Type.TrayCheck_Fixture].GetIOAddr();
}
FrmPositionTool frm = new FrmPositionTool(PortName, slvAddr, ioIP, ioIndex);
FrmPositionTool frm = new FrmPositionTool(boxBean.Config.UpDown_Axis, ioIP, ioIndex);
frm.ShowDialog();
}
......@@ -1367,7 +1068,7 @@ namespace OnlineStore.ACSingleStore
}
public void DebugStatus(bool status)
{
groupAxis.Enabled = status;
axisMoveControl1.Enabled = status;
//groupComAxis.Enabled = status;
groupInout.Enabled = status;
}
......
......@@ -37,9 +37,6 @@
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.chbUseBuzzer = new System.Windows.Forms.CheckBox();
this.chkDebug = new System.Windows.Forms.CheckBox();
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.btnCopyLog = new System.Windows.Forms.Button();
this.btnClearLog = new System.Windows.Forms.Button();
this.logBox = new System.Windows.Forms.RichTextBox();
......@@ -56,7 +53,7 @@
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.开机自动启动软件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.开机自动启动ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.启用蜂鸣器ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
......@@ -64,6 +61,7 @@
this.设置TToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.板卡调试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
......@@ -104,9 +102,6 @@
this.tabPage1.Controls.Add(this.lblServerMsg);
this.tabPage1.Controls.Add(this.groupBox4);
this.tabPage1.Controls.Add(this.groupBox3);
this.tabPage1.Controls.Add(this.chbUseBuzzer);
this.tabPage1.Controls.Add(this.chkDebug);
this.tabPage1.Controls.Add(this.chbAutoRun);
this.tabPage1.Controls.Add(this.btnCopyLog);
this.tabPage1.Controls.Add(this.btnClearLog);
this.tabPage1.Controls.Add(this.logBox);
......@@ -130,9 +125,9 @@
//
this.groupBox4.Controls.Add(this.tableLayoutPanel2);
this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox4.Location = new System.Drawing.Point(6, 119);
this.groupBox4.Location = new System.Drawing.Point(6, 145);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(229, 152);
this.groupBox4.Size = new System.Drawing.Size(229, 179);
this.groupBox4.TabIndex = 199;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "DO列表";
......@@ -149,7 +144,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(218, 132);
this.tableLayoutPanel2.Size = new System.Drawing.Size(218, 159);
this.tableLayoutPanel2.TabIndex = 103;
//
// groupBox3
......@@ -158,7 +153,7 @@
this.groupBox3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox3.Location = new System.Drawing.Point(6, 6);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(229, 107);
this.groupBox3.Size = new System.Drawing.Size(229, 134);
this.groupBox3.TabIndex = 198;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "DI列表";
......@@ -175,44 +170,9 @@
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(218, 87);
this.tableLayoutPanel1.Size = new System.Drawing.Size(218, 114);
this.tableLayoutPanel1.TabIndex = 102;
//
// chbUseBuzzer
//
this.chbUseBuzzer.AutoSize = true;
this.chbUseBuzzer.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbUseBuzzer.Location = new System.Drawing.Point(34, 491);
this.chbUseBuzzer.Name = "chbUseBuzzer";
this.chbUseBuzzer.Size = new System.Drawing.Size(98, 24);
this.chbUseBuzzer.TabIndex = 195;
this.chbUseBuzzer.Text = "启用蜂鸣器";
this.chbUseBuzzer.UseVisualStyleBackColor = true;
//
// chkDebug
//
this.chkDebug.AutoSize = true;
this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(34, 533);
this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(132, 24);
this.chkDebug.TabIndex = 194;
this.chkDebug.Text = "开启DEBUG日志";
this.chkDebug.UseVisualStyleBackColor = true;
this.chkDebug.CheckedChanged += new System.EventHandler(this.chkDebug_CheckedChanged);
//
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
this.chbAutoRun.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRun.Location = new System.Drawing.Point(34, 450);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(140, 24);
this.chbAutoRun.TabIndex = 94;
this.chbAutoRun.Text = "开机自动启动软件";
this.chbAutoRun.UseVisualStyleBackColor = true;
this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged);
//
// btnCopyLog
//
this.btnCopyLog.BackColor = System.Drawing.Color.White;
......@@ -351,7 +311,7 @@
// toolStripMenuItem4
//
this.toolStripMenuItem4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.开机自动启动软件ToolStripMenuItem,
this.开机自动启动ToolStripMenuItem,
this.toolStripSeparator10,
this.启用蜂鸣器ToolStripMenuItem,
this.toolStripSeparator11,
......@@ -360,39 +320,43 @@
this.toolStripMenuItem4.Size = new System.Drawing.Size(86, 25);
this.toolStripMenuItem4.Text = "运行参数";
//
// 开机自动启动软件ToolStripMenuItem
// 开机自动启动ToolStripMenuItem
//
this.开机自动启动软件ToolStripMenuItem.Name = "开机自动启动软件ToolStripMenuItem";
this.开机自动启动软件ToolStripMenuItem.Size = new System.Drawing.Size(208, 26);
this.开机自动启动软件ToolStripMenuItem.Text = "开机自动启动软件";
this.开机自动启动ToolStripMenuItem.Name = "开机自动启动ToolStripMenuItem";
this.开机自动启动ToolStripMenuItem.Size = new System.Drawing.Size(199, 26);
this.开机自动启动ToolStripMenuItem.Text = "开机自动启动";
this.开机自动启动ToolStripMenuItem.Click += new System.EventHandler(this.开机自动启动ToolStripMenuItem_Click);
//
// toolStripSeparator10
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(205, 6);
this.toolStripSeparator10.Size = new System.Drawing.Size(196, 6);
//
// 启用蜂鸣器ToolStripMenuItem
//
this.启用蜂鸣器ToolStripMenuItem.Name = "启用蜂鸣器ToolStripMenuItem";
this.启用蜂鸣器ToolStripMenuItem.Size = new System.Drawing.Size(208, 26);
this.启用蜂鸣器ToolStripMenuItem.Size = new System.Drawing.Size(199, 26);
this.启用蜂鸣器ToolStripMenuItem.Text = "启用蜂鸣器";
this.启用蜂鸣器ToolStripMenuItem.Click += new System.EventHandler(this.启用蜂鸣器ToolStripMenuItem_Click);
//
// toolStripSeparator11
//
this.toolStripSeparator11.Name = "toolStripSeparator11";
this.toolStripSeparator11.Size = new System.Drawing.Size(205, 6);
this.toolStripSeparator11.Size = new System.Drawing.Size(196, 6);
//
// 开启DEBUG日志ToolStripMenuItem
//
this.开启DEBUG日志ToolStripMenuItem.Name = "开启DEBUG日志ToolStripMenuItem";
this.开启DEBUG日志ToolStripMenuItem.Size = new System.Drawing.Size(208, 26);
this.开启DEBUG日志ToolStripMenuItem.Size = new System.Drawing.Size(199, 26);
this.开启DEBUG日志ToolStripMenuItem.Text = "开启DEBUG日志";
this.开启DEBUG日志ToolStripMenuItem.Click += new System.EventHandler(this.开启DEBUG日志ToolStripMenuItem_Click);
//
// 设置TToolStripMenuItem
//
this.设置TToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem2,
this.toolStripSeparator6,
this.板卡调试ToolStripMenuItem,
this.toolStripSeparator7});
this.设置TToolStripMenuItem.Name = "设置TToolStripMenuItem";
this.设置TToolStripMenuItem.Size = new System.Drawing.Size(91, 25);
......@@ -401,19 +365,26 @@
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(144, 26);
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem2.Text = "启用调试";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
//
// 板卡调试ToolStripMenuItem
//
this.板卡调试ToolStripMenuItem.Name = "板卡调试ToolStripMenuItem";
this.板卡调试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.板卡调试ToolStripMenuItem.Text = "板卡调试";
this.板卡调试ToolStripMenuItem.Click += new System.EventHandler(this.板卡调试ToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
//
// 帮助ToolStripMenuItem
//
......@@ -428,19 +399,19 @@
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(144, 26);
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Text = "料仓配置";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
//
// 版本号ToolStripMenuItem
//
this.版本号ToolStripMenuItem.Name = "版本号ToolStripMenuItem";
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.版本号ToolStripMenuItem.Text = "关于软件";
this.版本号ToolStripMenuItem.Click += new System.EventHandler(this.版本号ToolStripMenuItem_Click);
//
......@@ -534,7 +505,6 @@
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Button btnCopyLog;
private System.Windows.Forms.Button btnClearLog;
private System.Windows.Forms.CheckBox chbAutoRun;
private System.Windows.Forms.ToolStripMenuItem 设置TToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 版本号ToolStripMenuItem;
private System.Windows.Forms.TabPage tabPage1;
......@@ -544,12 +514,10 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.Label lblWarnMsg;
private System.Windows.Forms.CheckBox chkDebug;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.CheckBox chbUseBuzzer;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
......@@ -559,11 +527,12 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
private System.Windows.Forms.ToolStripMenuItem 开机自动启动软件ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 开机自动启动ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
private System.Windows.Forms.ToolStripMenuItem 启用蜂鸣器ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
private System.Windows.Forms.ToolStripMenuItem 开启DEBUG日志ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 板卡调试ToolStripMenuItem;
}
}


using HuichuanLibrary;
using log4net;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
......@@ -51,8 +52,24 @@ namespace OnlineStore.ACSingleStore
AddForm(box.Name, frm);
}
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
chbAutoRun.Checked =( ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1));
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
int autoValue = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if (autoValue.Equals(1))
{
开机自动启动ToolStripMenuItem.Text = gouStr + " 开机自动启动";
}
else
{
开机自动启动ToolStripMenuItem.Text = "开机自动启动";
}
if (StoreManager.Store.UseBuzzer)
{
启用蜂鸣器ToolStripMenuItem.Text = gouStr + " 启用蜂鸣器";
}
else
{
启用蜂鸣器ToolStripMenuItem.Text = "启用蜂鸣器";
}
LoadOk = true;
LogUtil.logBox = this.logBox;
this.timer1.Start();
......@@ -193,7 +210,7 @@ namespace OnlineStore.ACSingleStore
IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection();
ACServerManager.CloseAllPort();
AxisManager.instance.CloseAllPort();
//this.Close();
System.Environment.Exit(System.Environment.ExitCode);
......@@ -324,12 +341,7 @@ namespace OnlineStore.ACSingleStore
{
LogUtil.ClearLog();
}
private void debug_enable_checkBox_CheckedChanged(object sender, EventArgs e)
{
LogUtil.debug_opened = chkDebug.Checked;
}
private void btnCopyLog_Click(object sender, EventArgs e)
{
Clipboard.SetDataObject(logBox.Text);
......@@ -392,23 +404,7 @@ namespace OnlineStore.ACSingleStore
LogM();
}
private void chbAutoRun_CheckedChanged(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (chbAutoRun.Checked)
{
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 1);
ManagerUtil.AutoRun(Application.ExecutablePath, true);
}
else
{
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 0);
ManagerUtil.AutoRun(Application.ExecutablePath, false);
}
}
private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
{
......@@ -498,11 +494,7 @@ namespace OnlineStore.ACSingleStore
}
}
private void chkDebug_CheckedChanged(object sender, EventArgs e)
{
LogUtil.debug_opened = chkDebug.Checked;
LogUtil.info("debug_opened:" + chkDebug.Checked);
}
private void logBox_VisibleChanged(object sender, EventArgs e)
{
if (logBox.Visible)
......@@ -534,5 +526,82 @@ namespace OnlineStore.ACSingleStore
LogUtil.error("显示界面出错:" + ex.ToString());
}
}
private string gouStr = "✔";
private void 开机自动启动ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (开机自动启动ToolStripMenuItem.Text.Contains(gouStr))
{
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 0);
ManagerUtil.AutoRun(Application.ExecutablePath, false);
开机自动启动ToolStripMenuItem.Text = "开机自动启动";
}
else
{
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 1);
ManagerUtil.AutoRun(Application.ExecutablePath, true);
开机自动启动ToolStripMenuItem.Text = gouStr + "开机自动启动";
}
LogUtil.info(Name + " 点击:" + 开机自动启动ToolStripMenuItem.Text);
}
private void 启用蜂鸣器ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
bool result = !启用蜂鸣器ToolStripMenuItem.Text.Contains(gouStr);
if (result.Equals(StoreManager.Store.UseBuzzer))
{
return;
}
StoreManager.Store.UseBuzzer = result;
ConfigAppSettings.SaveValue(Setting_Init.UseBuzzer, (StoreManager.Store.UseBuzzer ? 1 : 0));
if (result)
{
启用蜂鸣器ToolStripMenuItem.Text = gouStr + " 启用蜂鸣器";
}
else
{
启用蜂鸣器ToolStripMenuItem.Text = "启用蜂鸣器";
}
LogUtil.info(Name + " 点击:" + 启用蜂鸣器ToolStripMenuItem.Text);
}
private void 开启DEBUG日志ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
bool result = !开启DEBUG日志ToolStripMenuItem.Text.Contains(gouStr);
if (result.Equals(LogUtil.debug_opened))
{
return;
}
LogUtil.debug_opened = result;
if (result)
{
开启DEBUG日志ToolStripMenuItem.Text = gouStr + " 开启DEBUG日志";
}
else
{
开启DEBUG日志ToolStripMenuItem.Text = "开启DEBUG日志";
}
LogUtil.info(Name + " 点击:" + 开启DEBUG日志ToolStripMenuItem.Text);
}
private void 板卡调试ToolStripMenuItem_Click(object sender, EventArgs e)
{
FrmHuiChuanTest frm = new FrmHuiChuanTest();
frm.ShowDialog();
}
}
}
......@@ -21,16 +21,19 @@ namespace OnlineStore.ACSingleStore
{
private string LogName = ResourceCulture.GetString("升降轴位置调试:");
private string PortName = "";
private int SlvAddr = 0;
private short SlvAddr = 0;
private string IoIp = "";
private int IoIndex = 0;
public string Axis_Brake = IO_Type.Axis_Brake;
private System.Timers.Timer toolTimer = new System.Timers.Timer();
public FrmPositionTool(string protName, int slvAddr,string ioIp, int ioIndex)
private ConfigMoveAxis configAxis;
public FrmPositionTool(ConfigMoveAxis axis,string ioIp, int ioIndex)
{
InitializeComponent();
this.PortName = protName;
this.SlvAddr = slvAddr;
this.PortName = axis.DeviceName;
this.SlvAddr = axis.GetAxisValue();
configAxis = axis;
this.IoIp = ioIp;
this.IoIndex = ioIndex;
......@@ -44,11 +47,11 @@ namespace OnlineStore.ACSingleStore
private void Form1_Load(object sender, EventArgs e)
{
ACServerManager.IsShowMsg = false;
AxisManager.instance.IsShowMsg = false;
LogUtil.logBox = this.richTextBox1;
//ACServerManager.richeBox = this.richTextBox1;
//AxisManager.instance.richeBox = this.richTextBox1;
CheckForIllegalCrossThreadCalls = false;
txtPortName.Text = PortName;
......@@ -86,7 +89,7 @@ namespace OnlineStore.ACSingleStore
SaveConfig(tSpeed, tPosition);
//判断伺服是否已经打开
bool isOn = ACServerManager.ServerOnStatus(PortName, SlvAddr);
bool isOn = AxisManager.instance.ServerOnStatus(PortName, SlvAddr);
formStatus(isOn);
timer1.Start();
ioStatusControl1.IOName = ResourceCulture.GetString("检测信号");
......@@ -94,8 +97,8 @@ namespace OnlineStore.ACSingleStore
private void btnServoOn_Click(object sender, EventArgs e)
{
this.PortName = txtPortName.Text;
this.SlvAddr = FormUtil.GetIntValue(txtAddr);
bool result = ACServerManager.OpenPort(PortName);
this.SlvAddr = FormUtil.GetShortValue(txtAddr);
bool result = AxisManager.instance.OpenPort(PortName);
if (!result)
{
MessageBox.Show(ResourceCulture.GetString("打开串口失败"));
......@@ -103,10 +106,10 @@ namespace OnlineStore.ACSingleStore
}
formStatus(true);
ACServerManager.InitSlvAddr(PortName, SlvAddr);
AxisManager.instance.InitSlvAddr(PortName, SlvAddr);
Thread.Sleep(100);
ACServerManager.AlarmClear(PortName, SlvAddr);
ACServerManager.ServoOn(PortName, SlvAddr);
AxisManager.instance.AlarmClear(PortName, SlvAddr);
AxisManager.instance.ServoOn(PortName, SlvAddr);
try
{
......@@ -122,7 +125,7 @@ namespace OnlineStore.ACSingleStore
{
StopTimer();
// toolTimer.Stop();
ACServerManager.SuddenStop(PortName, SlvAddr);
AxisManager.instance.SuddenStop(PortName, SlvAddr);
Thread.Sleep(100);
try
{
......@@ -132,7 +135,7 @@ namespace OnlineStore.ACSingleStore
{
}
ACServerManager.ServoOff(PortName, SlvAddr);
AxisManager.instance.ServoOff(PortName, SlvAddr);
formStatus(false);
}
......@@ -160,23 +163,23 @@ namespace OnlineStore.ACSingleStore
private void btnRelMove_Click(object sender, EventArgs e)
{
int position = Convert.ToInt32(txtPosition.Text);
ACServerManager.RelMove(PortName, SlvAddr, position);
AxisManager.instance.RelMove(PortName, SlvAddr, position);
}
private void btnHomeMove_Click(object sender, EventArgs e)
{
int speed = Convert.ToInt32(txtSpeed.Text);
ACServerManager.HomeMove(PortName, SlvAddr, speed);
AxisManager.instance.HomeMove(PortName, SlvAddr, configAxis.HomeHighSpeed,configAxis.HomeLowSpeed,configAxis.HomeAddSpeed);
}
private void btnSpeedMove_Click(object sender, EventArgs e)
{
int speed = Convert.ToInt32(txtSpeed.Text);
ACServerManager.SpeedMove(PortName, SlvAddr, speed);
AxisManager.instance.SpeedMove(PortName, SlvAddr, speed);
}
private void btnGetActualPosition_Click(object sender, EventArgs e)
{
int value = ACServerManager.GetTargetPosition(PortName, SlvAddr);
int value = AxisManager.instance.GetTargetPosition(PortName, SlvAddr);
txtTargetPosition.Text = value.ToString();
value = ACServerManager.GetActualtPosition(PortName, SlvAddr);
value = AxisManager.instance.GetActualtPosition(PortName, SlvAddr);
txtActualPosition.Text = value.ToString();
}
private void SaveConfig(int speed,int position)
......@@ -223,7 +226,7 @@ namespace OnlineStore.ACSingleStore
PositionList = new List<int>();
LogUtil.info(LogName + "伺服开始运动,速度【" + speed + "】位置【" + position + "】启动定时器 ");
formMoveStatus(false);
ACServerManager.AbsMove(PortName, SlvAddr, position, speed);
AxisManager.instance.AbsMove(PortName, SlvAddr, position, speed);
toolTimer.Start();
}
private int P3Offset = 0;
......@@ -244,7 +247,7 @@ namespace OnlineStore.ACSingleStore
private void btnSdStop_Click(object sender, EventArgs e)
{
toolTimer.Stop();
ACServerManager.SuddenStop(PortName, SlvAddr);
AxisManager.instance.SuddenStop(PortName, SlvAddr);
}
private IO_VALUE GetSingleValue()
......@@ -267,14 +270,14 @@ namespace OnlineStore.ACSingleStore
isInProcesss = true;
try
{
int moveS = ACServerManager.GetBusyStatus(PortName, SlvAddr);
int moveS = AxisManager.instance.GetBusyStatus(PortName, SlvAddr);
if (moveS.Equals(1))
{
IO_VALUE currValue = GetSingleValue();
TimeSpan checkSpan = DateTime.Now - LastGetPTime;
if (LastValue.Equals(IO_VALUE.LOW) && currValue.Equals(IO_VALUE.HIGH)&&checkSpan.TotalSeconds>2)
{
int currPos = ACServerManager.GetActualtPosition(PortName, SlvAddr);
int currPos = AxisManager.instance.GetActualtPosition(PortName, SlvAddr);
txtActualPosition.Text = currPos.ToString();
PositionList.Add(currPos);
int num = PositionList.Count;
......@@ -363,11 +366,11 @@ namespace OnlineStore.ACSingleStore
{
StopTimer();
// toolTimer.Stop();
ACServerManager.SuddenStop(PortName, SlvAddr);
AxisManager.instance.SuddenStop(PortName, SlvAddr);
Thread.Sleep(100);
}
LogUtil.logBox = null;
//ACServerManager.CloseAllPort();
//AxisManager.instance.CloseAllPort();
//IOManager.instance.CloseAllConnection();
}
......
......@@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupAxis = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtBusyStatus = new System.Windows.Forms.TextBox();
......@@ -74,11 +75,35 @@
this.txtAxisValue = new System.Windows.Forms.TextBox();
this.txtAxisDeviceName = new System.Windows.Forms.TextBox();
this.lblServerOn = new System.Windows.Forms.Label();
this.txtStb = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label4 = new System.Windows.Forms.Label();
this.lblhomeSts = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.lblAxEncAcc = new System.Windows.Forms.Label();
this.lblINP = new System.Windows.Forms.Label();
this.lblBUSY = new System.Windows.Forms.Label();
this.lblNEL = new System.Windows.Forms.Label();
this.lblORG = new System.Windows.Forms.Label();
this.lblPEL = new System.Windows.Forms.Label();
this.lblSvOn = new System.Windows.Forms.Label();
this.lblEMG = new System.Windows.Forms.Label();
this.lblWARN = new System.Windows.Forms.Label();
this.lblALM = new System.Windows.Forms.Label();
this.label53 = new System.Windows.Forms.Label();
this.label56 = new System.Windows.Forms.Label();
this.label55 = new System.Windows.Forms.Label();
this.label52 = new System.Windows.Forms.Label();
this.lblAxEncVel = new System.Windows.Forms.Label();
this.lblAxPrfVel = new System.Windows.Forms.Label();
this.lblAxEncPos = new System.Windows.Forms.Label();
this.lblAxPrfPos = new System.Windows.Forms.Label();
this.lblAxisPrfMode = new System.Windows.Forms.Label();
this.label50 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupAxis.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupAxis
......@@ -87,21 +112,20 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupAxis.BackColor = System.Drawing.Color.White;
this.groupAxis.Controls.Add(this.groupBox2);
this.groupAxis.Controls.Add(this.groupBox1);
this.groupAxis.Controls.Add(this.panel1);
this.groupAxis.Controls.Add(this.lblServerOn);
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(4, 3);
this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(724, 302);
this.groupAxis.Size = new System.Drawing.Size(692, 395);
this.groupAxis.TabIndex = 218;
this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtStb);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtBusyStatus);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.txtHomeStatus);
......@@ -119,7 +143,7 @@
this.groupBox1.Controls.Add(this.txtHomeSingle);
this.groupBox1.Location = new System.Drawing.Point(553, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(154, 282);
this.groupBox1.Size = new System.Drawing.Size(135, 260);
this.groupBox1.TabIndex = 302;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "状态";
......@@ -127,7 +151,7 @@
// txtBusyStatus
//
this.txtBusyStatus.Enabled = false;
this.txtBusyStatus.Location = new System.Drawing.Point(120, 104);
this.txtBusyStatus.Location = new System.Drawing.Point(99, 76);
this.txtBusyStatus.Name = "txtBusyStatus";
this.txtBusyStatus.Size = new System.Drawing.Size(25, 23);
this.txtBusyStatus.TabIndex = 288;
......@@ -135,16 +159,16 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(6, 135);
this.label11.Location = new System.Drawing.Point(31, 107);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(105, 17);
this.label11.Size = new System.Drawing.Size(59, 17);
this.label11.TabIndex = 292;
this.label11.Text = "HOME-CMP状态:";
this.label11.Text = "回零状态:";
//
// txtHomeStatus
//
this.txtHomeStatus.Enabled = false;
this.txtHomeStatus.Location = new System.Drawing.Point(120, 132);
this.txtHomeStatus.Location = new System.Drawing.Point(99, 104);
this.txtHomeStatus.Name = "txtHomeStatus";
this.txtHomeStatus.Size = new System.Drawing.Size(25, 23);
this.txtHomeStatus.TabIndex = 291;
......@@ -152,7 +176,7 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(45, 107);
this.label10.Location = new System.Drawing.Point(24, 79);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(66, 17);
this.label10.TabIndex = 289;
......@@ -161,7 +185,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(52, 51);
this.label3.Location = new System.Drawing.Point(31, 51);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(59, 17);
this.label3.TabIndex = 286;
......@@ -170,7 +194,7 @@
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(40, 219);
this.label24.Location = new System.Drawing.Point(19, 191);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(71, 17);
this.label24.TabIndex = 316;
......@@ -180,7 +204,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(52, 23);
this.label5.Location = new System.Drawing.Point(31, 23);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(59, 17);
this.label5.TabIndex = 328;
......@@ -190,7 +214,7 @@
//
this.btnGetAlarm.BackColor = System.Drawing.Color.White;
this.btnGetAlarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGetAlarm.Location = new System.Drawing.Point(35, 245);
this.btnGetAlarm.Location = new System.Drawing.Point(14, 218);
this.btnGetAlarm.Name = "btnGetAlarm";
this.btnGetAlarm.Size = new System.Drawing.Size(110, 34);
this.btnGetAlarm.TabIndex = 284;
......@@ -201,7 +225,7 @@
// txtAlarmStatus
//
this.txtAlarmStatus.Enabled = false;
this.txtAlarmStatus.Location = new System.Drawing.Point(120, 48);
this.txtAlarmStatus.Location = new System.Drawing.Point(99, 48);
this.txtAlarmStatus.Name = "txtAlarmStatus";
this.txtAlarmStatus.Size = new System.Drawing.Size(25, 23);
this.txtAlarmStatus.TabIndex = 285;
......@@ -209,7 +233,7 @@
// txtLimit2
//
this.txtLimit2.Enabled = false;
this.txtLimit2.Location = new System.Drawing.Point(120, 216);
this.txtLimit2.Location = new System.Drawing.Point(99, 188);
this.txtLimit2.Name = "txtLimit2";
this.txtLimit2.Size = new System.Drawing.Size(25, 23);
this.txtLimit2.TabIndex = 313;
......@@ -217,7 +241,7 @@
// txtServoStatue
//
this.txtServoStatue.Enabled = false;
this.txtServoStatue.Location = new System.Drawing.Point(120, 20);
this.txtServoStatue.Location = new System.Drawing.Point(99, 20);
this.txtServoStatue.Name = "txtServoStatue";
this.txtServoStatue.Size = new System.Drawing.Size(25, 23);
this.txtServoStatue.TabIndex = 327;
......@@ -225,7 +249,7 @@
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(40, 191);
this.label22.Location = new System.Drawing.Point(19, 163);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(71, 17);
this.label22.TabIndex = 312;
......@@ -235,7 +259,7 @@
// txtLimit1
//
this.txtLimit1.Enabled = false;
this.txtLimit1.Location = new System.Drawing.Point(120, 188);
this.txtLimit1.Location = new System.Drawing.Point(99, 160);
this.txtLimit1.Name = "txtLimit1";
this.txtLimit1.Size = new System.Drawing.Size(25, 23);
this.txtLimit1.TabIndex = 309;
......@@ -243,7 +267,7 @@
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(52, 163);
this.label6.Location = new System.Drawing.Point(31, 135);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(59, 17);
this.label6.TabIndex = 300;
......@@ -252,7 +276,7 @@
// txtHomeSingle
//
this.txtHomeSingle.Enabled = false;
this.txtHomeSingle.Location = new System.Drawing.Point(120, 160);
this.txtHomeSingle.Location = new System.Drawing.Point(99, 132);
this.txtHomeSingle.Name = "txtHomeSingle";
this.txtHomeSingle.Size = new System.Drawing.Size(25, 23);
this.txtHomeSingle.TabIndex = 297;
......@@ -289,13 +313,13 @@
this.panel1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel1.Location = new System.Drawing.Point(7, 17);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(540, 273);
this.panel1.Size = new System.Drawing.Size(540, 250);
this.panel1.TabIndex = 219;
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(169, 178);
this.linkLabel1.Location = new System.Drawing.Point(169, 165);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(32, 17);
this.linkLabel1.TabIndex = 336;
......@@ -308,7 +332,7 @@
this.comjSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comjSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.comjSpeed.FormattingEnabled = true;
this.comjSpeed.Location = new System.Drawing.Point(71, 225);
this.comjSpeed.Location = new System.Drawing.Point(71, 207);
this.comjSpeed.Name = "comjSpeed";
this.comjSpeed.Size = new System.Drawing.Size(95, 28);
this.comjSpeed.TabIndex = 335;
......@@ -317,7 +341,7 @@
//
this.btnComAlarmClear.BackColor = System.Drawing.Color.White;
this.btnComAlarmClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnComAlarmClear.Location = new System.Drawing.Point(307, 169);
this.btnComAlarmClear.Location = new System.Drawing.Point(307, 154);
this.btnComAlarmClear.Name = "btnComAlarmClear";
this.btnComAlarmClear.Size = new System.Drawing.Size(110, 34);
this.btnComAlarmClear.TabIndex = 50;
......@@ -332,10 +356,10 @@
this.btnAxisStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisStop.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisStop.Location = new System.Drawing.Point(427, 90);
this.btnAxisStop.Location = new System.Drawing.Point(427, 78);
this.btnAxisStop.Name = "btnAxisStop";
this.btnAxisStop.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisStop.Size = new System.Drawing.Size(110, 114);
this.btnAxisStop.Size = new System.Drawing.Size(110, 110);
this.btnAxisStop.TabIndex = 246;
this.btnAxisStop.Text = " 停止运动";
this.btnAxisStop.UseVisualStyleBackColor = false;
......@@ -348,7 +372,7 @@
this.btnAxisReturnHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisReturnHome.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisReturnHome.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisReturnHome.Location = new System.Drawing.Point(307, 129);
this.btnAxisReturnHome.Location = new System.Drawing.Point(307, 116);
this.btnAxisReturnHome.Name = "btnAxisReturnHome";
this.btnAxisReturnHome.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisReturnHome.Size = new System.Drawing.Size(110, 34);
......@@ -362,7 +386,7 @@
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(71, 13);
this.comboBox1.Location = new System.Drawing.Point(71, 6);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(227, 28);
this.comboBox1.TabIndex = 301;
......@@ -372,7 +396,7 @@
//
this.btnMCopy.BackColor = System.Drawing.Color.White;
this.btnMCopy.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMCopy.Location = new System.Drawing.Point(468, 225);
this.btnMCopy.Location = new System.Drawing.Point(468, 207);
this.btnMCopy.Name = "btnMCopy";
this.btnMCopy.Size = new System.Drawing.Size(69, 28);
this.btnMCopy.TabIndex = 334;
......@@ -385,7 +409,7 @@
this.btnDelMove.BackColor = System.Drawing.Color.White;
this.btnDelMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelMove.Location = new System.Drawing.Point(321, 217);
this.btnDelMove.Location = new System.Drawing.Point(321, 199);
this.btnDelMove.Name = "btnDelMove";
this.btnDelMove.Size = new System.Drawing.Size(140, 45);
this.btnDelMove.TabIndex = 332;
......@@ -401,7 +425,7 @@
this.btnOpenAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenAxis.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnOpenAxis.Location = new System.Drawing.Point(307, 9);
this.btnOpenAxis.Location = new System.Drawing.Point(307, 2);
this.btnOpenAxis.Name = "btnOpenAxis";
this.btnOpenAxis.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnOpenAxis.Size = new System.Drawing.Size(110, 34);
......@@ -417,7 +441,7 @@
this.btnCloseAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAxis.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnCloseAxis.Location = new System.Drawing.Point(427, 9);
this.btnCloseAxis.Location = new System.Drawing.Point(427, 2);
this.btnCloseAxis.Name = "btnCloseAxis";
this.btnCloseAxis.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnCloseAxis.Size = new System.Drawing.Size(110, 34);
......@@ -431,7 +455,7 @@
this.btnAddMove.BackColor = System.Drawing.Color.White;
this.btnAddMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddMove.Location = new System.Drawing.Point(172, 217);
this.btnAddMove.Location = new System.Drawing.Point(172, 199);
this.btnAddMove.Name = "btnAddMove";
this.btnAddMove.Size = new System.Drawing.Size(140, 45);
this.btnAddMove.TabIndex = 330;
......@@ -447,7 +471,7 @@
this.txtASpeed.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtASpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtASpeed.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtASpeed.Location = new System.Drawing.Point(207, 99);
this.txtASpeed.Location = new System.Drawing.Point(207, 88);
this.txtASpeed.MaxLength = 12;
this.txtASpeed.Name = "txtASpeed";
this.txtASpeed.RightToLeft = System.Windows.Forms.RightToLeft.No;
......@@ -458,7 +482,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 231);
this.label1.Location = new System.Drawing.Point(9, 213);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(68, 17);
this.label1.TabIndex = 329;
......@@ -470,7 +494,7 @@
this.label47.Cursor = System.Windows.Forms.Cursors.Default;
this.label47.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label47.ForeColor = System.Drawing.SystemColors.ControlText;
this.label47.Location = new System.Drawing.Point(142, 104);
this.label47.Location = new System.Drawing.Point(142, 93);
this.label47.Name = "label47";
this.label47.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label47.Size = new System.Drawing.Size(59, 17);
......@@ -485,7 +509,7 @@
this.btnReadPosition.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReadPosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReadPosition.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnReadPosition.Location = new System.Drawing.Point(207, 140);
this.btnReadPosition.Location = new System.Drawing.Point(207, 127);
this.btnReadPosition.Name = "btnReadPosition";
this.btnReadPosition.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnReadPosition.Size = new System.Drawing.Size(91, 34);
......@@ -501,7 +525,7 @@
this.btnAxisVMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisVMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisVMove.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisVMove.Location = new System.Drawing.Point(307, 89);
this.btnAxisVMove.Location = new System.Drawing.Point(307, 78);
this.btnAxisVMove.Name = "btnAxisVMove";
this.btnAxisVMove.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisVMove.Size = new System.Drawing.Size(110, 34);
......@@ -514,7 +538,7 @@
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(18, 149);
this.label8.Location = new System.Drawing.Point(18, 136);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(59, 17);
this.label8.TabIndex = 255;
......@@ -527,7 +551,7 @@
this.btnAxisRMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisRMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisRMove.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisRMove.Location = new System.Drawing.Point(427, 48);
this.btnAxisRMove.Location = new System.Drawing.Point(427, 39);
this.btnAxisRMove.Name = "btnAxisRMove";
this.btnAxisRMove.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisRMove.Size = new System.Drawing.Size(110, 34);
......@@ -539,7 +563,7 @@
// lblCountPulse
//
this.lblCountPulse.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCountPulse.Location = new System.Drawing.Point(83, 144);
this.lblCountPulse.Location = new System.Drawing.Point(83, 131);
this.lblCountPulse.Name = "lblCountPulse";
this.lblCountPulse.ReadOnly = true;
this.lblCountPulse.Size = new System.Drawing.Size(118, 26);
......@@ -552,7 +576,7 @@
this.btnAxisAMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisAMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisAMove.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisAMove.Location = new System.Drawing.Point(307, 49);
this.btnAxisAMove.Location = new System.Drawing.Point(307, 40);
this.btnAxisAMove.Name = "btnAxisAMove";
this.btnAxisAMove.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisAMove.Size = new System.Drawing.Size(110, 34);
......@@ -566,7 +590,7 @@
this.label49.AutoSize = true;
this.label49.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label49.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label49.Location = new System.Drawing.Point(10, 18);
this.label49.Location = new System.Drawing.Point(10, 11);
this.label49.Name = "label49";
this.label49.Size = new System.Drawing.Size(51, 17);
this.label49.TabIndex = 233;
......@@ -579,7 +603,7 @@
this.txtAPosition.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtAPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAPosition.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtAPosition.Location = new System.Drawing.Point(207, 57);
this.txtAPosition.Location = new System.Drawing.Point(207, 48);
this.txtAPosition.MaxLength = 12;
this.txtAPosition.Name = "txtAPosition";
this.txtAPosition.RightToLeft = System.Windows.Forms.RightToLeft.No;
......@@ -592,7 +616,7 @@
this.label46.AutoSize = true;
this.label46.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label46.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label46.Location = new System.Drawing.Point(26, 104);
this.label46.Location = new System.Drawing.Point(26, 93);
this.label46.Name = "label46";
this.label46.Size = new System.Drawing.Size(35, 17);
this.label46.TabIndex = 239;
......@@ -605,7 +629,7 @@
this.label48.Cursor = System.Windows.Forms.Cursors.Default;
this.label48.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label48.ForeColor = System.Drawing.SystemColors.ControlText;
this.label48.Location = new System.Drawing.Point(142, 62);
this.label48.Location = new System.Drawing.Point(142, 53);
this.label48.Name = "label48";
this.label48.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label48.Size = new System.Drawing.Size(59, 17);
......@@ -618,7 +642,7 @@
this.label45.AutoSize = true;
this.label45.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label45.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label45.Location = new System.Drawing.Point(14, 62);
this.label45.Location = new System.Drawing.Point(14, 53);
this.label45.Name = "label45";
this.label45.Size = new System.Drawing.Size(47, 17);
this.label45.TabIndex = 240;
......@@ -628,22 +652,22 @@
// txtAxisValue
//
this.txtAxisValue.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAxisValue.Location = new System.Drawing.Point(71, 99);
this.txtAxisValue.Location = new System.Drawing.Point(71, 88);
this.txtAxisValue.MaxLength = 10;
this.txtAxisValue.Name = "txtAxisValue";
this.txtAxisValue.ReadOnly = true;
this.txtAxisValue.Size = new System.Drawing.Size(68, 26);
this.txtAxisValue.Size = new System.Drawing.Size(50, 26);
this.txtAxisValue.TabIndex = 242;
this.txtAxisValue.Text = "0";
//
// txtAxisDeviceName
//
this.txtAxisDeviceName.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAxisDeviceName.Location = new System.Drawing.Point(71, 57);
this.txtAxisDeviceName.Location = new System.Drawing.Point(71, 48);
this.txtAxisDeviceName.MaxLength = 10;
this.txtAxisDeviceName.Name = "txtAxisDeviceName";
this.txtAxisDeviceName.ReadOnly = true;
this.txtAxisDeviceName.Size = new System.Drawing.Size(68, 26);
this.txtAxisDeviceName.Size = new System.Drawing.Size(50, 26);
this.txtAxisDeviceName.TabIndex = 241;
this.txtAxisDeviceName.Text = "0";
//
......@@ -658,35 +682,291 @@
this.lblServerOn.Size = new System.Drawing.Size(0, 19);
this.lblServerOn.TabIndex = 268;
//
// txtStb
//
this.txtStb.Enabled = false;
this.txtStb.Location = new System.Drawing.Point(120, 76);
this.txtStb.Name = "txtStb";
this.txtStb.Size = new System.Drawing.Size(25, 23);
this.txtStb.TabIndex = 329;
// groupBox2
//
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.lblhomeSts);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.lblAxEncAcc);
this.groupBox2.Controls.Add(this.lblINP);
this.groupBox2.Controls.Add(this.lblBUSY);
this.groupBox2.Controls.Add(this.lblNEL);
this.groupBox2.Controls.Add(this.lblORG);
this.groupBox2.Controls.Add(this.lblPEL);
this.groupBox2.Controls.Add(this.lblSvOn);
this.groupBox2.Controls.Add(this.lblEMG);
this.groupBox2.Controls.Add(this.lblWARN);
this.groupBox2.Controls.Add(this.lblALM);
this.groupBox2.Controls.Add(this.label53);
this.groupBox2.Controls.Add(this.label56);
this.groupBox2.Controls.Add(this.label55);
this.groupBox2.Controls.Add(this.label52);
this.groupBox2.Controls.Add(this.lblAxEncVel);
this.groupBox2.Controls.Add(this.lblAxPrfVel);
this.groupBox2.Controls.Add(this.lblAxEncPos);
this.groupBox2.Controls.Add(this.lblAxPrfPos);
this.groupBox2.Controls.Add(this.lblAxisPrfMode);
this.groupBox2.Controls.Add(this.label50);
this.groupBox2.Location = new System.Drawing.Point(7, 270);
this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
this.groupBox2.Size = new System.Drawing.Size(540, 118);
this.groupBox2.TabIndex = 303;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "轴状态监控";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(246, 90);
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 17);
this.label4.TabIndex = 18;
this.label4.Text = "回原状态:";
//
// lblhomeSts
//
this.lblhomeSts.AutoSize = true;
this.lblhomeSts.Location = new System.Drawing.Point(311, 90);
this.lblhomeSts.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblhomeSts.Name = "lblhomeSts";
this.lblhomeSts.Size = new System.Drawing.Size(17, 17);
this.lblhomeSts.TabIndex = 17;
this.lblhomeSts.Text = "...";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(54, 79);
this.label2.Location = new System.Drawing.Point(417, 65);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(57, 17);
this.label2.TabIndex = 330;
this.label2.Text = "STB状态:";
this.label2.Size = new System.Drawing.Size(71, 17);
this.label2.TabIndex = 11;
this.label2.Text = "实际加速度:";
this.label2.Visible = false;
//
// lblAxEncAcc
//
this.lblAxEncAcc.AutoSize = true;
this.lblAxEncAcc.Location = new System.Drawing.Point(494, 65);
this.lblAxEncAcc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAxEncAcc.Name = "lblAxEncAcc";
this.lblAxEncAcc.Size = new System.Drawing.Size(17, 17);
this.lblAxEncAcc.TabIndex = 12;
this.lblAxEncAcc.Text = "...";
this.lblAxEncAcc.Visible = false;
//
// lblINP
//
this.lblINP.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblINP.Location = new System.Drawing.Point(414, 24);
this.lblINP.Name = "lblINP";
this.lblINP.Size = new System.Drawing.Size(56, 30);
this.lblINP.TabIndex = 10;
this.lblINP.Text = "到位";
this.lblINP.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblBUSY
//
this.lblBUSY.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblBUSY.Location = new System.Drawing.Point(356, 24);
this.lblBUSY.Name = "lblBUSY";
this.lblBUSY.Size = new System.Drawing.Size(56, 30);
this.lblBUSY.TabIndex = 9;
this.lblBUSY.Text = "忙碌";
this.lblBUSY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblNEL
//
this.lblNEL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblNEL.Location = new System.Drawing.Point(298, 24);
this.lblNEL.Name = "lblNEL";
this.lblNEL.Size = new System.Drawing.Size(56, 30);
this.lblNEL.TabIndex = 8;
this.lblNEL.Text = "负极限";
this.lblNEL.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblORG
//
this.lblORG.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblORG.Location = new System.Drawing.Point(240, 24);
this.lblORG.Name = "lblORG";
this.lblORG.Size = new System.Drawing.Size(56, 30);
this.lblORG.TabIndex = 7;
this.lblORG.Text = "原点";
this.lblORG.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblPEL
//
this.lblPEL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblPEL.Location = new System.Drawing.Point(182, 24);
this.lblPEL.Name = "lblPEL";
this.lblPEL.Size = new System.Drawing.Size(56, 30);
this.lblPEL.TabIndex = 6;
this.lblPEL.Text = "正极限";
this.lblPEL.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblSvOn
//
this.lblSvOn.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblSvOn.Location = new System.Drawing.Point(8, 24);
this.lblSvOn.Name = "lblSvOn";
this.lblSvOn.Size = new System.Drawing.Size(56, 30);
this.lblSvOn.TabIndex = 5;
this.lblSvOn.Text = "伺服";
this.lblSvOn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblEMG
//
this.lblEMG.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblEMG.Location = new System.Drawing.Point(124, 24);
this.lblEMG.Name = "lblEMG";
this.lblEMG.Size = new System.Drawing.Size(56, 30);
this.lblEMG.TabIndex = 4;
this.lblEMG.Text = "急停";
this.lblEMG.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblWARN
//
this.lblWARN.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblWARN.Location = new System.Drawing.Point(472, 24);
this.lblWARN.Name = "lblWARN";
this.lblWARN.Size = new System.Drawing.Size(56, 30);
this.lblWARN.TabIndex = 3;
this.lblWARN.Text = "警告";
this.lblWARN.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblALM
//
this.lblALM.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblALM.Location = new System.Drawing.Point(66, 24);
this.lblALM.Name = "lblALM";
this.lblALM.Size = new System.Drawing.Size(56, 30);
this.lblALM.TabIndex = 2;
this.lblALM.Text = "报警";
this.lblALM.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label53
//
this.label53.AutoSize = true;
this.label53.Location = new System.Drawing.Point(123, 90);
this.label53.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label53.Name = "label53";
this.label53.Size = new System.Drawing.Size(59, 17);
this.label53.TabIndex = 1;
this.label53.Text = "规划速度:";
//
// label56
//
this.label56.AutoSize = true;
this.label56.Location = new System.Drawing.Point(10, 90);
this.label56.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label56.Name = "label56";
this.label56.Size = new System.Drawing.Size(59, 17);
this.label56.TabIndex = 1;
this.label56.Text = "实际速度:";
//
// label55
//
this.label55.AutoSize = true;
this.label55.Location = new System.Drawing.Point(10, 65);
this.label55.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label55.Name = "label55";
this.label55.Size = new System.Drawing.Size(59, 17);
this.label55.TabIndex = 1;
this.label55.Text = "实际位置:";
//
// label52
//
this.label52.AutoSize = true;
this.label52.Location = new System.Drawing.Point(123, 65);
this.label52.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label52.Name = "label52";
this.label52.Size = new System.Drawing.Size(59, 17);
this.label52.TabIndex = 1;
this.label52.Text = "规划位置:";
//
// lblAxEncVel
//
this.lblAxEncVel.AutoSize = true;
this.lblAxEncVel.Location = new System.Drawing.Point(73, 90);
this.lblAxEncVel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAxEncVel.Name = "lblAxEncVel";
this.lblAxEncVel.Size = new System.Drawing.Size(17, 17);
this.lblAxEncVel.TabIndex = 1;
this.lblAxEncVel.Text = "...";
//
// lblAxPrfVel
//
this.lblAxPrfVel.AutoSize = true;
this.lblAxPrfVel.Location = new System.Drawing.Point(188, 90);
this.lblAxPrfVel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAxPrfVel.Name = "lblAxPrfVel";
this.lblAxPrfVel.Size = new System.Drawing.Size(17, 17);
this.lblAxPrfVel.TabIndex = 1;
this.lblAxPrfVel.Text = "...";
//
// lblAxEncPos
//
this.lblAxEncPos.AutoSize = true;
this.lblAxEncPos.Location = new System.Drawing.Point(73, 65);
this.lblAxEncPos.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAxEncPos.Name = "lblAxEncPos";
this.lblAxEncPos.Size = new System.Drawing.Size(17, 17);
this.lblAxEncPos.TabIndex = 1;
this.lblAxEncPos.Text = "...";
//
// lblAxPrfPos
//
this.lblAxPrfPos.AutoSize = true;
this.lblAxPrfPos.Location = new System.Drawing.Point(188, 65);
this.lblAxPrfPos.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAxPrfPos.Name = "lblAxPrfPos";
this.lblAxPrfPos.Size = new System.Drawing.Size(17, 17);
this.lblAxPrfPos.TabIndex = 1;
this.lblAxPrfPos.Text = "...";
//
// lblAxisPrfMode
//
this.lblAxisPrfMode.AutoSize = true;
this.lblAxisPrfMode.Location = new System.Drawing.Point(311, 65);
this.lblAxisPrfMode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAxisPrfMode.Name = "lblAxisPrfMode";
this.lblAxisPrfMode.Size = new System.Drawing.Size(17, 17);
this.lblAxisPrfMode.TabIndex = 1;
this.lblAxisPrfMode.Text = "...";
//
// label50
//
this.label50.AutoSize = true;
this.label50.Location = new System.Drawing.Point(246, 65);
this.label50.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label50.Name = "label50";
this.label50.Size = new System.Drawing.Size(59, 17);
this.label50.TabIndex = 1;
this.label50.Text = "规划模式:";
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// AxisMoveControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.groupAxis);
this.Name = "AxisMoveControl";
this.Size = new System.Drawing.Size(731, 310);
this.Size = new System.Drawing.Size(699, 402);
this.groupAxis.ResumeLayout(false);
this.groupAxis.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
......@@ -739,7 +1019,30 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox comjSpeed;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.TextBox txtStb;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblhomeSts;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label lblAxEncAcc;
private System.Windows.Forms.Label lblINP;
private System.Windows.Forms.Label lblBUSY;
private System.Windows.Forms.Label lblNEL;
private System.Windows.Forms.Label lblORG;
private System.Windows.Forms.Label lblPEL;
private System.Windows.Forms.Label lblSvOn;
private System.Windows.Forms.Label lblEMG;
private System.Windows.Forms.Label lblWARN;
private System.Windows.Forms.Label lblALM;
private System.Windows.Forms.Label label53;
private System.Windows.Forms.Label label56;
private System.Windows.Forms.Label label55;
private System.Windows.Forms.Label label52;
private System.Windows.Forms.Label lblAxEncVel;
private System.Windows.Forms.Label lblAxPrfVel;
private System.Windows.Forms.Label lblAxEncPos;
private System.Windows.Forms.Label lblAxPrfPos;
private System.Windows.Forms.Label lblAxisPrfMode;
private System.Windows.Forms.Label label50;
private System.Windows.Forms.Timer timer1;
}
}
......@@ -10,42 +10,56 @@ using System.Windows.Forms;
using OnlineStore.DeviceLibrary;
using OnlineStore.Common;
using System.Threading;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.LoadCSVLibrary;
using HuichuanLibrary;
namespace OnlineStore.AutoCountClient
{
public partial class AxisMoveControl : UserControl
{
private List<AxisBean> axisList = new List<AxisBean>();
public bool IsHuiChuan = true;
private List<ConfigMoveAxis> axisList = new List<ConfigMoveAxis>();
private BoxBean boxBean = null;
private string PortName = "";
private int SlvAddr = 0;
private short SlvAddr = 0;
public AxisMoveControl()
{
InitializeComponent();
}
public void LoadData(BoxBean equipBase, params AxisBean[] moveAxis)
public void LoadData(BoxBean equipBase, bool isHc = true)
{
this.boxBean = equipBase;
axisList = new List<AxisBean>(moveAxis);
axisList = new List<ConfigMoveAxis>(equipBase.moveAxisList);
if (axisList.Count > 0)
{
comboBox1.Items.Clear();
foreach (AxisBean a in axisList)
foreach (ConfigMoveAxis a in axisList)
{
comboBox1.Items.Add(a.Config.Explain);
comboBox1.Items.Add(a.Explain);
}
comboBox1.SelectedIndex = 0;
PortName = moveAxis[0].Config.DeviceName;
SlvAddr = moveAxis[0].Config.GetAxisValue();
PortName = axisList[0].DeviceName;
SlvAddr = axisList[0].GetAxisValue();
txtAxisDeviceName.Text = PortName;
txtAxisValue.Text = SlvAddr.ToString();
}
btnAddMove.BackColor = Color.White;
btnDelMove.BackColor = Color.White;
this.IsHuiChuan = isHc;
if (IsHuiChuan)
{
groupBox1.Visible = false;
groupBox2.Visible = true;
timer1.Start();
}
else
{
groupBox1.Visible = true;
groupBox2.Visible = false;
}
}
......@@ -57,7 +71,7 @@ namespace OnlineStore.AutoCountClient
|| (boxBean.Config.Middle_Axis.IsSameAxis(PortName, SlvAddr)))
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int currValue = boxBean.Config.InOut_Axis.GetAclPosition();
int currValue =AxisManager.instance.GetActualtPosition( boxBean.Config.InOut_Axis.DeviceName,boxBean.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
return true;
......@@ -73,14 +87,15 @@ namespace OnlineStore.AutoCountClient
private void btnOpenAxis_Click(object sender, EventArgs e)
{
LogUtil.info("点击【打开伺服】,【" + PortName + "_" + SlvAddr + "】 ");
boxBean.RunAxis(false, axisList[comboBox1.SelectedIndex]);
//boxBean.RunAxis(false, axisList[comboBox1.SelectedIndex]);
AxisManager.instance.ServoOn(PortName, SlvAddr);
}
private void btnCloseAxis_Click(object sender, EventArgs e)
{
LogUtil.info("点击【关闭伺服】,【" + PortName + "_" + SlvAddr + "】 ");
// ACServerManager.ServoOff(PortName, SlvAddr);
boxBean.CloseAxis(axisList[comboBox1.SelectedIndex]);
AxisManager.instance.ServoOff(PortName, SlvAddr);
//boxBean.CloseAxis(axisList[comboBox1.SelectedIndex]);
}
private void btnAxisAMove_Click(object sender, EventArgs e)
......@@ -92,7 +107,7 @@ namespace OnlineStore.AutoCountClient
int position = FormUtil.GetIntValue(txtAPosition);
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【绝对运动】,【" + PortName + "_" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.AbsMove(PortName, SlvAddr, position, speed);
AxisManager.instance.AbsMove(PortName, SlvAddr, position, speed);
}
private void btnAxisRMove_Click(object sender, EventArgs e)
......@@ -104,7 +119,7 @@ namespace OnlineStore.AutoCountClient
int position = FormUtil.GetIntValue(txtAPosition);
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【相对运动】,【" + PortName + "_" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.RelMove(PortName, SlvAddr, position, speed);
AxisManager.instance.RelMove(PortName, SlvAddr, position, speed);
}
private void btnAxisVMove_Click(object sender, EventArgs e)
......@@ -115,13 +130,13 @@ namespace OnlineStore.AutoCountClient
}
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【匀速运动】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.SpeedMove(PortName, SlvAddr, speed);
AxisManager.instance.SpeedMove(PortName, SlvAddr, speed);
}
private void btnAxisStop_Click(object sender, EventArgs e)
{
LogUtil.info("点击【停止运动】,【" + PortName + "_" + SlvAddr + "】 ");
ACServerManager.SuddenStop(PortName, SlvAddr);
AxisManager.instance.SuddenStop(PortName, SlvAddr);
if (btnAddMove.BackColor == Color.Green)
{
btnAddMove.BackColor = System.Drawing.SystemColors.Control;
......@@ -137,9 +152,9 @@ namespace OnlineStore.AutoCountClient
private void btnComAlarmClear_Click(object sender, EventArgs e)
{
LogUtil.info("点击【清理报警】,【" + PortName + "_" + SlvAddr + "】 ");
ACServerManager.AlarmClear(PortName, SlvAddr);
AxisManager.instance.AlarmClear(PortName, SlvAddr);
Thread.Sleep(100);
ACServerManager.ServoOn(PortName, SlvAddr);
AxisManager.instance.ServoOn(PortName, SlvAddr);
}
private void btnAxisReturnHome_Click(object sender, EventArgs e)
......@@ -149,26 +164,33 @@ namespace OnlineStore.AutoCountClient
return;
}
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【原点返回】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.HomeMove(PortName, SlvAddr, speed);
foreach(ConfigMoveAxis a in axisList)
{
if (a.IsSameAxis(PortName, SlvAddr))
{
LogUtil.info("点击【原点返回】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】");
AxisManager.instance.HomeMove(PortName, SlvAddr, speed,a.HomeLowSpeed,a.HomeAddSpeed);
}
}
}
private void btnGetAlarm_Click(object sender, EventArgs e)
{
this.txtAlarmStatus.Text = ACServerManager.GetAlarmStatus(PortName, SlvAddr).ToString();
this.txtBusyStatus.Text = ACServerManager.GetBusyStatus(PortName, SlvAddr).ToString();
this.txtStb.Text = ACServerManager.GetSTBState(PortName, SlvAddr).ToString();
this.txtHomeStatus.Text = ACServerManager.GetHomeEndStatus(PortName, SlvAddr).ToString();
this.txtHomeSingle.Text = ACServerManager.GetHomeSingle(PortName, SlvAddr).ToString();
this.txtLimit1.Text = ACServerManager.GetLimitPositiveSingle(PortName, SlvAddr).ToString();
this.txtLimit2.Text = ACServerManager.GetLimitNegativeSingle(PortName, SlvAddr).ToString();
txtServoStatue.Text = ACServerManager.ServerOnStatus(PortName, SlvAddr) ? "✔" : "✘";
this.txtAlarmStatus.Text = AxisManager.instance.GetAlarmStatus(PortName, SlvAddr).ToString();
this.txtBusyStatus.Text = AxisManager.instance.GetBusyStatus(PortName, SlvAddr).ToString();
//this.txtStb.Text = AxisManager.instance.GetSTBState(PortName, SlvAddr).ToString();
this.txtHomeStatus.Text = AxisManager.instance.GetHomeEndStatus(PortName, SlvAddr).ToString();
this.txtHomeSingle.Text = AxisManager.instance.GetHomeSingle(PortName, SlvAddr).ToString();
this.txtLimit1.Text = AxisManager.instance.GetLimitPositiveSingle(PortName, SlvAddr).ToString();
this.txtLimit2.Text = AxisManager.instance.GetLimitNegativeSingle(PortName, SlvAddr).ToString();
txtServoStatue.Text = AxisManager.instance.ServerOnStatus(PortName, SlvAddr) ? "✔" : "✘";
}
private void btnReadPosition_Click(object sender, EventArgs e)
{
lblCountPulse.Text = ACServerManager.GetActualtPosition(PortName, SlvAddr).ToString();
lblCountPulse.Text = AxisManager.instance.GetActualtPosition(PortName, SlvAddr).ToString();
}
......@@ -176,7 +198,7 @@ namespace OnlineStore.AutoCountClient
{
if (comboBox1.SelectedIndex >= 0)
{
ConfigMoveAxis axis = axisList[comboBox1.SelectedIndex].Config;
ConfigMoveAxis axis = axisList[comboBox1.SelectedIndex];
PortName = axis.DeviceName;
SlvAddr = axis.GetAxisValue();
txtAxisDeviceName.Text = PortName;
......@@ -248,7 +270,7 @@ namespace OnlineStore.AutoCountClient
private void AxisMove(int speed)
{
LogUtil.info("【" + PortName + "_" + SlvAddr + "】点动: 速度:" + speed);
ACServerManager.SpeedMove(PortName, SlvAddr, speed);
AxisManager.instance.SpeedMove(PortName, SlvAddr, speed);
}
private void btnAddMove_MouseDown(object sender, MouseEventArgs e)
{
......@@ -274,7 +296,7 @@ namespace OnlineStore.AutoCountClient
if (btnAddMove.BackColor == Color.Green)
{
btnAddMove.BackColor = Color.White;
ACServerManager.SuddenStop(PortName, SlvAddr);
AxisManager.instance.SuddenStop(PortName, SlvAddr);
btnReadPosition_Click(null, null);
}
}
......@@ -303,7 +325,7 @@ namespace OnlineStore.AutoCountClient
if (btnDelMove.BackColor == Color.Green)
{
btnDelMove.BackColor = Color.White;
ACServerManager.SuddenStop(PortName, SlvAddr);
AxisManager.instance.SuddenStop(PortName, SlvAddr);
btnReadPosition_Click(null, null);
}
}
......@@ -312,5 +334,87 @@ namespace OnlineStore.AutoCountClient
{
Clipboard.SetDataObject(lblCountPulse.Text, true);
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Visible)
{
ReadAxisStatus();
}
}
private void ReadAxisStatus()
{
//【1】更新轴号
short axisNo = SlvAddr;
if (axisNo <= 0)
{
return;
}
short modeValue = HCBoardManager.GetAxisPrfMode(axisNo);
if (modeValue < 0)
{
return;
}
else
{
string mode = HCBoardManager.AxisPrfMode(modeValue);
lblAxisPrfMode.Text = mode;
}
//【2】读取轴状态,如果读取出错将关闭此定时器
AxisSts sts = HCBoardManager.GetAxisSts(axisNo);
if (sts.ServoOn < 0)
{
return;
}
//【3】更新界面显示
ShowlbSts(lblALM, sts.ALM); //报警信号
ShowlbSts(lblWARN, sts.WARN); //警告信号
ShowlbSts(lblEMG, sts.EMG);//急停信号
ShowlbSts(lblSvOn, sts.ServoOn); //使能信号
ShowlbSts(lblBUSY, sts.BUSY); //轴忙信号
ShowlbSts(lblINP, sts.INP); //轴到位信号
if (sts.ORG < 0)
{
return;
}
ShowlbSts(lblPEL, sts.PEL); //正限位信号
ShowlbSts(lblORG, sts.ORG); //原点信号
ShowlbSts(lblNEL, sts.NEL); //负限位信号
//label59.Text = ConvertDecimalToBinary(nTimerAxSts[0]); //轴状态是按bit进行解读,因此这里将AxSts转换为二进制bit进行显示
lblAxPrfPos.Text = HCBoardManager.GetAxisPrfPos(axisNo).ToString();
lblAxPrfVel.Text = HCBoardManager.GetAxisPrfVel(axisNo).ToString();
//label62.Text = nTimerAxPrfAcc[0].ToString();
lblAxEncPos.Text = HCBoardManager.GetAxisCurrPos(axisNo).ToString();
lblAxEncVel.Text = HCBoardManager.GetAxisCurrVel(axisNo).ToString();
lblAxEncAcc.Text = HCBoardManager.GetAxisCurrAcc(axisNo).ToString();
//label65.Text = nTimerAxEncAcc[0].ToString();
short value = HCBoardManager.GetHomeStatus(axisNo);
string homesstr = HCBoardManager.AxisHomeSts(value);
lblhomeSts.Text = homesstr;
}
private void ShowlbSts(Label lbl, int value)
{
if (value.Equals(1))
{
lbl.BackColor = Color.Lime;
}
else if (value.Equals(0))
{
lbl.BackColor = Color.LightGray;
}
else
{
lbl.BackColor = this.BackColor;
}
}
public void StopTimer()
{
this.timer1.Stop();
}
}
}
......@@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -82,6 +82,7 @@ namespace OnlineStore.Common
public static string HumitureControllerType = "HumitureControllerType";
public static string UseAIOBOX = "UseAIOBOX";
public static string UseHCBoard = "UseHCBoard";
public static string LineServerIp = "LineServerIp";
public static string LineServerPort = "LineServerPort";
......@@ -105,5 +106,7 @@ namespace OnlineStore.Common
public static string Location_PosID_ = "Location_PosID_";
public static string UseBuzzer = "UseBuzzer";
}
}
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public abstract class AxisManager
{
public bool IsShowMsg = false;
public static AxisManager instance;
public void Init()
{
bool UseHCBoard = ConfigAppSettings.GetIntValue(Setting_Init.UseHCBoard).Equals(1);
if (UseHCBoard)
{
//instance = new HCAxisManager();
}
else
{
instance = new ACServerManager();
}
}
public abstract bool OpenPort(string portName);
public abstract void ColsePort(string portName);
public abstract void CloseAllPort();
public abstract bool ServerOnStatus(string portName, short slvAddr);
public abstract void ClearSpeed();
public abstract bool IsHomeMoveEnd(string portName, short slvAddr);
public abstract void ServoOn(string portName, short slvAddr);
public abstract void ServoOff(string portName, short slvAddr);
public abstract void InitSlvAddr(string portName, short slvAddr);
public abstract void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed);
public abstract void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0);
public abstract void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc);
public abstract void SpeedMove(string portName, short slvAddr, int speed);
public abstract void SuddenStop(string portName, short slvAddr);
public abstract bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false);
public abstract void AbsMove(string portName, short slvAddr, int targetPosition, int targetSpeed=0 , int ptpAcc=0, int ptpDec=0);
public abstract void AlarmClear(string portName, short slvAddr);
public abstract int GetTargetPosition(string portName, short slvAddr);
public abstract int GetActualtPosition(string portName, short slvAddr);
public abstract int GetAlarmStatus(string portName, short slvAddr);
public abstract int GetBusyStatus(string portName, short slvAddr);
public abstract int GetHomeEndStatus(string portName, short slvAddr);
public abstract int GetHomeSingle(string portName, short slvAddr);
/// <summary>
/// 负极限
/// </summary>
public abstract int GetLimitNegativeSingle(string portName, short slvAddr);
/// <summary>
/// 正极限
/// </summary>
public abstract int GetLimitPositiveSingle(string portName, short slvAddr);
}
}
using HuichuanLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class HCAxisManager : AxisManager
{
public override void AbsMove(string portName, short slvAddr, int targetPosition, int targetSpeed=0,int ptpAcc=0,int ptpDec=0)
{
HCBoardManager.AbsMove((short)slvAddr, targetPosition, targetSpeed, ptpAcc, ptpDec);
}
public override void AlarmClear(string portName, short slvAddr)
{
HCBoardManager.ClearAxisSts((short)slvAddr);
}
public override void ClearSpeed()
{
}
public override void CloseAllPort()
{
}
public override void ColsePort(string portName)
{
}
public override int GetActualtPosition(string portName, short slvAddr)
{
return (int)HCBoardManager.GetAxisCurrPos(slvAddr);
}
public override int GetAlarmStatus(string portName, short slvAddr)
{
AxisSts axisS= HCBoardManager.GetAxisSts(slvAddr);
return axisS.ALM;
}
public override int GetBusyStatus(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.BUSY;
}
public override int GetHomeEndStatus(string portName, short slvAddr)
{
return (int) HCBoardManager.GetHomeStatus(slvAddr);
}
public override int GetHomeSingle(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.ALM;
}
public override int GetLimitNegativeSingle(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.NEL;
}
public override int GetLimitPositiveSingle(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.PEL;
}
public override int GetTargetPosition(string portName, short slvAddr)
{
return (int)HCBoardManager.GetAxisPrfPos(slvAddr);
}
public override void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc)
{
HCBoardManager.StartHomeMove(slvAddr,(uint) highVel, (uint)lowVel, (uint)acc);
}
public override void InitSlvAddr(string portName, short slvAddr)
{
}
public override void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed)
{
}
public override bool IsHomeMoveEnd(string portName, short slvAddr)
{
return HCBoardManager.HomeingIsEnd(slvAddr);
}
public override bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false)
{
return HCBoardManager.IsInPosition(Axis.GetAxisValue(), PPosition,Axis .CanErrorCountMax);
}
public override bool OpenPort(string portName)
{
return true;
}
public override void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0)
{
HCBoardManager.RelMove(slvAddr, position, targetSpeed, ptpAcc, ptpDec);
}
public override bool ServerOnStatus(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.ServoOn.Equals(1);
}
public override void ServoOff(string portName, short slvAddr)
{
HCBoardManager.ServoOff(slvAddr);
}
public override void ServoOn(string portName, short slvAddr)
{
HCBoardManager.ServoOn(slvAddr);
}
public override void SpeedMove(string portName, short slvAddr, int speed)
{
HCBoardManager.SpeedMove(slvAddr, speed);
}
public override void SuddenStop(string portName, short slvAddr)
{
HCBoardManager.AxisStop(slvAddr);
}
}
}
......@@ -8,19 +8,18 @@ using System.Text;
using System.Threading;
namespace OnlineStore.DeviceLibrary
{
{
/// <summary>
/// 外部调用的接口放在此文件中
/// </summary>
public partial class ACServerManager
public partial class ACServerManager : AxisManager
{
public static bool IsShowMsg = false ;
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 = "";
private static int GetAddrValue(string portName, int slvAddr, string addr)
private int SleepMSendons = 20;
private int ReviceOutTimeMS = 100;
private Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
private string mapObj = "";
private int GetAddrValue(string portName, short slvAddr, string addr)
{
int value = -1;
try
......@@ -43,7 +42,7 @@ namespace OnlineStore.DeviceLibrary
}
return value;
}
private static void UpdateAddrValue(string portName, int slvAddr, string addr, int value)
private void UpdateAddrValue(string portName, short slvAddr, string addr, int value)
{
try
{
......@@ -75,12 +74,12 @@ namespace OnlineStore.DeviceLibrary
}
public static void ClearSpeed()
public override void ClearSpeed()
{
LogUtil.info("清理之前设置保存的速度列表");
ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
}
public static bool OpenPort(string portName)
public override bool OpenPort(string portName)
{
if (serialBeanMap.ContainsKey(portName))
{
......@@ -109,7 +108,7 @@ namespace OnlineStore.DeviceLibrary
return true;
}
public static void ColsePort(string portName)
public override void ColsePort(string portName)
{
AcSerialBean bean = GetSerialBean(portName);
if (bean == null)
......@@ -129,7 +128,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("ACServerManager 关闭串口【" + portName + "】 ");
}
public static void CloseAllPort()
public override void CloseAllPort()
{
List<string> kes = new List<string>(serialBeanMap.Keys);
foreach (string key in kes)
......@@ -137,49 +136,50 @@ namespace OnlineStore.DeviceLibrary
ColsePort(key);
}
}
/// <summary>
/// 是否成功打开伺服
/// </summary>
public static bool ServerOnStatus(string portName, int slvAddr)
public override bool ServerOnStatus(string portName, short slvAddr)
{
if (!serialBeanMap.ContainsKey(portName))
{
return false ;
return false;
}
PreReadCoilAddr = ACCMDManager.ServerOn_Addr;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, PreReadCoilAddr, "0000", 1);
//SendData(portName,dataArray);
byte[] reviceData = SendCommand(portName, dataArray, ReviceOutTimeMS, 6);
int result= GetCoilData(portName, reviceData, PreReadCoilAddr);
int result = GetCoilData(portName, reviceData, PreReadCoilAddr);
//TODO
return result>=1;
return result >= 1;
}
/// <summary>
/// 是否原点返回完成
/// </summary>
public static bool IsHomeMoveEnd(string portName, int slvAddr)
public override bool IsHomeMoveEnd(string portName, short slvAddr)
{
int status = GetHomeEndStatus(portName, slvAddr);
if (status >= 1)
{
return true;
} return false;
}
return false;
}
public static void InitSlvAddr(string portName, int slvAddr)
public override void InitSlvAddr(string portName, short slvAddr)
{
InitSlvAddr(portName, slvAddr, 100, 30, 30 );
InitSlvAddr(portName, slvAddr, 100, 30, 30);
//InitSlvAddr(portName, slvAddr, 100, 30, 30, 100, 50, 30);
}
//把数字转换为四位的字符串
public static string SpeedToStr(int speed,int length)
public string SpeedToStr(int speed, int length)
{
string str = String.Format("{0:X}", speed);
return str.PadLeft(length, '0');
}
public static void InitSlvAddr(string portName, int slvAddr,int targetSpeed,int addSpeed,int delSpeed )
//public static void InitSlvAddr(string portName, int slvAddr,int targetSpeed,int addSpeed,int delSpeed,int homeHighSpeed,int homeLowSpeed,int homeAddSpeed)
public override void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed)
//public void InitSlvAddr(string portName, short slvAddr,int targetSpeed,int addSpeed,int delSpeed,int homeHighSpeed,int homeLowSpeed,int homeAddSpeed)
{
LogUtil.info("开始初始化伺服【" + portName + "】【" + slvAddr + "】");
//写入block
......@@ -187,10 +187,10 @@ namespace OnlineStore.DeviceLibrary
string slvAddrStr = string.Format(strFromat, slvAddr);
//block0=原点返回,正方向
string str0 = slvAddrStr + "104800 000408 00000420 00000000 ffff";
SendStrAndSleep(portName, str0, sleep);
SendStrAndSleep(portName, str0, sleep);
//block1=原点返回,反方向
string str1 = slvAddrStr + "104804 000408 04000420 00000000 ffff";
SendStrAndSleep(portName, str1, sleep);
SendStrAndSleep(portName, str1, sleep);
//block2=绝对位置运动
string str2 = slvAddrStr + "104808 000408 10000211EC78FFFF ffff";
SendStrAndSleep(portName, str2, sleep);
......@@ -230,15 +230,15 @@ namespace OnlineStore.DeviceLibrary
//SendStrAndSleep(portName, slvAddrStr + "06 4639 " + SpeedToStr(homeAddSpeed, 4) + " ffff", sleep);
//UpdateEEPROM(portName, slvAddr);
}
public static void UpdateEEPROM(string portName, int slvAddr)
public void UpdateEEPROM(string portName, short slvAddr)
{
string addr = ACCMDManager.EEPROM_Param_Addr;
string data = "6173";
string data = "6173";
int length = 2;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, addr, data, length);
SendData(portName, dataArray, 5);
}
public static void ServoOn(string portName, int slvAddr)
public override void ServoOn(string portName, short slvAddr)
{
string addr = ACCMDManager.ServerOn_Addr;
string data = "FF00";
......@@ -249,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
SendData(portName, dataArray);
}
public static void ServoOff(string portName, int slvAddr)
public override void ServoOff(string portName, short slvAddr)
{
string addr = ACCMDManager.ServerOn_Addr;
string data = "0000";
......@@ -259,16 +259,19 @@ namespace OnlineStore.DeviceLibrary
SendData(portName, dataArray);
}
public static void RelMove(string portName, int slvAddr, int position,int targetSpeed)
{
//先更新速度
string slvAddrStr = string.Format(strFromat, slvAddr);
string v1 = slvAddrStr + "064601 " + SpeedToStr(targetSpeed, 4) + " ffff";
SendStrAndSleep(portName, v1,SleepMSendons);
public override void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0)
{
if (targetSpeed != 0)
{
//先更新速度
string slvAddrStr = string.Format(strFromat, slvAddr);
string v1 = slvAddrStr + "064601 " + SpeedToStr(targetSpeed, 4) + " ffff";
SendStrAndSleep(portName, v1, SleepMSendons);
}
RelMove(portName, slvAddr, position);
}
public static void RelMove(string portName, int slvAddr, int position)
private void RelMove(string portName, short slvAddr, int position)
{
//int position = Convert.ToInt32(txtPosition.Text);
byte[] positionData = AcSerialBean.StringToByte(position.ToString("X8"));
......@@ -307,15 +310,16 @@ namespace OnlineStore.DeviceLibrary
}
data = ACCMDManager.buildCheckData(data, data.Length - 2);
SendData(portName, data);
System.Threading.Thread.Sleep(SleepMSendons);
UpdateBlock(portName, slvAddr, ACCMDManager.Block_RelMove);
System.Threading.Thread.Sleep(SleepMSendons);
UpdateBlock(portName, slvAddr, ACCMDManager.Block_RelMove);
OpenAndCloseSTB(portName, slvAddr);
}
public static void HomeMove(string portName, int slvAddr, int speed)
public override void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc)
{
try
{
int speed = highVel;
//先判断是否在原点,如果已经在原点,先向正方向走2000
int homeSingle = GetHomeSingle(portName, slvAddr);
if (homeSingle.Equals(1))
......@@ -323,8 +327,8 @@ namespace OnlineStore.DeviceLibrary
int isHomeEnd = GetHomeEndStatus(portName, slvAddr);
if (isHomeEnd.Equals(1))
{
int value = 2000;
LogUtil.info("轴【" + portName +"_"+slvAddr +"】原点返回时发现原点已亮且回过原点,需要先相对走" + value);
int value = 2000;
LogUtil.info("轴【" + portName + "_" + slvAddr + "】原点返回时发现原点已亮且回过原点,需要先相对走" + value);
RelMove(portName, slvAddr, value);
bool isStop = false;
for (int i = 0; i <= 10; i++)
......@@ -345,19 +349,20 @@ namespace OnlineStore.DeviceLibrary
}
else
{
int volSpeed =Math.Abs( speed / 5);
int volSpeed = Math.Abs(speed / 5);
int time = 1500;
LogUtil.info("轴【" + portName + "_" + slvAddr + "】原点返回时发现原点已亮但未回过原点,先匀速向上走"+time+",速度["+ volSpeed + "]" );
LogUtil.info("轴【" + portName + "_" + slvAddr + "】原点返回时发现原点已亮但未回过原点,先匀速向上走" + time + ",速度[" + volSpeed + "]");
//需要匀速向上走
ACServerManager.SpeedMove(portName, slvAddr, volSpeed);
SpeedMove(portName, slvAddr, volSpeed);
Thread.Sleep(time);
LogUtil.info("轴【" + portName + "_" + slvAddr + "】匀速 已等待" + time + ",直接停止");
SuddenStop(portName, slvAddr);
Thread.Sleep(100);
}
}
}catch(Exception ex)
}
catch (Exception ex)
{
LogUtil.error("轴【" + portName + "_" + slvAddr + "】原点返回前验证是否在原点出错:" + ex.StackTrace);
}
......@@ -366,12 +371,12 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
public static void SetSpeed(string portName, int slvAddr, int speed)
private void SetSpeed(string portName, short slvAddr, int speed)
{
int preSpeed = GetAddrValue(portName, slvAddr, ACCMDManager.Speed_Addr);
if ((preSpeed.Equals(-1)) || (!preSpeed.Equals(Math.Abs(speed))))
{
string v1 = slvAddr + "064601 " + ACServerManager.SpeedToStr(speed, 4) + " ffff";
string v1 = slvAddr + "064601 " + SpeedToStr(speed, 4) + " ffff";
LogUtil.debug("轴【" + portName + "_" + slvAddr + "】更新速度为【" + speed + "】,发送数据【" + v1 + "】");
Thread.Sleep(SleepMSendons);
for (int i = 1; i <= 3; i++)
......@@ -386,30 +391,30 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("轴【" + portName + "_" + slvAddr + "】更新速度为【" + speed + "】,发送数据【" + v1 + "】,第【" + i + "】次失败");
Thread.Sleep(SleepMSendons);
}
}
}
UpdateAddrValue(portName, slvAddr, ACCMDManager.Speed_Addr, Math.Abs(speed));
Thread.Sleep(SleepMSendons);
}
}
public static void SpeedMove(string portName, int slvAddr, int speed)
public override void SpeedMove(string portName, short slvAddr, int speed)
{
SetSpeed(portName, slvAddr, speed);
SetSpeed(portName, slvAddr, speed);
if (speed > 0)
{
{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_VolMove0);
}
else
{
{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_VolMove1);
}
//Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
public static bool isInPosition(ConfigMoveAxis Axis, int PPosition,bool isLog=false )
public override bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false)
{
int outCount = ACServerManager.GetActualtPosition(Axis.DeviceName, Axis.GetAxisValue());
int errorCount = Math.Abs(outCount - PPosition);
int outCount = GetActualtPosition(Axis.DeviceName, Axis.GetAxisValue());
int errorCount = Math.Abs(outCount - PPosition);
if (errorCount <= Axis.CanErrorCountMin)
{
if (isLog)
......@@ -428,23 +433,25 @@ namespace OnlineStore.DeviceLibrary
}
}
public static void AbsMove(string portName, int slvAddr, int targetPosition, int targetSpeed)
public override void AbsMove(string portName, short slvAddr, int targetPosition, int targetSpeed=0,int ptpAcc=0,int ptpDec=0)
{
//先更新速度
string slvAddrStr = string.Format(strFromat, slvAddr);
int preSpeed = GetAddrValue(portName,slvAddr, ACCMDManager.Speed_Addr);
if ((preSpeed.Equals(-1)) || (!preSpeed.Equals(targetSpeed)))
if (targetSpeed != 0)
{
//速度 V1 =100
string v1 = slvAddrStr + "064601 " + SpeedToStr(targetSpeed, 4) + " ffff";
SendStrAndSleep(portName, v1, SleepMSendons);
UpdateAddrValue(portName,slvAddr, ACCMDManager.Speed_Addr, targetSpeed);
int preSpeed = GetAddrValue(portName, slvAddr, ACCMDManager.Speed_Addr);
if ((preSpeed.Equals(-1)) || (!preSpeed.Equals(targetSpeed)))
{
//速度 V1 =100
string v1 = slvAddrStr + "064601 " + SpeedToStr(targetSpeed, 4) + " ffff";
SendStrAndSleep(portName, v1, SleepMSendons);
UpdateAddrValue(portName, slvAddr, ACCMDManager.Speed_Addr, targetSpeed);
}
}
//绝对运动
AbsMove(portName, slvAddr, targetPosition);
}
public static void AbsMove(string portName, int slvAddr, int position)
private void AbsMove(string portName, short slvAddr, int position)
{
//int position = Convert.ToInt32(txtPosition.Text, 10);
byte[] positionData = AcSerialBean.StringToByte(position.ToString("X8"));
......
......@@ -11,15 +11,14 @@ namespace OnlineStore.DeviceLibrary
{
partial class ACServerManager
{
private static Dictionary<int, Dictionary<string, RegisterInfo>> LastDataMap = new Dictionary<int, Dictionary<string, RegisterInfo>>();
{
private Dictionary<int, Dictionary<string, RegisterInfo>> LastDataMap = new Dictionary<int, Dictionary<string, RegisterInfo>>();
//private static SerialBean bean = null;
private static string strFromat = "{0:X2}";
private static Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
//private SerialBean bean = null;
private string strFromat = "{0:X2}";
private Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
private static AcSerialBean GetSerialBean(string portName)
private AcSerialBean GetSerialBean(string portName)
{
if (serialBeanMap.ContainsKey(portName))
{
......@@ -28,7 +27,7 @@ namespace OnlineStore.DeviceLibrary
return null;
}
public static bool SendStrAndSleep(string portName, string str, int sleepS)
private bool SendStrAndSleep(string portName, string str, int sleepS)
{
byte[] data = AcSerialBean.StringToByte(str);
data[data.Length - 1] = 0x00;
......@@ -37,9 +36,9 @@ namespace OnlineStore.DeviceLibrary
bool result = SendData(portName, data);
System.Threading.Thread.Sleep(sleepS);
return result;
}
}
public static void SaveData(string portName, byte slvAddr, string regAddr, int value)
private void SaveData(string portName, byte slvAddr, string regAddr, int value)
{
if (LastDataMap.ContainsKey(slvAddr))
{
......@@ -59,7 +58,7 @@ namespace OnlineStore.DeviceLibrary
LastDataMap.Add(slvAddr, map);
}
}
public static RegisterInfo GetData(string portName, byte slvAddr, string regAddr)
private RegisterInfo GetData(string portName, byte slvAddr, string regAddr)
{
if (LastDataMap.ContainsKey(slvAddr))
{
......@@ -71,7 +70,7 @@ namespace OnlineStore.DeviceLibrary
return null;
}
public static void SendData(string portName, byte[] data, int reviceLength)
private void SendData(string portName, byte[] data, int reviceLength)
{
if (data == null)
{
......@@ -89,7 +88,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info( "串口" + portName + " 收到数据:" + strSend + "");
}
}
public static bool SendData(string portName, byte[] data)
private bool SendData(string portName, byte[] data)
{
if (data == null)
{
......@@ -117,7 +116,7 @@ namespace OnlineStore.DeviceLibrary
/// <param name="data">发送的数据</param>
/// <param name="outTime">超时时间</param>
/// <returns>返回值的长度</returns>
public static byte[] SendCommand(string portName, byte[] data, int outTime, int reviceLength)
private byte[] SendCommand(string portName, byte[] data, int outTime, int reviceLength)
{
if (outTime <100)
{
......@@ -172,7 +171,7 @@ namespace OnlineStore.DeviceLibrary
/// <param name="outTime">超时时间</param>
/// <param name="result">返回结果,是否发送成功</param>
/// <returns>返回值的长度</returns>
public static byte[] SendCommand(string portName, byte[] data, int outTime, int reviceLength,out bool result)
private byte[] SendCommand(string portName, byte[] data, int outTime, int reviceLength,out bool result)
{
if (outTime < 100)
{
......@@ -224,12 +223,12 @@ namespace OnlineStore.DeviceLibrary
return returnData;
}
public static void WriteData(string portName, int slvAddr, string addr, string data, byte cmd, int length)
private void WriteData(string portName, short slvAddr, string addr, string data, byte cmd, int length)
{
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, cmd, addr, data, length);
SendData(portName, dataArray);
}
public static void SendStr(string portName, int slvAddr, string str)
private void SendStr(string portName, short slvAddr, string str)
{
//string str = txtSendStr.Text;
byte[] data = AcSerialBean.StringToByte(str);
......@@ -239,29 +238,8 @@ namespace OnlineStore.DeviceLibrary
SendData(portName, data);
}
public static void Stop(string portName, int slvAddr)
{
//RunBlock(6);
string addr = ACCMDManager.Stop_Addr;
string data = "FF00";
//byte cmd = 0x05;
int length = 2;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
System.Threading.Thread.Sleep(1000);
data = "0000";
dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
}
public static void SuddenStop(ConfigMoveAxis axis)
{
if (GetBusyStatus(axis.DeviceName, axis.GetAxisValue()).Equals(1))
{
SuddenStop(axis.DeviceName, axis.GetAxisValue());
}
}
public static void SuddenStop(string portName, int slvAddr)
public override void SuddenStop(string portName, short slvAddr)
{
// RunBlock(7);
string addr = ACCMDManager.SDStop_Addr;
......@@ -275,9 +253,9 @@ namespace OnlineStore.DeviceLibrary
data = "0000";
dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
}
}
public static void OpenAndCloseSTB(string portName, int slvAddr)
private void OpenAndCloseSTB(string portName, short slvAddr)
{
OnlyOpenSTB(portName, slvAddr);
System.Threading.Thread.Sleep(200);
......@@ -285,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
System.Threading.Thread.Sleep(SleepMSendons);
}
public static void OnlyOpenSTB(string portName, int slvAddr)
private void OnlyOpenSTB(string portName, short slvAddr)
{
string addr = ACCMDManager.STB_Addr;
string data = "FF00";
......@@ -293,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
}
public static void CloseSTB(string portName, int slvAddr)
private void CloseSTB(string portName, short slvAddr)
{
string addr = ACCMDManager.STB_Addr;
string data = "0000";
......@@ -302,7 +280,7 @@ namespace OnlineStore.DeviceLibrary
SendData(portName, dataArray);
}
public static void UpdateBlock(string portName, int slvAddr, string blockNum)
private void UpdateBlock(string portName, short slvAddr, string blockNum)
{
int preNum = GetAddrValue(portName,slvAddr, ACCMDManager.BlockNo);
if (preNum.Equals(-1) || (!preNum.ToString().Equals(blockNum)))
......@@ -315,7 +293,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public static void AlarmClear(string portName, int slvAddr)
public override void AlarmClear(string portName, short slvAddr)
{
string addr = ACCMDManager.Clear_Alarm_Addr;
string data = "FF00";
......@@ -328,7 +306,7 @@ namespace OnlineStore.DeviceLibrary
dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
}
public static void CloseAlarmClear(string portName, int slvAddr)
private void CloseAlarmClear(string portName, short slvAddr)
{
string addr = ACCMDManager.Clear_Alarm_Addr;
string data = "0000";
......@@ -338,10 +316,10 @@ namespace OnlineStore.DeviceLibrary
SendData(portName, dataArray);
}
private static string PreReadAddr = "";
private static string PreReadCoilAddr = "";
private string PreReadAddr = "";
private string PreReadCoilAddr = "";
public static int GetRegisterData(string portName, byte[] reviceData, string Address)
private int GetRegisterData(string portName, byte[] reviceData, string Address)
{
if (reviceData != null && reviceData.Length > 0)
{
......@@ -369,7 +347,7 @@ namespace OnlineStore.DeviceLibrary
}
return -1;
}
public static int GetTargetPosition(string portName, int slvAddr)
public override int GetTargetPosition(string portName, short slvAddr)
{
PreReadAddr = ACCMDManager.TargetPostion;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadRegisters, ACCMDManager.TargetPostion, "0000", 2);
......@@ -378,11 +356,8 @@ namespace OnlineStore.DeviceLibrary
return GetRegisterData(portName, reviceData, ACCMDManager.TargetPostion);
}
public static int GetActualtPosition(ConfigMoveAxis axis)
{
return GetActualtPosition(axis.DeviceName, axis.GetAxisValue());
}
public static int GetActualtPosition(string portName, int slvAddr)
public override int GetActualtPosition(string portName, short slvAddr)
{
PreReadAddr = ACCMDManager.ActualPosition;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadRegisters, ACCMDManager.ActualPosition, "0000", 2);
......@@ -405,7 +380,7 @@ namespace OnlineStore.DeviceLibrary
return result;
}
public static int GetCoilData(string portName, byte[] reviceData, string Address)
private int GetCoilData(string portName, byte[] reviceData, string Address)
{
if (reviceData != null && reviceData.Length > 0)
{
......@@ -434,7 +409,7 @@ namespace OnlineStore.DeviceLibrary
}
return -1;
}
public static int GetAlarmStatus(string portName, int slvAddr)
public override int GetAlarmStatus(string portName, short slvAddr)
{
PreReadCoilAddr = ACCMDManager.Alarm_Status;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, PreReadCoilAddr, "0000", 1);
......@@ -443,7 +418,7 @@ namespace OnlineStore.DeviceLibrary
return GetCoilData(portName, reviceData, PreReadCoilAddr);
}
public static int GetBusyStatus(string portName, int slvAddr)
public override int GetBusyStatus(string portName, short slvAddr)
{
PreReadCoilAddr = ACCMDManager.BUSYStatus;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.BUSYStatus, "0000", 1);
......@@ -452,7 +427,7 @@ namespace OnlineStore.DeviceLibrary
return GetCoilData(portName, reviceData, ACCMDManager.BUSYStatus);
}
public static int GetHomeEndStatus(string portName, int slvAddr)
public override int GetHomeEndStatus(string portName, short slvAddr)
{
PreReadCoilAddr = ACCMDManager.HOME_CMP_Status;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.HOME_CMP_Status, "0000", 1);
......@@ -461,7 +436,7 @@ namespace OnlineStore.DeviceLibrary
return GetCoilData(portName, reviceData, ACCMDManager.HOME_CMP_Status);
}
public static int GetHomeSingle(string portName, int slvAddr)
public override int GetHomeSingle(string portName, short slvAddr)
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Home_Single, "0000", 1);
......@@ -471,7 +446,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 负极限
/// </summary>
public static int GetLimitNegativeSingle(string portName, int slvAddr)
public override int GetLimitNegativeSingle(string portName, short slvAddr)
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Limit_Negative_Single, "0000", 1);
......@@ -481,21 +456,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 负极限
/// </summary>
public static int GetLimitNegativeSingle(ConfigMoveAxis axis)
{
return GetLimitNegativeSingle(axis.DeviceName, axis.GetAxisValue());
}
/// <summary>
/// 正极限
/// </summary>
public static int GetLimitPositiveSingle(ConfigMoveAxis axis)
{
return GetLimitPositiveSingle(axis.DeviceName, axis.GetAxisValue());
}
/// <summary>
/// 正极限
/// </summary>
public static int GetLimitPositiveSingle(string portName, int slvAddr)
public override int GetLimitPositiveSingle(string portName, short slvAddr)
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Limit_Positive_Single, "0000", 1);
......@@ -508,14 +473,14 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public class RegisterInfo
{
public RegisterInfo(int slv, string addr, int data)
public RegisterInfo(short slv, string addr, int data)
{
this.SlvAddr = slv;
this.RegisterAddr = addr;
this.LastData = data;
this.LastTime = new DateTime();
}
public int SlvAddr { get; set; }
public short SlvAddr { get; set; }
public string RegisterAddr { get; set; }
......
......@@ -59,14 +59,17 @@
<Compile Include="acSingleStore\BoxBean_Partial.cs" />
<Compile Include="acSingleStore\StoreBean.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="AXIS\AxisManager.cs" />
<Compile Include="AXIS\HC\HCAxisManager.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="IO\HCIOManager.cs" />
<Compile Include="IO\IOManager.cs" />
<Compile Include="IO\KangNaiDe\KNDManager.cs" />
<Compile Include="IO\KangNaiDe\MasterTcpClient.cs" />
<Compile Include="lineConnect\LineConnect.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="AXIS\PanasonicServo\ACCMDManager.cs" />
<Compile Include="AXIS\PanasonicServo\ACServerManager.cs" />
<Compile Include="AXIS\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
......@@ -94,6 +97,10 @@
<Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\HuichuanLibrary\HuichuanLibrary.csproj">
<Project>{c9575c5e-9d4b-4b4f-be41-926652b8985f}</Project>
<Name>HuichuanLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\LoadCVSLibrary\LoadCSVLibrary.csproj">
<Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project>
<Name>LoadCSVLibrary</Name>
......
using HuichuanLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary.IO
{
public class HCIOManager : IOManager
{
public override void CloseAllConnection()
{
}
public override void CloseAllDO()
{
HCBoardManager.CloseAllDO();
}
public override void ConnectionIOList(List<string> dIODeviceNameList)
{
if (dIODeviceNameList.Count > 0 && dIODeviceNameList.Contains("HC"))
{
if (!HCBoardManager.CardInitOk())
{
HCBoardManager.InitCard();
}
}
}
public override IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort index)
{
short v = HCBoardManager.GetBitDI((short)index);
return (IO_VALUE)v;
}
public override IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort index)
{
short v = HCBoardManager.GetBitDO((short)index);
return (IO_VALUE)v;
}
public override IO_VALUE GetIOValue(ConfigIO configIO)
{
short index =(short) configIO.GetIOAddr();
short v = HCBoardManager.GetBitDO(index);
return (IO_VALUE)v;
}
public override void ReadAllDI(string deviceName, byte slaveId)
{
}
public override void ReadAllDO(string deviceName, byte slaveId)
{
}
public override void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value, int time)
{
try
{
short v = (short)value;
HCBoardManager.SetBitDO((short)index, v);
short targetV = 0;
if (v.Equals((short)0))
{
targetV = 1;
}
//写入之后,等待指定间隔后回写
System.Timers.Timer mytimer = new System.Timers.Timer(time);
mytimer.Elapsed += (o1, e1) =>
{
try
{
HCBoardManager.SetBitDO((short)index, targetV);
}
catch (Exception ex)
{
LogUtil.error("**********定时回写入 出错:" + ex.StackTrace);
}
};
mytimer.AutoReset = false;
mytimer.Enabled = true;
}
catch (Exception ex)
{
LogUtil.error("AIO WriteSingleDO [" + index + "] 出错:" + ex.ToString());
}
}
public override void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value)
{
short v = (short)value;
HCBoardManager.SetBitDO((short)index, v);
}
}
}
using OnlineStore.Common;
using OnlineStore.DeviceLibrary.IO;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
......@@ -21,14 +22,8 @@ namespace OnlineStore.DeviceLibrary
{
if (StoreManager.Config.DOList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.DOList[ioType];
//DateTime time = DateTime.Now;
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
//TimeSpan span = DateTime.Now - time;
//if (span.TotalMilliseconds > 100)
//{
// LogUtil.error("IOMove [" + ioType + "] ["+ioValue+"]耗时" + span.TotalMilliseconds);
//}
ConfigIO configIo = StoreManager.Config.DOList[ioType];
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
Thread.Sleep(60);
}
else
......@@ -74,14 +69,21 @@ namespace OnlineStore.DeviceLibrary
#endregion
public static void Init()
{
bool isAIOBox = ConfigAppSettings.GetIntValue(Setting_Init.UseAIOBOX).Equals(1);
if (isAIOBox)
bool UseHCBoard = ConfigAppSettings.GetIntValue(Setting_Init.UseHCBoard).Equals(1);
if (UseHCBoard)
{
instance = new AIOBOXManager();
instance = new HCIOManager();
}
else
{
instance = new KNDManager();
bool isAIOBox = ConfigAppSettings.GetIntValue(Setting_Init.UseAIOBOX).Equals(1); if (isAIOBox)
{
instance = new AIOBOXManager();
}
else
{
instance = new KNDManager();
}
}
}
public abstract void ReadAllDI(string deviceName, byte slaveId);
......@@ -93,10 +95,10 @@ namespace OnlineStore.DeviceLibrary
public abstract void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value);
public abstract IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort index);
public abstract IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort index);
public abstract IO_VALUE GetIOValue(ConfigIO configIO);
......
......@@ -64,18 +64,13 @@ namespace OnlineStore.DeviceLibrary
PositionNumList = new List<string>();
foreach (ACStorePosition position in positionList)
{
// if (position.StoreId.Equals(StoreID))
bool result = ACStorePosition.CheckPosition(position, Config);
if (result && position.StoreId.Equals(DeviceID))
{
bool result = ACStorePosition.CheckPosition(position, Config);
if (result&&position.StoreId.Equals(DeviceID))
{
PositionNumList.Add(position.PositionNum);
}
PositionNumList.Add(position.PositionNum);
}
}
IOManager.Init();
//IOManager.instance.ConnectionIOList(Config.DIODeviceNameList);
mainTimer.Enabled = false;
int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
......@@ -251,9 +246,9 @@ namespace OnlineStore.DeviceLibrary
}
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = StoreAlarmType.None;
......@@ -323,7 +318,7 @@ namespace OnlineStore.DeviceLibrary
break;
case StoreMoveStep.BOX_H_InOutToP1:
//如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
if (AxisManager.instance.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
LogUtil.error( "进出轴报警!复位失败,请检查!");
}
......@@ -466,7 +461,7 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H_InOutToP1:
//如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
if (AxisManager.instance.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
WarnMsg = "进出轴报警!复位失败,请检查!";
LogUtil.error( "进出轴报警!复位失败,请检查!");
......@@ -510,18 +505,18 @@ namespace OnlineStore.DeviceLibrary
{
string portName = moveAxis.DeviceName;
short slvAddr = moveAxis.GetAxisValue();
ACServerManager.OpenPort(portName);
AxisManager.instance.OpenPort(portName);
Thread.Sleep(50);
//初始化串口
//ACServerManager.InitSlvAddr(portName, slvAddr);
//AxisManager.instance.InitSlvAddr(portName, slvAddr);
if (!IsIntSlvBlock)
{
ACServerManager.InitSlvAddr(portName, slvAddr, moveAxis.TargetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed);
AxisManager.instance.InitSlvAddr(portName, slvAddr, moveAxis.TargetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed);
Thread.Sleep(100);
}
ACServerManager.AlarmClear(portName, slvAddr);
AxisManager.instance.AlarmClear(portName, slvAddr);
Thread.Sleep(50);
ACServerManager.ServoOn(portName, slvAddr);
AxisManager.instance.ServoOn(portName, slvAddr);
}
Thread.Sleep(500);
//打开所有轴
......@@ -545,7 +540,7 @@ namespace OnlineStore.DeviceLibrary
//判断轴是否正常
foreach (ConfigMoveAxis axis in moveAxisList)
{
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
if (AxisManager.instance.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{
LogUtil.info( Name + "成功打开轴:" + axis.Explain);
}
......@@ -553,17 +548,17 @@ namespace OnlineStore.DeviceLibrary
{
//清理报警,再重新打开一次
LogUtil.info( Name + "第一次打开轴" + axis.Explain + "失败,先清理一下报警,再重新打开一次");
ACServerManager.AlarmClear(axis.DeviceName, axis.GetAxisValue());
AxisManager.instance.AlarmClear(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(1200);
ACServerManager.ServoOn(axis.DeviceName, axis.GetAxisValue());
AxisManager.instance.ServoOn(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(100);
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
if (AxisManager.instance.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{
LogUtil.info( Name + "清理报警后重新打卡轴成功:" + axis.Explain);
}
else
{
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
AxisManager.instance.ServoOff(axis.DeviceName, axis.GetAxisValue());
int alarmCode = GetAlarmCodeByAxis(axis);
WarnMsg = Name + "打开轴" + axis.Explain + "失败 ";
LogUtil.info( Name + WarnMsg);
......@@ -581,9 +576,9 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
foreach (ConfigMoveAxis axis in moveAxisList)
{
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
AxisManager.instance.ServoOff(axis.DeviceName, axis.GetAxisValue());
//关闭串口,等下次重新打开
// ACServerManager.ColsePort(axis.DeviceName);
// AxisManager.instance.ColsePort(axis.DeviceName);
}
Thread.Sleep(100);
IOManager.IOMove(IO_Type.Run_Signal, IO_VALUE.LOW);
......@@ -1065,7 +1060,7 @@ namespace OnlineStore.DeviceLibrary
string deviceName = axisInfo.GetNameStr();
AxisAlarmInfo info = AxisAlarmCodeMap[deviceName];
int alarmIo = ACServerManager.GetAlarmStatus(deviceName, axis);
int alarmIo = AxisManager.instance.GetAlarmStatus(deviceName, axis);
if (alarmIo == 1)
{
......@@ -1096,10 +1091,10 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
//运动版停止
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
CloseAllAxis();
......
......@@ -28,7 +28,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.SC_04_Inventory);//直接跑到库位点,不使用盘点信号
//StoreMove.NextMoveStep(StoreMoveStep.SC_02_MoveToLBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
int outCount = ACServerManager.GetActualtPosition(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
int outCount = AxisManager.instance.GetActualtPosition(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
int disCount = Math.Abs(outCount - moveP.UpDown_P5);
if (disCount > 150000)
{
......@@ -50,18 +50,19 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep == StoreMoveStep.SC_03_MoveToHBag)
{
MoveInfo.NextMoveStep(StoreMoveStep.SC_04_Inventory);
CheckPositionLog(" 升降轴到目标位置, 当前位置=" + ACServerManager.GetActualtPosition(Config.UpDown_Axis) + " 目标位置=" + ACServerManager.GetTargetPosition(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()));
//ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
CheckPositionLog(" 升降轴到目标位置, 当前位置=" + AxisManager.instance.GetActualtPosition(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()) +
" 目标位置=" + AxisManager.instance.GetTargetPosition(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()));
//AxisManager.instance.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
//int outCount = ACServerManager.GetActualtPosition(Config.UpDown_Axis);
//int outCount = AxisManager.instance.GetActualtPosition(Config.UpDown_Axis);
//int errorCount = Math.Abs(outCount - moveP.UpDown_P9);
//if (errorCount <= Config.UpDown_Axis.CanErrorCountMax)
//{
// CheckPositionLog(" 升降轴到目标位置, 当前位置=" + ACServerManager.GetActualtPosition(Config.UpDown_Axis)+" 目标位置="+ moveP.UpDown_P9 + " errorCount="+ errorCount);
// CheckPositionLog(" 升降轴到目标位置, 当前位置=" + AxisManager.instance.GetActualtPosition(Config.UpDown_Axis)+" 目标位置="+ moveP.UpDown_P9 + " errorCount="+ errorCount);
//}
//else
//{
// CheckPositionLog(" 升降轴运动过程中检测到料盘, 当前位置=" + ACServerManager.GetActualtPosition(Config.UpDown_Axis) + " 目标位置=" + moveP.UpDown_P9 + " errorCount=" + errorCount+ " Config.UpDown_Axis.CanErrorCountMax=" + Config.UpDown_Axis.CanErrorCountMax);
// CheckPositionLog(" 升降轴运动过程中检测到料盘, 当前位置=" + AxisManager.instance.GetActualtPosition(Config.UpDown_Axis) + " 目标位置=" + moveP.UpDown_P9 + " errorCount=" + errorCount+ " Config.UpDown_Axis.CanErrorCountMax=" + Config.UpDown_Axis.CanErrorCountMax);
//}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cid", CID);//cid = 料仓CID
......
......@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
private void InOutBackToP1(int InOut_P1)
{
//判断是否在P1,如果是,不需要运行
int outCount = ACServerManager.GetActualtPosition(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
int outCount = AxisManager.instance.GetActualtPosition(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
int errorCount = Math.Abs(outCount - InOut_P1);
if (errorCount <= Config.InOut_Axis.CanErrorCountMin)
{
......@@ -343,7 +343,7 @@ namespace OnlineStore.DeviceLibrary
}
private void SI_05_DeviceToDoor()
{
if (!ACServerManager.isInPosition(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1,true))
if (!AxisManager.instance.isInPosition(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1,true))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
......@@ -351,7 +351,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
return;
}
if (!ACServerManager.isInPosition(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P1))
if (!AxisManager.instance.isInPosition(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P1))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
......@@ -428,7 +428,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
if (!ACServerManager.isInPosition(Config.UpDown_Axis, moveP.UpDown_P1))
if (!AxisManager.instance.isInPosition(Config.UpDown_Axis, moveP.UpDown_P1))
{
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
......@@ -436,7 +436,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_03 升降轴已在P1[" + moveP.UpDown_P1 + "]");
}
if (!ACServerManager.isInPosition(Config.Middle_Axis, moveP.Middle_P1))
if (!AxisManager.instance.isInPosition(Config.Middle_Axis, moveP.Middle_P1))
{
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
......
......@@ -26,7 +26,7 @@ namespace OnlineStore.DeviceLibrary
public Dictionary<int, BoxConfig> BoxConfigMap { get; set; }
public Dictionary<int, BoxBean> BoxMap = new Dictionary<int, BoxBean>();
public bool UseBuzzer = true;
public StoreConfig Config { get; set; }
#region 初始化
......@@ -48,6 +48,7 @@ namespace OnlineStore.DeviceLibrary
Name = (" Store_" + Config.CID + " ").ToUpper();
List<string> ioList = new List<string>();
IOManager.Init();
//AddDeviceName(ioList, Config.DIODeviceNameList);
......@@ -61,7 +62,6 @@ namespace OnlineStore.DeviceLibrary
BoxConfigMap.Add(config.DeviceID, config);
}
IOManager.Init();
//先初始化设备
......
......@@ -222,7 +222,7 @@ namespace OnlineStore.DeviceLibrary
moveAxis.TargetPosition = 0;
LogUtil.info( moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
AxisManager.instance.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed,moveAxis.HomeLowSpeed,moveAxis.HomeAddSpeed);
}
/// <summary>
......@@ -232,7 +232,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
moveAxis.TargetPosition = targetPosition;
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
AxisManager.instance.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
}
/// <summary>
......@@ -254,8 +254,8 @@ namespace OnlineStore.DeviceLibrary
// }
//}
bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
bool isOk = AxisManager.instance.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = AxisManager.instance.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition);
if (isOk)
{
......@@ -268,7 +268,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error( moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
AxisManager.instance.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--;
}
else
......@@ -283,10 +283,10 @@ namespace OnlineStore.DeviceLibrary
protected bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis, out string msg)
{
msg = "";
if (ACServerManager.IsHomeMoveEnd(moveAxis.DeviceName, moveAxis.GetAxisValue()))
if (AxisManager.instance.IsHomeMoveEnd(moveAxis.DeviceName, moveAxis.GetAxisValue()))
{
//原点完成并且位置=0
int outCount = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
int outCount = AxisManager.instance.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
int errorCount = Math.Abs(outCount);
if (errorCount <= moveAxis.CanErrorCountMax)
{
......@@ -297,7 +297,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error( moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
AxisManager.instance.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed);
MoveInfo.CanWhileCount--;
}
else
......
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//namespace HuichuanLibrary
//{
// public class Class1
// {
// private void button1_Click(object sender, EventArgs e)
// {
// //【1】获取卡
// Int32 nCardNum = 0;
// ret = ImcApi.IMC_GetCardsNum(ref nCardNum);
// if (ret != 0)
// {
// LogInfo("获取轴卡失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// if (nCardNum <= 0)
// {
// LogInfo("没有找到卡");
// return;
// }
// else
// {
// LogInfo("获取轴卡成功,将默认打开第0号卡");
// }
// }
// //【2】打开卡句柄
// ret = ImcApi.IMC_OpenCardHandle(nCardNo, ref nCardHandle);
// if (ret != 0)
// {
// LogInfo("获取卡句柄失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("获取轴卡句柄成功");
// }
// //【3】下载设备参数
// ret = ImcApi.IMC_DownLoadDeviceConfig(nCardHandle, ".\\device_config.xml");
// if (ret != 0)
// {
// LogInfo("下载设备参数失败,错误代码为0x" + ret.ToString("x8") + ",请检查是否有" + ".\\device_config.xml" + "文件");
// return;
// }
// else
// {
// LogInfo("下载设备参数成功");
// }
// //【4】启动主站
// LogInfo("正在启动EtherCAT...请稍候...");
// uint masterStatus = 0;
// ret = ImcApi.IMC_GetECATMasterSts(nCardHandle, ref masterStatus);
// if (ret != 0)
// {
// LogInfo("获取主站状态失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// if (masterStatus != ImcApi.EC_MASTER_OP)
// {
// ret = ImcApi.IMC_ScanCardECAT(nCardHandle, 1); //默认阻塞式启动EtherCAT
// if (ret != 0)
// {
// LogInfo("启动EtherCAT失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// }
// }
// LogInfo("启动EtherCAT成功");
// //【5】下载系统参数
// ret = ImcApi.IMC_DownLoadSystemConfig(nCardHandle, ".\\system_config.xml");
// if (ret != 0)
// {
// LogInfo("下载系统参数失败,错误代码为0x" + ret.ToString("x8") + ",请检查是否有" + ".\\system_config.xml" + "文件");
// return;
// }
// else
// {
// LogInfo("下载系统参数成功");
// }
// //【6】扫描卡内资源,初始化ComboBox
// ImcApi.TRsouresNum tResource = new ImcApi.TRsouresNum();//实例化板卡外设硬件资源
// ret = ImcApi.IMC_GetCardResource(nCardHandle, ref tResource);
// if (ret != 0)
// {
// LogInfo("扫描系统资源失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// //轴
// cmbAxisIndex.Items.Clear();
// if (tResource.axNum > 0)
// {
// for (int i = 0; i < tResource.axNum; i++)
// {
// cmbAxisIndex.Items.Add(i);
// }
// cmbAxisIndex.SelectedIndex = 0;
// }
// //IO
// }
// }
// private void button2_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16 nLookAheadLen = 2000; //默认前瞻队列大小为2000
// double estopDec = 500000; //急停减速度默认5000000000
// //建立插补坐标系之前需要先给关联轴上使能
// //ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 1);
// //ret = ImcApi.IMC_AxServoOn(nCardHandle, 0, 3);
// //默认从[0,0,0]开始插补,非必须步骤
// //ret = ImcApi.IMC_SetAxCurPos(nCardHandle, pMaskAxNo[0], 0);
// //ret = ImcApi.IMC_SetAxCurPos(nCardHandle, pMaskAxNo[1], 0);
// //ret = ImcApi.IMC_SetAxCurPos(nCardHandle, pMaskAxNo[2], 0);
// //设置第0个插补坐标系
// ret = ImcApi.IMC_CrdSetMtSys(nCardHandle, nCrdNo, pMaskAxNo, nLookAheadLen, estopDec);
// if (ret != 0)
// {
// LogInfo("设置第0个插补坐标系失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("设置第0个插补坐标系成功");
// }
// //设置轨迹合成速度、合成加速度
// ret = ImcApi.IMC_CrdSetTrajVel(nCardHandle, nCrdNo, 2000);
// if (ret != 0)
// {
// LogInfo("设置第0个插补轨迹合成速度失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("设置第0个插补轨迹合成速度成功");
// }
// ret = ImcApi.IMC_CrdSetTrajAcc(nCardHandle, nCrdNo, 1000000);
// if (ret != 0)
// {
// LogInfo("设置第0个插补轨迹合成加速度失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("设置第0个插补轨迹合成加速度成功");
// }
// ////设置每段插补末端是否强制降速为0
// //ret = ImcApi.IMC_CrdSetZeroFlag(nCardHandle, nCrdNo, 0); //每段末速度不强制为0
// //if (ret != 0)
// //{
// // listshow("设置轨迹末端是否降为0速失败,错误代码为0x" + ret.ToString("x8"));
// // return;
// //}
// //else
// //{
// // listshow("设置轨迹末端是否降为0速成功");
// //}
// ////设置插补编程方式为绝对式还是相对式
// //ret = ImcApi.IMC_CrdSetIncMode(nCardHandle, nCrdNo, 0); //设置为绝对值编程
// //if (ret != 0)
// //{
// // listshow("设置绝对式还是相对式编程失败,错误代码为0x" + ret.ToString("x8"));
// // return;
// //}
// //else
// //{
// // listshow("设置绝对式还是相对式编程成功");
// //}
// //启动查询插补位置定时器
// Interpolation_timer.Enabled = true;
// }
// private void button3_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// switch (LineMode_comboBox.SelectedIndex)
// {
// case 0:
// ArcEndPos[0] = Convert.ToDouble(targetX_textBox.Text);
// ArcEndPos[1] = Convert.ToDouble(targetY_textBox.Text);
// ArcEndPos[2] = Convert.ToDouble(targetZ_textBox.Text);
// ret = ImcApi.IMC_CrdLineXYZ(nCardHandle, nCrdNo, ArcEndPos, 0);
// if (ret != 0)
// {
// LogInfo("IMC_CrdLineXYZ失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdLineXYZ成功");
// }
// break;
// case 1:
// ArcEndPos[0] = Convert.ToDouble(targetX_textBox.Text);
// ArcEndPos[1] = Convert.ToDouble(targetY_textBox.Text);
// ret = ImcApi.IMC_CrdLineXY(nCardHandle, nCrdNo, ArcEndPos, 0);
// if (ret != 0)
// {
// LogInfo("IMC_CrdLineXY失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdLineXY成功");
// }
// break;
// case 2:
// ArcEndPos[0] = Convert.ToDouble(targetY_textBox.Text);
// ArcEndPos[1] = Convert.ToDouble(targetZ_textBox.Text);
// ret = ImcApi.IMC_CrdLineYZ(nCardHandle, nCrdNo, ArcEndPos, 0);
// if (ret != 0)
// {
// LogInfo("IMC_CrdLineYZ失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdLineYZ成功");
// }
// break;
// case 3:
// ArcEndPos[0] = Convert.ToDouble(targetZ_textBox.Text);
// ArcEndPos[1] = Convert.ToDouble(targetX_textBox.Text);
// ret = ImcApi.IMC_CrdLineZX(nCardHandle, nCrdNo, ArcEndPos, 0);
// if (ret != 0)
// {
// LogInfo("IMC_CrdLineZX失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdLineZX成功");
// }
// break;
// default:
// break;
// }
// //向FIFO中压入数据
// Int16 IsFinished = 0; //压如数据完成后IsFinished会被置1
// while (IsFinished == 0)
// {
// ret = ImcApi.IMC_CrdEndData(nCardHandle, nCrdNo, ref IsFinished);
// if (ret != 0)
// {
// LogInfo("向FIFO中压入数据失败,错误代码为0x" + ret.ToString("x8"));
// break;
// }
// }
// }
// private void button4_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// switch (ArcMode_comboBox.SelectedIndex)
// {
// case 0: //IMC_CrdArcThreePoint
// ArcMidPos[0] = Convert.ToDouble(textBox1.Text); ;//ArcMidPos
// ArcMidPos[1] = Convert.ToDouble(textBox2.Text); ;//ArcMidPos
// ArcMidPos[2] = Convert.ToDouble(textBox3.Text); ;//ArcMidPos
// ArcEndPos[0] = Convert.ToDouble(textBox4.Text); ;//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox5.Text); ;//ArcEndPos
// ArcEndPos[2] = Convert.ToDouble(textBox6.Text); ;//ArcEndPos
// ret = ImcApi.IMC_CrdArcThreePoint(nCardHandle, nCrdNo, ArcMidPos, ArcEndPos, 0);
// if (ret != 0)
// {
// LogInfo("添加CrdArcThreePoint圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加CrdArcThreePoint圆弧插补段成功");
// }
// break;
// case 1: //IMC_Crd3DArcCenterNormal
// ArcEndPos[0] = Convert.ToDouble(textBox4.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox5.Text);//ArcEndPos
// ArcEndPos[2] = Convert.ToDouble(textBox6.Text);//ArcEndPos
// ArcCenter[0] = Convert.ToDouble(textBox7.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox8.Text);//ArcCenter
// ArcCenter[2] = Convert.ToDouble(textBox9.Text);//ArcCenter
// ArcNormal[0] = Convert.ToDouble(textBox10.Text);//ArcNormal
// ArcNormal[1] = Convert.ToDouble(textBox11.Text);//ArcNormal
// ArcNormal[2] = Convert.ToDouble(textBox12.Text);//ArcNormal
// ArcHeight = Convert.ToDouble(textBox13.Text); //ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text); //ArcTurn
// ret = ImcApi.IMC_Crd3DArcCenterNormal(nCardHandle, nCrdNo, ArcCenter, ArcEndPos, ArcNormal, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加Crd3DArcCenterNormal圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加Crd3DArcCenterNormal圆弧插补段成功");
// }
// break;
// case 2://IMC_Crd3DArcRadiusNormal
// ArcEndPos[0] = Convert.ToDouble(textBox4.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox5.Text);//ArcEndPos
// ArcEndPos[2] = Convert.ToDouble(textBox6.Text);//ArcEndPos
// ArcNormal[0] = Convert.ToDouble(textBox10.Text);//ArcNormal
// ArcNormal[1] = Convert.ToDouble(textBox11.Text);//ArcNormal
// ArcNormal[2] = Convert.ToDouble(textBox12.Text);//ArcNormal
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text);//ArcTurn
// ArcRadius = Convert.ToDouble(textBox16.Text);//ArcRadius
// ret = ImcApi.IMC_Crd3DArcRadiusNormal(nCardHandle, nCrdNo, ArcRadius, ArcEndPos, ArcNormal, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加Crd3DArcRadiusNormal圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加Crd3DArcRadiusNormal圆弧插补段成功");
// }
// break;
// case 3://IMC_Crd3DArcAngleNormal
// ArcCenter[0] = Convert.ToDouble(textBox7.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox8.Text);//ArcCenter
// ArcCenter[2] = Convert.ToDouble(textBox9.Text);//ArcCenter
// ArcNormal[0] = Convert.ToDouble(textBox10.Text);//ArcNormal
// ArcNormal[1] = Convert.ToDouble(textBox11.Text);//ArcNormal
// ArcNormal[2] = Convert.ToDouble(textBox12.Text);//ArcNormal
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcAngle = Convert.ToDouble(textBox17.Text);//ArcAngle
// ret = ImcApi.IMC_Crd3DArcAngleNormal(nCardHandle, nCrdNo, ArcCenter, ArcAngle, ArcNormal, ArcHeight, 0);
// if (ret != 0)
// {
// LogInfo("添加Crd3DArcAngleNormal圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加Crd3DArcAngleNormal圆弧插补段成功");
// }
// break;
// case 4://IMC_CrdArcCenterXYPlane
// ArcEndPos[0] = Convert.ToDouble(textBox4.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox5.Text);//ArcEndPos
// ArcCenter[0] = Convert.ToDouble(textBox7.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox8.Text);//ArcCenter
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text);//ArcTurn
// ArcDir = Convert.ToInt16(textBox15.Text);//ArcDir
// ret = ImcApi.IMC_CrdArcCenterXYPlane(nCardHandle, nCrdNo, ArcCenter, ArcEndPos, ArcDir, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcCenterXYPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcCenterXYPlane圆弧插补段成功");
// }
// break;
// case 5://IMC_CrdArcCenterYZPlane
// ArcEndPos[0] = Convert.ToDouble(textBox5.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox6.Text);//ArcEndPos
// ArcCenter[0] = Convert.ToDouble(textBox8.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox9.Text);//ArcCenter
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text);//ArcTurn
// ArcDir = Convert.ToInt16(textBox15.Text);//ArcDir
// ret = ImcApi.IMC_CrdArcCenterYZPlane(nCardHandle, nCrdNo, ArcCenter, ArcEndPos, ArcDir, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcCenterYZPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcCenterYZPlane圆弧插补段成功");
// }
// break;
// case 6://IMC_CrdArcCenterZXPlane
// ArcEndPos[0] = Convert.ToDouble(textBox6.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox4.Text);//ArcEndPos
// ArcCenter[0] = Convert.ToDouble(textBox9.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox7.Text);//ArcCenter
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text);//ArcTurn
// ArcDir = Convert.ToInt16(textBox15.Text);//ArcDir
// ret = ImcApi.IMC_CrdArcCenterZXPlane(nCardHandle, nCrdNo, ArcCenter, ArcEndPos, ArcDir, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcCenterZXPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcCenterZXPlane圆弧插补段成功");
// }
// break;
// case 7://IMC_CrdArcRadiusXYPlane
// ArcEndPos[0] = Convert.ToDouble(textBox4.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox5.Text);//ArcEndPos
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text);//ArcTurn
// ArcDir = Convert.ToInt16(textBox15.Text);//ArcDir
// ArcRadius = Convert.ToDouble(textBox16.Text);//ArcRadius
// ret = ImcApi.IMC_CrdArcRadiusXYPlane(nCardHandle, nCrdNo, ArcRadius, ArcEndPos, ArcDir, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcRadiusXYPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcRadiusXYPlane圆弧插补段成功");
// }
// break;
// case 8://IMC_CrdArcRadiusYZPlane
// ArcEndPos[0] = Convert.ToDouble(textBox5.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox6.Text);//ArcEndPos
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text);//ArcTurn
// ArcDir = Convert.ToInt16(textBox15.Text);//ArcDir
// ArcRadius = Convert.ToDouble(textBox16.Text);//ArcRadius
// ret = ImcApi.IMC_CrdArcRadiusYZPlane(nCardHandle, nCrdNo, ArcRadius, ArcEndPos, ArcDir, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcRadiusYZPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcRadiusYZPlane圆弧插补段成功");
// }
// break;
// case 9://IMC_CrdArcRadiusZXPlane
// ArcEndPos[0] = Convert.ToDouble(textBox6.Text);//ArcEndPos
// ArcEndPos[1] = Convert.ToDouble(textBox4.Text);//ArcEndPos
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcTurn = Convert.ToInt32(textBox14.Text);//ArcTurn
// ArcDir = Convert.ToInt16(textBox15.Text);//ArcDir
// ArcRadius = Convert.ToDouble(textBox16.Text);//ArcRadius
// ret = ImcApi.IMC_CrdArcRadiusZXPlane(nCardHandle, nCrdNo, ArcRadius, ArcEndPos, ArcDir, ArcHeight, ArcTurn, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcRadiusZXPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcRadiusZXPlane圆弧插补段成功");
// }
// break;
// case 10://IMC_CrdArcAngleXYPlane
// ArcCenter[0] = Convert.ToDouble(textBox7.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox8.Text);//ArcCenter
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcAngle = Convert.ToDouble(textBox17.Text);//ArcAngle
// ret = ImcApi.IMC_CrdArcAngleXYPlane(nCardHandle, nCrdNo, ArcCenter, ArcAngle, ArcHeight, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcAngleXYPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcAngleXYPlane圆弧插补段成功");
// }
// break;
// case 11://IMC_CrdArcAngleYZPlane
// ArcCenter[0] = Convert.ToDouble(textBox8.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox9.Text);//ArcCenter
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcAngle = Convert.ToDouble(textBox17.Text);//ArcAngle
// ret = ImcApi.IMC_CrdArcAngleYZPlane(nCardHandle, nCrdNo, ArcCenter, ArcAngle, ArcHeight, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcAngleYZPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcAngleYZPlane圆弧插补段成功");
// }
// break;
// case 12://IMC_CrdArcAngleZXPlane
// ArcCenter[0] = Convert.ToDouble(textBox9.Text);//ArcCenter
// ArcCenter[1] = Convert.ToDouble(textBox7.Text);//ArcCenter
// ArcHeight = Convert.ToDouble(textBox13.Text);//ArcHeight
// ArcAngle = Convert.ToDouble(textBox17.Text);//ArcAngle
// ret = ImcApi.IMC_CrdArcAngleZXPlane(nCardHandle, nCrdNo, ArcCenter, ArcAngle, ArcHeight, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdArcAngleZXPlane圆弧插补段失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdArcAngleZXPlane圆弧插补段成功");
// }
// break;
// default:
// break;
// }
// //向FIFO中压入数据
// Int16 IsFinished = 0; //压如数据完成后IsFinished会被置1
// while (IsFinished == 0)
// {
// ret = ImcApi.IMC_CrdEndData(nCardHandle, nCrdNo, ref IsFinished);
// if (ret != 0)
// {
// LogInfo("向FIFO中压入数据失败,错误代码为0x" + ret.ToString("x8"));
// break;
// }
// }
// }
// private void button6_Click(object sender, EventArgs e)
// {
// //查询插补位置定时器
// Interpolation_timer.Enabled = false;
// //轴状态监控定时器
// axStsMonitor_timer.Enabled = false;
// ret = ImcApi.IMC_CloseCard(nCardHandle);
// if (ret != 0)
// {
// LogInfo("关卡失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("关卡成功");
// }
// }
// private void Interpolation_timer_Tick(object sender, EventArgs e)
// {
// //【1】插补位置查询
// ret = ImcApi.IMC_CrdGetPos(nCardHandle, nCrdNo, crdPos_timer);
// //保留2位小数显示
// X_textBox.Text = String.Format("{0:F}", crdPos_timer[0]);
// Y_textBox.Text = String.Format("{0:F}", crdPos_timer[1]);
// Z_textBox.Text = String.Format("{0:F}", crdPos_timer[2]);
// ////全精度显示
// //X_textBox.Text = crdPos_timer[0].ToString();
// //Y_textBox.Text = crdPos_timer[1].ToString();
// //Z_textBox.Text = crdPos_timer[2].ToString();
// //【2】插补状态查询
// ret = ImcApi.IMC_CrdGetStatus(nCardHandle, nCrdNo, ref crdStatus_timer);
// if ((crdStatus_timer & 0x01) == 0x01) //低8位为1
// {
// textBox54.Text = "sts=1,插补运行中";
// }
// else
// {
// textBox54.Text = "sts=0,插补静止中";
// }
// //高8位插补故障码
// textBox55.Text = (crdStatus_timer >> 8).ToString(); //右移8位,把插补运行状态去掉,剩下的8位直接以10进制显示即可
// //【3】插补速度查询
// ret = ImcApi.IMC_CrdGetVel(nCardHandle, nCrdNo, ref crdVel_timer);
// //保留2位小数显示
// textBox56.Text = String.Format("{0:F}", crdVel_timer);
// ////全精度显示
// //textBox56.Text = crdVel_timer.ToString();
// }
// private void button7_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// //查询插补位置定时器
// Interpolation_timer.Enabled = false;
// ret = ImcApi.IMC_CrdDeleteMtSys(nCardHandle, nCrdNo);
// if (ret != 0)
// {
// LogInfo("退出插补失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("退出插补成功");
// }
// //给各轴下使能
// //ret = ImcApi.IMC_AxServoOff(nCardHandle, 0, 3);
// }
// private void ArcMode_comboBox_SelectedIndexChanged(object sender, EventArgs e)
// {
// //先禁用所有按钮
// DisableControlBox();
// //根据ComboBox的选择来使能各按钮
// switch (ArcMode_comboBox.SelectedIndex)
// {
// case 0: //IMC_CrdArcThreePoint
// label8.Visible = true;//ArcMidPos
// label9.Visible = true;//ArcMidPos
// label10.Visible = true;//ArcMidPos
// label11.Visible = true;//ArcMidPos
// label12.Visible = true;//ArcEndPos
// label13.Visible = true;//ArcEndPos
// label14.Visible = true;//ArcEndPos
// label15.Visible = true;//ArcEndPos
// textBox1.Visible = true;//ArcMidPos
// textBox2.Visible = true;//ArcMidPos
// textBox3.Visible = true;//ArcMidPos
// textBox4.Visible = true;//ArcEndPos
// textBox5.Visible = true;//ArcEndPos
// textBox6.Visible = true;//ArcEndPos
// break;
// case 1: //IMC_Crd3DArcCenterNormal
// label16.Visible = true;//ArcCenter
// label17.Visible = true;//ArcCenter
// label18.Visible = true;//ArcCenter
// label19.Visible = true;//ArcCenter
// label12.Visible = true;//ArcEndPos
// label13.Visible = true;//ArcEndPos
// label14.Visible = true;//ArcEndPos
// label15.Visible = true;//ArcEndPos
// label20.Visible = true;//ArcNormal
// label21.Visible = true;//ArcNormal
// label22.Visible = true;//ArcNormal
// label23.Visible = true;//ArcNormal
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// textBox4.Visible = true;//ArcEndPos
// textBox5.Visible = true;//ArcEndPos
// textBox6.Visible = true;//ArcEndPos
// textBox7.Visible = true;//ArcCenter
// textBox8.Visible = true;//ArcCenter
// textBox9.Visible = true;//ArcCenter
// textBox10.Visible = true;//ArcNormal
// textBox11.Visible = true;//ArcNormal
// textBox12.Visible = true;//ArcNormal
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// break;
// case 2://IMC_Crd3DArcRadiusNormal
// label12.Visible = true;//ArcEndPos
// label13.Visible = true;//ArcEndPos
// label14.Visible = true;//ArcEndPos
// label15.Visible = true;//ArcEndPos
// label20.Visible = true;//ArcNormal
// label21.Visible = true;//ArcNormal
// label22.Visible = true;//ArcNormal
// label23.Visible = true;//ArcNormal
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// label27.Visible = true;//ArcRadius
// textBox4.Visible = true;//ArcEndPos
// textBox5.Visible = true;//ArcEndPos
// textBox6.Visible = true;//ArcEndPos
// textBox10.Visible = true;//ArcNormal
// textBox11.Visible = true;//ArcNormal
// textBox12.Visible = true;//ArcNormal
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// textBox16.Visible = true;//ArcRadius
// break;
// case 3://IMC_Crd3DArcAngleNormal
// label16.Visible = true;//ArcCenter
// label17.Visible = true;//ArcCenter
// label18.Visible = true;//ArcCenter
// label19.Visible = true;//ArcCenter
// label28.Visible = true;//ArcAngle
// label20.Visible = true;//ArcNormal
// label21.Visible = true;//ArcNormal
// label22.Visible = true;//ArcNormal
// label23.Visible = true;//ArcNormal
// label24.Visible = true;//ArcHeight
// textBox7.Visible = true;//ArcCenter
// textBox8.Visible = true;//ArcCenter
// textBox9.Visible = true;//ArcCenter
// textBox10.Visible = true;//ArcNormal
// textBox11.Visible = true;//ArcNormal
// textBox12.Visible = true;//ArcNormal
// textBox13.Visible = true;//ArcHeight
// textBox17.Visible = true;//ArcAngle
// break;
// case 4://IMC_CrdArcCenterXYPlane
// label12.Visible = true;//ArcEndPos
// label13.Visible = true;//ArcEndPos
// label14.Visible = true;//ArcEndPos
// label15.Visible = false;//ArcEndPos
// label16.Visible = true;//ArcCenter
// label17.Visible = true;//ArcCenter
// label18.Visible = true;//ArcCenter
// label19.Visible = false;//ArcCenter
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// label26.Visible = true;//ArcDir
// textBox4.Visible = true;//ArcEndPos
// textBox5.Visible = true;//ArcEndPos
// textBox6.Visible = false;//ArcEndPos
// textBox7.Visible = true;//ArcCenter
// textBox8.Visible = true;//ArcCenter
// textBox9.Visible = false;//ArcCenter
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// textBox15.Visible = true;//ArcDir
// break;
// case 5://IMC_CrdArcCenterYZPlane
// label12.Visible = true;//ArcEndPos
// label13.Visible = false;//ArcEndPos
// label14.Visible = true;//ArcEndPos
// label15.Visible = true;//ArcEndPos
// label16.Visible = true;//ArcCenter
// label17.Visible = false;//ArcCenter
// label18.Visible = true;//ArcCenter
// label19.Visible = true;//ArcCenter
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// label26.Visible = true;//ArcDir
// textBox4.Visible = false;//ArcEndPos
// textBox5.Visible = true;//ArcEndPos
// textBox6.Visible = true;//ArcEndPos
// textBox7.Visible = false;//ArcCenter
// textBox8.Visible = true;//ArcCenter
// textBox9.Visible = true;//ArcCenter
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// textBox15.Visible = true;//ArcDir
// break;
// case 6://IMC_CrdArcCenterZXPlane
// label12.Visible = true;//ArcEndPos
// label13.Visible = true;//ArcEndPos
// label14.Visible = false;//ArcEndPos
// label15.Visible = true;//ArcEndPos
// label16.Visible = true;//ArcCenter
// label17.Visible = true;//ArcCenter
// label18.Visible = false;//ArcCenter
// label19.Visible = true;//ArcCenter
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// label26.Visible = true;//ArcDir
// textBox4.Visible = true;//ArcEndPos
// textBox5.Visible = false;//ArcEndPos
// textBox6.Visible = true;//ArcEndPos
// textBox7.Visible = true;//ArcCenter
// textBox8.Visible = false;//ArcCenter
// textBox9.Visible = true;//ArcCenter
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// textBox15.Visible = true;//ArcDir
// break;
// case 7://IMC_CrdArcRadiusXYPlane
// label12.Visible = true;//ArcEndPos
// label13.Visible = true;//ArcEndPos
// label14.Visible = true;//ArcEndPos
// label15.Visible = false;//ArcEndPos
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// label26.Visible = true;//ArcDir
// label27.Visible = true;//ArcRadius
// textBox4.Visible = true;//ArcEndPos
// textBox5.Visible = true;//ArcEndPos
// textBox6.Visible = false;//ArcEndPos
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// textBox15.Visible = true;//ArcDir
// textBox16.Visible = true;//ArcRadius
// break;
// case 8://IMC_CrdArcRadiusYZPlane
// label12.Visible = true;//ArcEndPos
// label13.Visible = false;//ArcEndPos
// label14.Visible = true;//ArcEndPos
// label15.Visible = true;//ArcEndPos
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// label26.Visible = true;//ArcDir
// label27.Visible = true;//ArcRadius
// textBox4.Visible = false;//ArcEndPos
// textBox5.Visible = true;//ArcEndPos
// textBox6.Visible = true;//ArcEndPos
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// textBox15.Visible = true;//ArcDir
// textBox16.Visible = true;//ArcRadius
// break;
// case 9://IMC_CrdArcRadiusZXPlane
// label12.Visible = true;//ArcEndPos
// label13.Visible = true;//ArcEndPos
// label14.Visible = false;//ArcEndPos
// label15.Visible = true;//ArcEndPos
// label24.Visible = true;//ArcHeight
// label25.Visible = true;//ArcTurn
// label26.Visible = true;//ArcDir
// label27.Visible = true;//ArcRadius
// textBox4.Visible = true;//ArcEndPos
// textBox5.Visible = false;//ArcEndPos
// textBox6.Visible = true;//ArcEndPos
// textBox13.Visible = true;//ArcHeight
// textBox14.Visible = true;//ArcTurn
// textBox15.Visible = true;//ArcDir
// textBox16.Visible = true;//ArcRadius
// break;
// case 10://IMC_CrdArcAngleXYPlane
// label16.Visible = true;//ArcCenter
// label17.Visible = true;//ArcCenter
// label18.Visible = true;//ArcCenter
// label19.Visible = false;//ArcCenter
// label24.Visible = true;//ArcHeight
// label28.Visible = true;//ArcAngle
// textBox7.Visible = true;//ArcCenter
// textBox8.Visible = true;//ArcCenter
// textBox9.Visible = false;//ArcCenter
// textBox13.Visible = true;//ArcHeight
// textBox17.Visible = true;//ArcAngle
// break;
// case 11://IMC_CrdArcAngleYZPlane
// label16.Visible = true;//ArcCenter
// label17.Visible = false;//ArcCenter
// label18.Visible = true;//ArcCenter
// label19.Visible = true;//ArcCenter
// label24.Visible = true;//ArcHeight
// label28.Visible = true;//ArcAngle
// textBox7.Visible = false;//ArcCenter
// textBox8.Visible = true;//ArcCenter
// textBox9.Visible = true;//ArcCenter
// textBox13.Visible = true;//ArcHeight
// textBox17.Visible = true;//ArcAngle
// break;
// case 12://IMC_CrdArcAngleZXPlane
// label16.Visible = true;//ArcCenter
// label17.Visible = true;//ArcCenter
// label18.Visible = false;//ArcCenter
// label19.Visible = true;//ArcCenter
// label24.Visible = true;//ArcHeight
// label28.Visible = true;//ArcAngle
// textBox7.Visible = true;//ArcCenter
// textBox8.Visible = false;//ArcCenter
// textBox9.Visible = true;//ArcCenter
// textBox13.Visible = true;//ArcHeight
// textBox17.Visible = true;//ArcAngle
// break;
// default:
// break;
// }
// }
// private void DisableControlBox()
// {
// label8.Visible = false;//ArcMidPos
// label9.Visible = false;//ArcMidPos
// label10.Visible = false;//ArcMidPos
// label11.Visible = false;//ArcMidPos
// label12.Visible = false;//ArcEndPos
// label13.Visible = false;//ArcEndPos
// label14.Visible = false;//ArcEndPos
// label15.Visible = false;//ArcEndPos
// label16.Visible = false;//ArcCenter
// label17.Visible = false;//ArcCenter
// label18.Visible = false;//ArcCenter
// label19.Visible = false;//ArcCenter
// label20.Visible = false;//ArcNormal
// label21.Visible = false;//ArcNormal
// label22.Visible = false;//ArcNormal
// label23.Visible = false;//ArcNormal
// label24.Visible = false;//ArcHeight
// label25.Visible = false;//ArcTurn
// label26.Visible = false;//ArcDir
// label27.Visible = false;//ArcRadius
// label28.Visible = false;//ArcAngle
// textBox1.Visible = false;//ArcMidPos
// textBox2.Visible = false;//ArcMidPos
// textBox3.Visible = false;//ArcMidPos
// textBox4.Visible = false;//ArcEndPos
// textBox5.Visible = false;//ArcEndPos
// textBox6.Visible = false;//ArcEndPos
// textBox7.Visible = false;//ArcCenter
// textBox8.Visible = false;//ArcCenter
// textBox9.Visible = false;//ArcCenter
// textBox10.Visible = false;//ArcNormal
// textBox11.Visible = false;//ArcNormal
// textBox12.Visible = false;//ArcNormal
// textBox13.Visible = false;//ArcHeight
// textBox14.Visible = false;//ArcTurn
// textBox15.Visible = false;//ArcDir
// textBox16.Visible = false;//ArcRadius
// textBox17.Visible = false;//ArcAngle
// }
// private void button8_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// //启动直线插补
// ret = ImcApi.IMC_CrdStart(nCardHandle, nCrdNo);
// if (ret != 0)
// {
// LogInfo("启动插补失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("启动插补成功");
// }
// }
// private void button10_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// //清除插补数据
// ret = ImcApi.IMC_CrdClrData(nCardHandle, nCrdNo);
// if (ret != 0)
// {
// LogInfo("清除插补数据失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("清除插补数据成功");
// }
// }
// private void button9_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// //停止插补
// ret = ImcApi.IMC_CrdStop(nCardHandle, nCrdNo, 0); //平滑停止
// if (ret != 0)
// {
// LogInfo("停止插补失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("停止插补成功");
// }
// }
// private void LineMode_comboBox_SelectedIndexChanged(object sender, EventArgs e)
// {
// label4.Visible = true;
// label5.Visible = true;
// label6.Visible = true;
// targetX_textBox.Visible = true;
// targetY_textBox.Visible = true;
// targetZ_textBox.Visible = true;
// switch (LineMode_comboBox.SelectedIndex)
// {
// case 0:
// //无控件需被禁用
// break;
// case 1:
// label6.Visible = false;
// targetZ_textBox.Visible = false; //XY平面插补,Z需要被禁用
// break;
// case 2:
// label4.Visible = false;
// targetX_textBox.Visible = false; //YZ平面插补,X需要被禁用
// break;
// case 3:
// label5.Visible = false;
// targetY_textBox.Visible = false; //ZX平面插补,Y需要被禁用
// break;
// default:
// break;
// }
// }
// private void button11_Click(object sender, EventArgs e)
// {
// //取反标志为0时触发急停
// ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 0);
// if (ret != 0)
// {
// LogInfo("急停失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("急停成功");
// }
// }
// private void button12_Click(object sender, EventArgs e)
// {
// //取反标志为1时取消急停
// ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 1);
// if (ret != 0)
// {
// LogInfo("取消急停失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("取消急停成功");
// }
// }
// private void button13_MouseDown(object sender, MouseEventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】
// //正向运动,速度为正,要对速度取绝对值
// double tgtVel = Math.Abs(Convert.ToDouble(textBox18.Text));
// ret = ImcApi.IMC_StartJogMove(nCardHandle, nTempAxNo, tgtVel);
// if (ret != 0)
// {
// LogInfo("启动正向JOG失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("启动正向JOG成功");
// }
// }
// private void button13_MouseUp(object sender, MouseEventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// ret = ImcApi.IMC_AxMoveStop(nCardHandle, nTempAxNo, 1); //StopType=1,立即停止
// if (ret != 0)
// {
// LogInfo("停止正向JOG失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("停止正向JOG成功");
// }
// }
// private void button14_MouseDown(object sender, MouseEventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //负向运动,速度为负,要对速度取负值
// double tgtVel = (-1) * Math.Abs(Convert.ToDouble(textBox18.Text));
// ret = ImcApi.IMC_StartJogMove(nCardHandle, nTempAxNo, tgtVel);
// if (ret != 0)
// {
// LogInfo("启动负向JOG失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("启动负向JOG成功");
// }
// }
// private void button14_MouseUp(object sender, MouseEventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// ret = ImcApi.IMC_AxMoveStop(nCardHandle, nTempAxNo, 1); //StopType=1,立即停止
// if (ret != 0)
// {
// LogInfo("停止负向JOG失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("停止负向JOG成功");
// }
// }
// private void button5_Click(object sender, EventArgs e)
// {
// Int16 compPortNo = (Int16)comboBox3.SelectedIndex;
// Int16 compDimension = Convert.ToInt16(textBox20.Text);
// Int16[] compSrc = { Convert.ToInt16(textBox21.Text) };
// Int16[] compType = { Convert.ToInt16(textBox22.Text) };
// ret = ImcApi.IMC_CompareSrcConfig(nCardHandle, compPortNo, compDimension, compSrc, compType);
// if (ret != 0)
// {
// LogInfo("比较源配置失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("比较源配置成功");
// }
// Int16 compCtrlMode = Convert.ToInt16(textBox23.Text);
// Int16 compStLevel = Convert.ToInt16(textBox24.Text);
// Int16 compOutputType = Convert.ToInt16(textBox25.Text);
// Int16 compPulseWidth = Convert.ToInt16(textBox26.Text);
// ret = ImcApi.IMC_CompareOutputConfig(nCardHandle, compPortNo, compCtrlMode, compStLevel, compOutputType, compPulseWidth);
// if (ret != 0)
// {
// LogInfo("比较模式配置失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("比较模式配置成功");
// }
// }
// private void button15_Click(object sender, EventArgs e)
// {
// Int16 compPortNo = (Int16)comboBox3.SelectedIndex;
// Int16 compOutputVal = Convert.ToInt16(textBox27.Text);
// ret = ImcApi.IMC_CompareManualOutput(nCardHandle, compPortNo, compOutputVal);
// if (ret != 0)
// {
// LogInfo("手动输出失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("手动输出成功");
// }
// }
// private void button16_Click(object sender, EventArgs e)
// {
// Int16 compPortNo = (Int16)comboBox3.SelectedIndex;
// Int16 compIntervalLen = Convert.ToInt16(textBox28.Text);
// Int16 compTimes = Convert.ToInt16(textBox29.Text);
// ret = ImcApi.IMC_LinearCompare(nCardHandle, compPortNo, compIntervalLen, compTimes);
// if (ret != 0)
// {
// LogInfo("比较间隔配置失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("比较间隔配置成功");
// }
// }
// private void button17_Click(object sender, EventArgs e)
// {
// Int16 compPortNo = (Int16)comboBox3.SelectedIndex;
// ret = ImcApi.IMC_StartCompareOut(nCardHandle, compPortNo);
// if (ret != 0)
// {
// LogInfo("启动比较失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("已启动比较输出");
// }
// }
// private void button18_Click(object sender, EventArgs e)
// {
// Int16 compPortNo = (Int16)comboBox3.SelectedIndex;
// ret = ImcApi.IMC_StopCompareOut(nCardHandle, compPortNo);
// if (ret != 0)
// {
// LogInfo("停止比较失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("已停止比较输出");
// }
// }
// private void button19_Click(object sender, EventArgs e)
// {
// Int16 compPortNo = (Int16)comboBox3.SelectedIndex;
// Int16 compSts = 0;
// Int32 compTimesCompared = 0;
// ret = ImcApi.IMC_GetCompareStatus(nCardHandle, compPortNo, ref compSts, ref compTimesCompared);
// if (ret != 0)
// {
// LogInfo("查询比较状态失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("查询比较状态成功");
// }
// textBox30.Text = compSts.ToString();
// textBox31.Text = compTimesCompared.ToString();
// }
// private void button24_Click(object sender, EventArgs e)
// {
// if (cmbAxisIndex.Items.Count == 0) //如果轴号为空
// {
// MessageBox.Show("轴号为空!");
// return;
// }
// axStsMonitor_timer.Enabled = true;
// }
// private void button25_Click(object sender, EventArgs e)
// {
// axStsMonitor_timer.Enabled = false;
// }
// private void axStsMonitor_timer_Tick(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】读取轴状态,如果读取出错将关闭此定时器
// ret = ImcApi.IMC_GetAxPrfMode(nCardHandle, nTempAxNo, nTimerAxPrfMode, 1); //变量需要定义为数组,默认读取1个轴
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴规划模式失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxSts(nCardHandle, nTempAxNo, nTimerAxSts, 1);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴状态失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxPrfPos(nCardHandle, nTempAxNo, nTimerAxPrfPos, 1);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴规划位置失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxPrfVel(nCardHandle, nTempAxNo, nTimerAxPrfVel, 1);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴规划速度失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxPrfAcc(nCardHandle, nTempAxNo, nTimerAxPrfAcc, 1);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴规划加速度失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxEncPos(nCardHandle, nTempAxNo, nTimerAxEncPos, 1);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴反馈位置失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxEncVel(nCardHandle, nTempAxNo, nTimerAxEncVel, 1);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴反馈速度失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxEncAcc(nCardHandle, nTempAxNo, nTimerAxEncAcc, 1);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询轴反馈加速度失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// ret = ImcApi.IMC_GetAxEcatDigitalInput(nCardHandle, nTempAxNo, ref nTimerAxInput);
// if (ret != 0)
// {
// axStsMonitor_timer.Enabled = false;
// LogInfo("轴状态监控,查询数字输入,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// int axisState = nTimerAxSts[0];
// //【3】更新界面显示
// label58.Text = AxisPrfMode(nTimerAxPrfMode[0]);
// label151.BackColor = ((axisState & 0x01) == 0x01) ? Color.Red : Color.LightGreen; //报警信号
// label54.BackColor = ((axisState & 0x1000) == 0x1000) ? Color.Red : Color.LightGreen; //警告信号
// label57.BackColor = ((axisState & 0x200) == 0x200) ? Color.Red : Color.LightGreen; //急停信号
// label59.BackColor = ((axisState & 0x02) == 0x02) ? Color.Red : Color.LightGreen; //使能信号
// label80.BackColor = ((axisState & 0x04) == 0x04) ? Color.Red : Color.LightGreen; //轴忙信号
// label86.BackColor = ((axisState & 0x08) == 0x08) ? Color.Red : Color.LightGreen; //轴到位信号
// label62.BackColor = ((nTimerAxInput & 0x02) == 0x02) ? Color.Red : Color.LightGreen; //正限位信号
// label65.BackColor = ((nTimerAxInput & 0x04) == 0x04) ? Color.Red : Color.LightGreen; //原点信号
// label79.BackColor = ((nTimerAxInput & 0x01) == 0x01) ? Color.Red : Color.LightGreen; //负限位信号
// //label59.Text = ConvertDecimalToBinary(nTimerAxSts[0]); //轴状态是按bit进行解读,因此这里将AxSts转换为二进制bit进行显示
// label60.Text = nTimerAxPrfPos[0].ToString();
// label61.Text = nTimerAxPrfVel[0].ToString();
// //label62.Text = nTimerAxPrfAcc[0].ToString();
// label63.Text = nTimerAxEncPos[0].ToString();
// label64.Text = nTimerAxEncVel[0].ToString();
// //label65.Text = nTimerAxEncAcc[0].ToString();
// }
// private string AxisPrfMode(short axCtrlMode)
// {
// axCtrlMode = (short)(axCtrlMode & 0xf);
// string strCtrlMode = string.Empty;
// switch (axCtrlMode)
// {
// case 0:
// strCtrlMode = "无模式";
// break;
// case 1:
// strCtrlMode = "点对点";
// break;
// case 2:
// strCtrlMode = "JOG";
// break;
// case 3:
// strCtrlMode = "电子齿轮";
// break;
// case 4:
// strCtrlMode = "电子凸轮";
// break;
// case 5:
// strCtrlMode = "PVT";
// break;
// case 6:
// strCtrlMode = "龙门";
// break;
// case 7:
// strCtrlMode = "手轮";
// break;
// case 9:
// strCtrlMode = "点位连续";
// break;
// case 11:
// strCtrlMode = "插补同步轴";
// break;
// case 15:
// strCtrlMode = "回零";
// break;
// default:
// break;
// }
// return strCtrlMode;
// }
// private string ConvertDecimalToBinary(Int32 nAxSts) //将十进制整形转换为二进制显示的字符串
// {
// string strAxSts = "";
// Int32 nBitValue = 0x00;
// for (uint i = 0; i < 11; i++)
// {
// nBitValue = (Int32)(0x01 * Math.Pow(2.0, i)); //对nBitValue向左移1位,移到第几位通过i来控制
// if ((nAxSts & nBitValue) == nBitValue)
// {
// strAxSts = "1" + strAxSts;
// }
// else
// {
// strAxSts = "0" + strAxSts;
// }
// }
// return strAxSts;
// }
// private void button20_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】上使能
// ret = ImcApi.IMC_AxServoOn(nCardHandle, nTempAxNo, 1);
// if (ret != 0)
// {
// LogInfo("上使能失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("上使能成功");
// }
// }
// private void button23_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】下使能
// ret = ImcApi.IMC_AxServoOff(nCardHandle, nTempAxNo, 1);
// if (ret != 0)
// {
// LogInfo("下使能失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("下使能成功");
// }
// }
// private void button26_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】写入回原参数
// ImcApi.THomingPara tHomingPara = new ImcApi.THomingPara();
// tHomingPara.homeMethod = Convert.ToInt16(textBox34.Text);
// tHomingPara.offset = Convert.ToInt32(textBox35.Text);
// tHomingPara.highVel = Convert.ToUInt32(textBox36.Text);
// tHomingPara.lowVel = Convert.ToUInt32(textBox37.Text);
// tHomingPara.acc = Convert.ToUInt32(textBox38.Text);
// tHomingPara.overtime = Convert.ToUInt32(textBox39.Text);
// tHomingPara.posSrc = Convert.ToInt16(textBox40.Text);
// //【3】开始回原
// ret = ImcApi.IMC_StartHoming(nCardHandle, nTempAxNo, ref tHomingPara);
// if (ret != 0)
// {
// LogInfo("开始回原失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("伺服回原中!");
// }
// }
// private void button27_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】触发停止回原
// ret = ImcApi.IMC_StopHoming(nCardHandle, nTempAxNo, 0); //0:表示平滑停止 1:表示急停
// if (ret != 0)
// {
// LogInfo("轴回原停止触发失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("轴回原停止触发");
// }
// }
// private void button21_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】读取界面设置
// double ptpVel = Convert.ToDouble(textBox41.Text);
// double ptpAcc = Convert.ToDouble(textBox42.Text);
// double ptpDec = Convert.ToDouble(textBox43.Text);
// ret = ImcApi.IMC_SetSingleAxMvPara(nCardHandle, nTempAxNo, ptpVel, ptpAcc, ptpDec);
// if (ret != 0)
// {
// LogInfo("设置PTP运行参数失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("设置PTP运行参数成功");
// }
// //【3】启动PTP
// double ptpPos = Convert.ToDouble(textBox33.Text);
// Int16 posType = (Int16)comboBox1.SelectedIndex;
// ret = ImcApi.IMC_StartPtpMove(nCardHandle, nTempAxNo, ptpPos, posType);
// if (ret != 0)
// {
// LogInfo("启动PTP失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("启动PTP成功");
// }
// }
// private void button22_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】轴停止
// ret = ImcApi.IMC_AxMoveStop(nCardHandle, nTempAxNo, 1); //StopType=1,立即停止
// if (ret != 0)
// {
// LogInfo("停止PTP失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("停止PTP成功");
// }
// }
// private void button28_Click(object sender, EventArgs e)
// {
// Int16 nEcatIoBitNo = Convert.ToInt16(textBox19.Text);
// Int16 nEcatIoBitValue = Convert.ToInt16(textBox32.Text);
// ret = ImcApi.IMC_SetEcatDoBit(nCardHandle, nEcatIoBitNo, nEcatIoBitValue);
// if (ret != 0)
// {
// LogInfo("按点设置ECAT DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按点设置ECAT DO成功");
// }
// }
// private void button29_Click(object sender, EventArgs e)
// {
// Int16 nEcatIoBitNo = Convert.ToInt16(textBox19.Text);
// Int16 nEcatIoBitValue = 0;
// ret = ImcApi.IMC_GetEcatDoBit(nCardHandle, nEcatIoBitNo, ref nEcatIoBitValue);
// if (ret != 0)
// {
// LogInfo("按点读取ECAT DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按点读取ECAT DO成功");
// }
// textBox32.Text = nEcatIoBitValue.ToString();
// }
// private void button32_Click(object sender, EventArgs e)
// {
// Int16 nEcatIoBitNo = Convert.ToInt16(textBox19.Text);
// Int16 nEcatIoBitValue = 0;
// ret = ImcApi.IMC_GetEcatDiBit(nCardHandle, nEcatIoBitNo, ref nEcatIoBitValue);
// if (ret != 0)
// {
// LogInfo("按点读取ECAT DI失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按点读取ECAT DI成功");
// }
// textBox32.Text = nEcatIoBitValue.ToString();
// }
// private void button30_Click(object sender, EventArgs e)
// {
// Int16 nEcatIoGrpNo = Convert.ToInt16(textBox44.Text);
// Int16 nEcatIoGrpValue = Convert.ToInt16(textBox45.Text);
// ret = ImcApi.IMC_SetEcatGrpDo(nCardHandle, nEcatIoGrpNo, nEcatIoGrpValue);
// if (ret != 0)
// {
// LogInfo("按组设置ECAT DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按组设置ECAT DO成功");
// }
// }
// private void button31_Click(object sender, EventArgs e)
// {
// Int16 nEcatIoGrpNo = Convert.ToInt16(textBox44.Text);
// Int16 nEcatIoGrpValue = 0;
// ret = ImcApi.IMC_GetEcatGrpDo(nCardHandle, nEcatIoGrpNo, ref nEcatIoGrpValue);
// if (ret != 0)
// {
// LogInfo("按组读取ECAT DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按组读取ECAT DO成功");
// }
// textBox45.Text = nEcatIoGrpValue.ToString();
// }
// private void button33_Click(object sender, EventArgs e)
// {
// Int16 nEcatIoGrpNo = Convert.ToInt16(textBox44.Text);
// Int16 nEcatIoGrpValue = 0;
// ret = ImcApi.IMC_GetEcatGrpDi(nCardHandle, nEcatIoGrpNo, ref nEcatIoGrpValue);
// if (ret != 0)
// {
// LogInfo("按组读取ECAT DI失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按组读取ECAT DI成功");
// }
// textBox45.Text = nEcatIoGrpValue.ToString();
// }
// private void button34_Click(object sender, EventArgs e)
// {
// Int16 nLocalIoBitNo = Convert.ToInt16(textBox46.Text);
// Int16 nLocalIoBitValue = Convert.ToInt16(textBox47.Text);
// ret = ImcApi.IMC_SetLocalDoBit(nCardHandle, nLocalIoBitNo, nLocalIoBitValue);
// if (ret != 0)
// {
// LogInfo("按点设置本地DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按点设置本地DO成功");
// }
// }
// private void button35_Click(object sender, EventArgs e)
// {
// Int16 nLocalIoBitNo = Convert.ToInt16(textBox46.Text);
// Int16 nLocalIoBitValue = 0;
// ret = ImcApi.IMC_GetLocalDoBit(nCardHandle, nLocalIoBitNo, ref nLocalIoBitValue);
// if (ret != 0)
// {
// LogInfo("按点读取本地DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按点读取本地DO成功");
// }
// textBox47.Text = nLocalIoBitValue.ToString();
// }
// //Local
// private void button38_Click(object sender, EventArgs e)
// {
// Int16 nLocalIoBitNo = Convert.ToInt16(textBox46.Text);
// Int16 nLocalIoBitValue = 0;
// ret = ImcApi.IMC_GetLocalDiBit(nCardHandle, nLocalIoBitNo, ref nLocalIoBitValue);
// if (ret != 0)
// {
// LogInfo("按点读取本地DI失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按点读取本地DI成功");
// }
// textBox47.Text = nLocalIoBitValue.ToString();
// }
// private void button37_Click(object sender, EventArgs e)
// {
// Int16 nLocalIo16BitValue = Convert.ToInt16(textBox48.Text);
// ret = ImcApi.IMC_SetLocalDo(nCardHandle, nLocalIo16BitValue);
// if (ret != 0)
// {
// LogInfo("设置所有本地DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("设置所有本地DO成功");
// }
// }
// private void button36_Click(object sender, EventArgs e)
// {
// Int16 nLocalIo16BitValue = 0;
// ret = ImcApi.IMC_GetLocalDo(nCardHandle, ref nLocalIo16BitValue);
// if (ret != 0)
// {
// LogInfo("读取所有本地DO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("读取所有本地DO成功");
// }
// textBox48.Text = nLocalIo16BitValue.ToString();
// }
// private void button39_Click(object sender, EventArgs e)
// {
// Int16 nLocalIo16BitValue = 0;
// ret = ImcApi.IMC_GetLocalDi(nCardHandle, ref nLocalIo16BitValue);
// if (ret != 0)
// {
// LogInfo("读取所有本地DI失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("读取所有本地DI成功");
// }
// textBox48.Text = nLocalIo16BitValue.ToString();
// }
// private void button41_Click(object sender, EventArgs e)
// {
// Int16 nSpecialIoType = Convert.ToInt16(textBox52.Text);
// Int16 nSpecialIoValue = 0;
// ret = ImcApi.IMC_GetLocalSpecialDi(nCardHandle, nSpecialIoType, ref nSpecialIoValue);
// if (ret != 0)
// {
// LogInfo("按类型读取特殊DI失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按类型读取特殊DI成功");
// }
// textBox53.Text = nSpecialIoValue.ToString();
// }
// private void button40_Click(object sender, EventArgs e)
// {
// Int16 nSpecialIoBitIndex = Convert.ToInt16(textBox49.Text);
// Int16 nSpecialIoBitType = Convert.ToInt16(textBox50.Text);
// Int16 nSpecialIoBitValue = 0;
// ret = ImcApi.IMC_GetLocalSpecialDiBit(nCardHandle, nSpecialIoBitIndex, nSpecialIoBitType, ref nSpecialIoBitValue);
// if (ret != 0)
// {
// LogInfo("按点读取特殊DI失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("按点读取特殊DI成功");
// }
// textBox51.Text = nSpecialIoBitValue.ToString();
// }
// private void button42_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// //清除插补报警
// ret = ImcApi.IMC_CrdClrError(nCardHandle, nCrdNo);
// if (ret != 0)
// {
// LogInfo("清除插补报警失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("清除插补报警成功");
// }
// }
// private void button43_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16 crdDiNo = Convert.ToInt16(textBox57.Text);
// Int16 crdDiType = Convert.ToInt16(textBox58.Text);
// Int16 crdDiLevel = Convert.ToInt16(textBox59.Text);
// ret = ImcApi.IMC_CrdWaitDI(nCardHandle, nCrdNo, crdDiNo, crdDiType, crdDiLevel, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdWaitDI失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdWaitDI成功");
// }
// }
// private void button44_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16 crdDoNo = Convert.ToInt16(textBox57.Text);
// Int16 crdDoType = Convert.ToInt16(textBox58.Text);
// Int16 crdDoLevel = Convert.ToInt16(textBox59.Text);
// ret = ImcApi.IMC_CrdSetDO(nCardHandle, nCrdNo, crdDoNo, crdDoType, crdDoLevel, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdSetDO失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdSetDO成功");
// }
// }
// private void button45_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16 nCrdAxNo = Convert.ToInt16(textBox60.Text);
// double fCrdTgtPos = Convert.ToDouble(textBox61.Text);
// double fCrdTgtVel = Convert.ToDouble(textBox62.Text);
// double fCrdPtpAcc = Convert.ToDouble(textBox63.Text);
// Int16 nCrdPtpMvType = Convert.ToInt16(textBox64.Text);
// Int16 nWaitFlag = Convert.ToInt16(textBox65.Text);
// ret = ImcApi.IMC_CrdPTPMove(nCardHandle, nCrdNo, nCrdAxNo, fCrdTgtPos, fCrdTgtVel, fCrdPtpAcc, nCrdPtpMvType, nWaitFlag, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdPTPMove失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdPTPMove成功");
// }
// }
// private void button46_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16 nCrdAxNo = Convert.ToInt16(textBox66.Text);
// double fCrdSyncPos = Convert.ToDouble(textBox67.Text);
// ret = ImcApi.IMC_CrdSyncMove(nCardHandle, nCrdNo, nCrdAxNo, fCrdSyncPos, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdSyncMove失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdSyncMove成功");
// }
// }
// private void button47_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int32 waitPeriod = Convert.ToInt32(textBox68.Text);
// ret = ImcApi.IMC_CrdWaitTime(nCardHandle, nCrdNo, waitPeriod, 0);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdWaitTime失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdWaitTime成功");
// }
// }
// private void button48_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// double nCrdWaitPeriod = Convert.ToDouble(textBox69.Text);
// ret = ImcApi.IMC_CrdSetRatio(nCardHandle, nCrdNo, nCrdWaitPeriod);
// if (ret != 0)
// {
// LogInfo("IMC_CrdSetRatio失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdSetRatio成功");
// }
// }
// private void button49_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// double nCrdWaitPeriod = 0;
// ret = ImcApi.IMC_CrdGetRatio(nCardHandle, nCrdNo, ref nCrdWaitPeriod);
// if (ret != 0)
// {
// LogInfo("IMC_CrdGetRatio失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdGetRatio成功");
// }
// textBox69.Text = nCrdWaitPeriod.ToString();
// }
// private void button50_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int32 nUserId = 0;
// ret = ImcApi.IMC_CrdGetUserID(nCardHandle, nCrdNo, ref nUserId);
// if (ret != 0)
// {
// LogInfo("IMC_CrdGetUserID失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdGetUserID成功");
// }
// textBox70.Text = nUserId.ToString();
// }
// private void button51_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int32 nSpace = 0;
// ret = ImcApi.IMC_CrdGetSpace(nCardHandle, nCrdNo, ref nSpace);
// if (ret != 0)
// {
// LogInfo("IMC_CrdGetSpace失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdGetSpace成功");
// }
// textBox71.Text = nSpace.ToString();
// }
// private void button52_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// double[] fTgtPos = { 0, 0, 0 };
// ret = ImcApi.IMC_CrdGetTargetPos(nCardHandle, nCrdNo, fTgtPos);
// if (ret != 0)
// {
// LogInfo("IMC_CrdGetTargetPos失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdGetTargetPos成功");
// }
// textBox72.Text = fTgtPos[0].ToString();
// textBox82.Text = fTgtPos[1].ToString();
// textBox83.Text = fTgtPos[2].ToString();
// }
// private void button53_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int32 nCrdSmoothLevel = Convert.ToInt32(textBox73.Text);
// double nSmoothTol = Convert.ToDouble(textBox74.Text);
// ret = ImcApi.IMC_CrdSetSmoothParam(nCardHandle, nCrdNo, nCrdSmoothLevel, nSmoothTol);
// if (ret != 0)
// {
// LogInfo("IMC_CrdSetSmoothParam失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdSetSmoothParam成功");
// }
// }
// private void button54_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int32 nCrdSmoothLevel = 0;
// double nSmoothTol = 0;
// ret = ImcApi.IMC_CrdGetSmoothParam(nCardHandle, nCrdNo, ref nCrdSmoothLevel, ref nSmoothTol);
// if (ret != 0)
// {
// LogInfo("IMC_CrdGetSmoothParam失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdGetSmoothParam成功");
// }
// textBox73.Text = nCrdSmoothLevel.ToString();
// textBox74.Text = nSmoothTol.ToString();
// }
// private void button55_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// ImcApi.TCrdAdvParam TAdvPara = new ImcApi.TCrdAdvParam();
// TAdvPara.userVelMode = Convert.ToInt16(textBox75.Text);
// TAdvPara.transMode = Convert.ToInt16(textBox76.Text);
// TAdvPara.noDataProtect = Convert.ToInt16(textBox77.Text);
// TAdvPara.circAccChangeEn = Convert.ToInt16(textBox78.Text);
// TAdvPara.noCoplaneCircOptm = Convert.ToInt16(textBox79.Text);
// TAdvPara.turnCoef = Convert.ToDouble(textBox80.Text);
// TAdvPara.tol = Convert.ToDouble(textBox81.Text);
// ret = ImcApi.IMC_CrdSetAdvParam(nCardHandle, nCrdNo, ref TAdvPara);
// if (ret != 0)
// {
// LogInfo("IMC_CrdSetAdvParam失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdSetAdvParam成功");
// }
// }
// private void button56_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// ImcApi.TCrdAdvParam TAdvPara = new ImcApi.TCrdAdvParam();
// ret = ImcApi.IMC_CrdGetAdvParam(nCardHandle, nCrdNo, ref TAdvPara);
// if (ret != 0)
// {
// LogInfo("IMC_CrdGetAdvParam失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdGetAdvParam成功");
// }
// textBox75.Text = TAdvPara.userVelMode.ToString();
// textBox76.Text = TAdvPara.transMode.ToString();
// textBox77.Text = TAdvPara.noDataProtect.ToString();
// textBox78.Text = TAdvPara.circAccChangeEn.ToString();
// textBox79.Text = TAdvPara.noCoplaneCircOptm.ToString();
// textBox80.Text = TAdvPara.turnCoef.ToString();
// textBox81.Text = TAdvPara.tol.ToString();
// }
// private void button58_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16[] nTempMaskAxNo = { 0, 0, 0 };
// nTempMaskAxNo[0] = Convert.ToInt16(textBox88.Text);
// nTempMaskAxNo[1] = Convert.ToInt16(textBox87.Text);
// nTempMaskAxNo[2] = Convert.ToInt16(textBox86.Text);
// Int16 nLookAheadLen = Convert.ToInt16(textBox89.Text);
// double estopDec = Convert.ToDouble(textBox90.Text);
// //设置第0个插补坐标系
// ret = ImcApi.IMC_CrdSetMtSys(nCardHandle, nCrdNo, nTempMaskAxNo, nLookAheadLen, estopDec);
// if (ret != 0)
// {
// LogInfo("设置第" + nCrdNo.ToString() + "个插补坐标系失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("设置第" + nCrdNo.ToString() + "个插补坐标系成功");
// }
// }
// private void button57_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// double fStartVel = Convert.ToDouble(textBox84.Text);
// double fStopVel = Convert.ToDouble(textBox85.Text);
// ret = ImcApi.IMC_CrdUserVelPlan(nCardHandle, nCrdNo, fStartVel, fStopVel);
// if (ret != 0)
// {
// LogInfo("添加IMC_CrdUserVelPlan失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("添加IMC_CrdUserVelPlan成功");
// }
// }
// private void button59_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16[] nTempMaskAxNo = { 0, 0, 0 };
// Int16 nLookAheadLen = 0;
// double estopDec = 0;
// //设置第0个插补坐标系
// ret = ImcApi.IMC_CrdGetMtSysParam(nCardHandle, nCrdNo, nTempMaskAxNo, ref nLookAheadLen, ref estopDec);
// if (ret != 0)
// {
// LogInfo("IMC_CrdGetMtSysParam失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdGetMtSysParam成功");
// }
// textBox88.Text = nTempMaskAxNo[0].ToString();
// textBox87.Text = nTempMaskAxNo[1].ToString();
// textBox86.Text = nTempMaskAxNo[2].ToString();
// textBox89.Text = nLookAheadLen.ToString();
// textBox90.Text = estopDec.ToString();
// }
// private void button60_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// double tgtVel = Convert.ToDouble(textBox92.Text);
// //设置第0个插补坐标系
// ret = ImcApi.IMC_CrdSetTrajVel(nCardHandle, nCrdNo, tgtVel);
// if (ret != 0)
// {
// LogInfo("IMC_CrdSetTrajVel失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdSetTrajVel成功");
// }
// }
// private void button61_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// double tgtAcc = Convert.ToDouble(textBox93.Text);
// //设置第0个插补坐标系
// ret = ImcApi.IMC_CrdSetTrajAcc(nCardHandle, nCrdNo, tgtAcc);
// if (ret != 0)
// {
// LogInfo("IMC_CrdSetTrajAcc失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdSetTrajAcc成功");
// }
// }
// private void button62_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16 nZeroFlag = Convert.ToInt16(textBox94.Text);
// //设置第0个插补坐标系
// ret = ImcApi.IMC_CrdSetZeroFlag(nCardHandle, nCrdNo, nZeroFlag);
// if (ret != 0)
// {
// LogInfo("IMC_CrdSetZeroFlag失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdSetZeroFlag成功");
// }
// }
// private void button63_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// Int16 nIncMode = Convert.ToInt16(textBox95.Text);
// //设置第0个插补坐标系
// ret = ImcApi.IMC_CrdSetIncMode(nCardHandle, nCrdNo, nIncMode);
// if (ret != 0)
// {
// LogInfo("IMC_CrdSetIncMode失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_CrdSetIncMode成功");
// }
// }
// private void button64_Click(object sender, EventArgs e)
// {
// nCrdNo = Convert.ToInt16(textBox91.Text);
// //查询插补位置定时器
// Interpolation_timer.Enabled = false;
// ret = ImcApi.IMC_CrdDeleteMtSys(nCardHandle, nCrdNo);
// if (ret != 0)
// {
// LogInfo("退出插补失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("退出插补成功");
// }
// }
// private void button66_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】获取回原状态
// short nHomingStatus = 0;
// ret = ImcApi.IMC_GetHomingStatus(nCardHandle, nTempAxNo, ref nHomingStatus);
// if (ret != 0)
// {
// LogInfo("获取轴回原状态失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("轴回原状态为" + nHomingStatus.ToString());
// }
// }
// private void button65_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// nTempAxNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】退出回原模式
// ret = ImcApi.IMC_FinishHoming(nCardHandle, nTempAxNo);
// if (ret != 0)
// {
// LogInfo("退出回原模式失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("退出回原模式成功!");
// }
// }
// private void button67_Click(object sender, EventArgs e)
// {
// //【1】更新轴号
// ushort tAxisNo = Convert.ToUInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
// //【2】获取电子齿轮分子分母
// int Motor_Revolution = Convert.ToInt32(textBox96.Text); //电子齿轮分子:电机分辨率
// int Shaft_Revolution = Convert.ToInt32(textBox97.Text); //电子齿轮分母:一圈脉冲数
// //【3】获取轴号对应的实际地址
// short nphyStationId = 0, nphySlotId = 0;
// uint abort_code = 0;
// ret = ImcApi.IMC_GetAxEcatStation(nCardHandle, tAxisNo, ref nphyStationId, ref nphySlotId);
// if (ret != 0)
// {
// LogInfo("IMC_GetAxEcatStation失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// //【4】设置电子齿轮分子
// ret = ImcApi.IMC_SetEcatSdo(nCardHandle, nphyStationId, 0x6091, 0x01, BitConverter.GetBytes(Motor_Revolution), 4, ref abort_code);
// if (ret != 0 | abort_code != 0)
// {
// if (ret != 0)
// {
// LogInfo("IMC_SetEcatSdo_1失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_SetEcatSdo_1失败,错误代码为0x" + abort_code.ToString("x8"));
// return;
// }
// }
// //【4】设置电子齿轮分母
// ret = ImcApi.IMC_SetEcatSdo(nCardHandle, nphyStationId, 0x6091, 0x02, BitConverter.GetBytes(Shaft_Revolution), 4, ref abort_code);
// if (ret != 0 | abort_code != 0)
// {
// if (ret != 0)
// {
// LogInfo("IMC_SetEcatSdo_2失败,错误代码为0x" + ret.ToString("x8"));
// return;
// }
// else
// {
// LogInfo("IMC_SetEcatSdo_2失败,错误代码为0x" + abort_code.ToString("x8"));
// return;
// }
// }
// }
// }
//}
//}
此文件类型无法预览
此文件的差异太大,无法显示。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HuichuanLibrary
{
public partial class FrmHuiChuanTest : Form
{
public FrmHuiChuanTest()
{
InitializeComponent();
}
private List<Label> DILabelList = new List<Label>();
private List<Label> DOLabelList = new List<Label>();
private List<Label> groupIOList = new List<Label>();
private void FrmHuiChuanTest_Load(object sender, EventArgs e)
{
HCLogUtil.logBox = richTextBox1;
DILabelList = new List<Label>();
DILabelList.Add(lblDI0);
DILabelList.Add(lblDI1);
DILabelList.Add(lblDI2);
DILabelList.Add(lblDI3);
DILabelList.Add(lblDI4);
DILabelList.Add(lblDI5);
DILabelList.Add(lblDI6);
DILabelList.Add(lblDI7);
DILabelList.Add(lblDI8);
DILabelList.Add(lblDI9);
DILabelList.Add(lblDI10);
DILabelList.Add(lblDI11);
DILabelList.Add(lblDI12);
DILabelList.Add(lblDI13);
DILabelList.Add(lblDI14);
DILabelList.Add(lblDI15);
for(int i = 0; i < DILabelList.Count; i++)
{
DILabelList[i].Text = "DI_" + i;
}
DOLabelList.Add(lblDO0);
DOLabelList.Add(lblDO1);
DOLabelList.Add(lblDO2);
DOLabelList.Add(lblDO3);
DOLabelList.Add(lblDO4);
DOLabelList.Add(lblDO5);
DOLabelList.Add(lblDO6);
DOLabelList.Add(lblDO7);
DOLabelList.Add(lblDO8);
DOLabelList.Add(lblDO9);
DOLabelList.Add(lblDO10);
DOLabelList.Add(lblDO11);
DOLabelList.Add(lblDO12);
DOLabelList.Add(lblDO13);
DOLabelList.Add(lblDO14);
DOLabelList.Add(lblDO15);
for (int i = 0; i < DOLabelList.Count; i++)
{
DOLabelList[i].Text = "DO_" + i;
}
groupIOList = new List<Label>();
//groupIOList.Add(lblGroup7);
//groupIOList.Add(lblGroup6);
//groupIOList.Add(lblGroup5);
//groupIOList.Add(lblGroup4);
//groupIOList.Add(lblGroup3);
//groupIOList.Add(lblGroup2);
//groupIOList.Add(lblGroup1);
//groupIOList.Add(lblGroup0);
groupIOList.Add(lblGroup0);
groupIOList.Add(lblGroup1);
groupIOList.Add(lblGroup2);
groupIOList.Add(lblGroup3);
groupIOList.Add(lblGroup4);
groupIOList.Add(lblGroup5);
groupIOList.Add(lblGroup6);
groupIOList.Add(lblGroup7);
FormStatus(false);
timerIO.Start();
timerMain.Start();
}
private void btnInitBoard_Click(object sender, EventArgs e)
{
bool result = HCBoardManager.InitCard();
if (result)
{
cmbAxisIndex.Items.Clear();
List<int> axisList = HCBoardManager.AxisList;
foreach(int i in axisList)
{
cmbAxisIndex.Items.Add(i);
}
if (axisList.Count > 0)
{
cmbAxisIndex.SelectedIndex = 0;
}
}
}
private short GetAxisNo()
{
short axisNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
return axisNo;
}
private void btnCloseBoard_Click(object sender, EventArgs e)
{
//轴状态监控定时器
axStsMonitor_timer.Enabled = false;
timerIO.Stop();
bool result = HCBoardManager.CloseCard();
}
private void FrmHuiChuanTest_FormClosing(object sender, FormClosingEventArgs e)
{
timerMain.Stop();
HCLogUtil.logBox = null;
}
private void btnSuddenStop_Click(object sender, EventArgs e)
{
HCBoardManager.EmgStop();
}
private void btnCancelStop_Click(object sender, EventArgs e)
{
HCBoardManager.CancelEmg();
}
private void btnSetValue_Click(object sender, EventArgs e)
{
//【1】更新轴号
ushort tAxisNo = Convert.ToUInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
//【2】获取电子齿轮分子分母
int Motor_Revolution = Convert.ToInt32(txtMotorRevolution.Text); //电子齿轮分子:电机分辨率
int Shaft_Revolution = Convert.ToInt32(txtShaftRevolution.Text); //电子齿轮分母:一圈脉冲数
HCBoardManager.SetEcatSdo(tAxisNo, Motor_Revolution, Shaft_Revolution);
}
private void btnServerOn_Click(object sender, EventArgs e)
{
short axisNo= Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
HCBoardManager.ServoOn(axisNo);
}
private void btnServerOff_Click(object sender, EventArgs e)
{
short axisNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
HCBoardManager.ServoOff(axisNo);
}
private void btnStartHome_Click(object sender, EventArgs e)
{
//【1】更新轴号
short axisNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
//【2】写入回原参数
short homeMethod = Convert.ToInt16(txtHomeType.Text);
int offset = Convert.ToInt32(txtHomeOffset.Text);
uint highVel = Convert.ToUInt32(txtHomeHSpeed.Text);
uint lowVel = Convert.ToUInt32(txtHomeLSpeed.Text);
uint acc = Convert.ToUInt32(txtHomeAcc.Text);
uint overtime = Convert.ToUInt32(txtHomeTimeOut.Text);
short posSrc = Convert.ToInt16(txtScrPos.Text);
HCBoardManager.StartHomeMove(axisNo, highVel, lowVel, acc, homeMethod, offset, overtime, posSrc);
}
private void btnStopHome_Click(object sender, EventArgs e)
{
HCBoardManager.StopHomeMove(GetAxisNo());
}
private void btnHomeStatus_Click(object sender, EventArgs e)
{
short value = HCBoardManager.GetHomeStatus(GetAxisNo());
string homesstr = HCBoardManager.AxisHomeSts(value);
lblhomeSts.Text = homesstr;
}
private void btnExitHome_Click(object sender, EventArgs e)
{
HCBoardManager.FinishHome(GetAxisNo());
}
private void btnStartTimer_Click(object sender, EventArgs e)
{
if (cmbAxisIndex.Items.Count == 0) //如果轴号为空
{
MessageBox.Show("轴号为空!");
return;
}
axStsMonitor_timer.Enabled = true;
}
private void btnStopTimer_Click(object sender, EventArgs e)
{
axStsMonitor_timer.Enabled = false;
}
private void btnPtpMove_Click(object sender, EventArgs e)
{
short axisNo = GetAxisNo();
//【2】读取界面设置
double ptpVel = Convert.ToDouble(txtPtpVel.Text);
double ptpAcc = Convert.ToDouble(txtPtpAcc.Text);
double ptpDec = Convert.ToDouble(txtPtpDec.Text);
double ptpPos = Convert.ToDouble(txtPtpPos.Text);
HCBoardManager.AbsMove(axisNo, ptpPos, ptpVel, ptpAcc, ptpDec);
}
private void btnRelMove_Click(object sender, EventArgs e)
{
short axisNo = GetAxisNo();
//【2】读取界面设置
double ptpVel = Convert.ToDouble(txtPtpVel.Text);
double ptpAcc = Convert.ToDouble(txtPtpAcc.Text);
double ptpDec = Convert.ToDouble(txtPtpDec.Text);
double ptpPos = Convert.ToDouble(txtPtpPos.Text);
HCBoardManager.RelMove(axisNo, ptpPos, ptpVel, ptpAcc, ptpDec);
}
private void btnAxisStop_Click(object sender, EventArgs e)
{
HCBoardManager.AxisStop(GetAxisNo());
}
private void btnJOGj_MouseDown(object sender, MouseEventArgs e)
{
short axisNo = GetAxisNo();
//【2】
//负向运动,速度为负,要对速度取负值
double tgtVel = (-1) * Math.Abs(Convert.ToDouble(txtJogSpeed.Text));
HCBoardManager.SpeedMove(axisNo, tgtVel);
btnJOGj.BackColor = Color.Green;
}
private void btnJOGj_MouseUp(object sender, MouseEventArgs e)
{
short axisNo = GetAxisNo();
HCBoardManager.AxisStop(axisNo);
btnJOGj.BackColor = Color.White;
}
private void btnJOGAdd_MouseDown(object sender, MouseEventArgs e)
{
short axisNo = GetAxisNo();
//【2】
//正向运动,速度为正,要对速度取绝对值
double tgtVel = Math.Abs(Convert.ToDouble(txtJogSpeed.Text));
HCBoardManager.SpeedMove(axisNo, tgtVel);
btnJOGAdd.BackColor = Color.Green;
}
private void btnJOGAdd_MouseUp(object sender, MouseEventArgs e)
{
short axisNo = GetAxisNo();
HCBoardManager.AxisStop(axisNo);
btnJOGAdd.BackColor = Color.White;
}
private void ShowlbSts(Label lbl, int value)
{
if (value.Equals(1))
{
lbl.BackColor = Color.Lime;
}
else if (value.Equals(0))
{
lbl.BackColor = Color.LightGray;
}
else
{
lbl.BackColor = this.BackColor;
}
}
private void axStsMonitor_timer_Tick(object sender, EventArgs e)
{
if (btnStartTimer.Visible && HCBoardManager.CardInitOk())
{
btnStartTimer.Enabled = false;
ReadAxisStatus();
}
}
private void ReadAxisStatus()
{
//【1】更新轴号
short axisNo = GetAxisNo();
short modeValue = HCBoardManager.GetAxisPrfMode(axisNo);
if (modeValue<0)
{
return;
}
else
{
string mode = HCBoardManager.AxisPrfMode(modeValue);
lblAxisPrfMode.Text = mode;
}
//【2】读取轴状态,如果读取出错将关闭此定时器
AxisSts sts = HCBoardManager.GetAxisSts(axisNo);
if (sts.ServoOn < 0)
{
axStsMonitor_timer.Stop();
}
//【3】更新界面显示
ShowlbSts(lblALM, sts.ALM); //报警信号
ShowlbSts(lblWARN, sts.WARN); //警告信号
ShowlbSts(lblEMG, sts.EMG);//急停信号
ShowlbSts(lblSvOn, sts.ServoOn); //使能信号
ShowlbSts(lblBUSY, sts.BUSY); //轴忙信号
ShowlbSts(lblINP, sts.INP); //轴到位信号
if (sts.ORG < 0)
{
axStsMonitor_timer.Stop();
}
ShowlbSts(lblPEL, sts.PEL); //正限位信号
ShowlbSts(lblORG, sts.ORG); //原点信号
ShowlbSts(lblNEL, sts.NEL); //负限位信号
//label59.Text = ConvertDecimalToBinary(nTimerAxSts[0]); //轴状态是按bit进行解读,因此这里将AxSts转换为二进制bit进行显示
lblAxPrfPos.Text = HCBoardManager.GetAxisPrfPos(axisNo).ToString();
lblAxPrfVel.Text = HCBoardManager.GetAxisPrfVel(axisNo).ToString();
//label62.Text = nTimerAxPrfAcc[0].ToString();
lblAxEncPos.Text = HCBoardManager.GetAxisCurrPos(axisNo).ToString();
lblAxEncVel.Text = HCBoardManager.GetAxisCurrVel(axisNo).ToString();
lblAxEncAcc.Text = HCBoardManager.GetAxisCurrAcc(axisNo).ToString();
//label65.Text = nTimerAxEncAcc[0].ToString();
short value = HCBoardManager.GetHomeStatus(GetAxisNo());
string homesstr = HCBoardManager.AxisHomeSts(value);
lblhomeSts.Text = homesstr;
}
private void btnSetBitDO_Click(object sender, EventArgs e)
{
short bitNo =(short) numBitIndex.Value;
HCBoardManager.SetBitDO(bitNo, 1);
}
private void btnCloseBit_Click(object sender, EventArgs e)
{
short bitNo = (short)numBitIndex.Value;
HCBoardManager.SetBitDO(bitNo, 0);
}
private void btnGetBitDo_Click(object sender, EventArgs e)
{
short bitNo = (short)numBitIndex.Value;
short value = HCBoardManager.GetBitDO(bitNo);
lblBitResult.Text = "DO_" + bitNo + "=" + value;
}
private void btnGetBitDI_Click(object sender, EventArgs e)
{
short bitNo = (short)numBitIndex.Value;
short value = HCBoardManager.GetBitDI(bitNo);
lblBitResult.Text = "DI_" + bitNo + "=" + value;
}
private string GetLabelIOValue(Label label)
{
if (label.BackColor.Equals(Color.Lime))
{
return "1";
}
else
{
return "0";
}
}
private void btnSetGroupDo_Click(object sender, EventArgs e)
{
short groupNo = (short)numGroupIndex.Value;
string value = "";
for (int i = 0; i < groupIOList.Count; i++)
{
value = GetLabelIOValue(groupIOList[i])+value;
}
short tValue = Convert.ToInt16(value, 2);
HCBoardManager.SetGroupDO(groupNo, tValue);
}
private void ShowIO(Label label,short value)
{
if (value.Equals((short)1))
{
label.BackColor = Color.Lime;
}
else if(value.Equals((short)0))
{
label.BackColor = Color.LightGray;
}
else
{
label.BackColor = Color.White;
}
}
private void btnGetGroupDo_Click(object sender, EventArgs e)
{
short groupNo = (short)numGroupIndex.Value;
lblGroupResult.Text = "<<组" + groupNo + "的DO值";
short tValue = HCBoardManager.GetGroupDO(groupNo);
List<short> gList = HCBoardManager.GetIOValue(tValue);
for (int i = 0; i < gList.Count; i++)
{
short v = gList[i];
ShowIO(groupIOList[i], v);
}
//string value = Convert.ToString(tValue,2).PadLeft(8,'0');
//for (int i = 0; i < groupIOList.Count; i++)
//{
// string v = value.Substring( i, 1);
// //groupIOList[i].Text = "DO_" + i;
// if (v.Equals("1"))
// {
// groupIOList[i].BackColor = Color.Lime;
// }
// else
// {
// groupIOList[i].BackColor = Color.LightGray;
// }
//}
}
private void btnGetGroupDI_Click(object sender, EventArgs e)
{
short groupNo = (short)numGroupIndex.Value;
lblGroupResult.Text = "<<组" + groupNo + "的DI值";
short tValue = HCBoardManager.GetGroupDI(groupNo);
List<short> gList = HCBoardManager.GetIOValue(tValue);
for (int i = 0; i < gList.Count; i++)
{
short v = gList[i];
ShowIO(groupIOList[i], v);
}
//string value = Convert.ToString(tValue, 2).PadLeft(8, '0');
//for (int i = 0; i < groupIOList.Count; i++)
//{
// string v = value.Substring(i, 1);
// //groupIOList[i].Text = "DI_" + i;
// if (v.Equals("1"))
// {
// groupIOList[i].BackColor = Color.Lime;
// }
// else
// {
// groupIOList[i].BackColor = Color.LightGray;
// }
//}
}
private void btnStartGetIO_Click(object sender, EventArgs e)
{
timerIO.Start();
}
private void btnStopGetDO_Click(object sender, EventArgs e)
{
timerIO.Stop();
}
private void timerIO_Tick(object sender, EventArgs e)
{
if (groupBox1.Visible && HCBoardManager.CardInitOk())
{
btnStartGetIO.Enabled = false;
if (radioButton1.Checked)
{
int groupLength = 8;
int diGroupCount = DILabelList.Count / groupLength;
for (short i = 0; i < diGroupCount; i++)
{
short groupValue = HCBoardManager.GetGroupDI(i);
List<short> vList = HCBoardManager.GetIOValue(groupValue);
for(int index = 0; index < vList.Count; index++)
{
ShowIO(DILabelList[i * 8 + index], vList[index]);
}
}
int doGroupCount = DOLabelList.Count / groupLength;
for(short i = 0; i < doGroupCount; i++)
{
short groupValue = HCBoardManager.GetGroupDO(i);
List<short> vList = HCBoardManager.GetIOValue(groupValue);
for (int index = 0; index < vList.Count; index++)
{
ShowIO(DOLabelList[i * 8 + index], vList[index]);
}
}
}
else
{
for (short i = 0; i < DILabelList.Count; i++)
{
short value = HCBoardManager.GetBitDI(i);
ShowIO(DILabelList[i], value);
}
for (short i = 0; i < DOLabelList.Count; i++)
{
short value = HCBoardManager.GetBitDO(i);
ShowIO(DOLabelList[i], value);
}
}
}
}
private void lblGroup0_Click(object sender, EventArgs e)
{
Label label = (Label)sender;
if (label.BackColor.Equals(Color.LightGray))
{
label.BackColor = Color.Lime ;
}
else
{
label.BackColor = Color.LightGray;
}
}
private void btnClearAxSts_Click(object sender, EventArgs e)
{
short axisNo = Convert.ToInt16(cmbAxisIndex.SelectedIndex); //实时读取轴选择
HCBoardManager.ClearAxisSts(axisNo);
}
private void btnReadSts_Click(object sender, EventArgs e)
{
ReadAxisStatus();
}
private void btnClearLog_Click(object sender, EventArgs e)
{
HCLogUtil.ClearLog();
}
private void btnExit_Click(object sender, EventArgs e)
{
HCBoardManager.CloseCard();
this.Close();
}
private void timerMain_Tick(object sender, EventArgs e)
{
if (HCBoardManager.CardInitOk())
{
lblBoradInfo.ForeColor = Color.Green ;
lblBoradInfo.Text = "板卡初始化完成:" + "轴数量[" + HCBoardManager.tResource.axNum + "],DI数量[" + HCBoardManager.tResource.diNum + "],DO数量[" + HCBoardManager.tResource.doNum + "]";
if (!btnInitBoard.Enabled.Equals(false))
{
FormStatus(true );
}
}
else
{
lblBoradInfo.ForeColor = Color.Red;
lblBoradInfo.Text = "板卡未初始化完成";
if (!btnInitBoard.Enabled.Equals(true ))
{
FormStatus(false );
}
}
}
private void FormStatus(bool isOk)
{
btnInitBoard.Enabled = !isOk;
groupBox1.Enabled = isOk;
groupBox2.Enabled = isOk;
groupBox3.Enabled = isOk;
groupBox4.Enabled = isOk;
groupBox6.Enabled = isOk;
groupBox7.Enabled = isOk;
groupBox8.Enabled = isOk;
groupBox9.Enabled = isOk;
groupBox10.Enabled = isOk;
btnSuddenStop.Enabled = isOk;
btnCancelStop.Enabled = isOk;
timerIO.Enabled = isOk;
axStsMonitor_timer.Enabled = isOk;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="axStsMonitor_timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>378, 17</value>
</metadata>
<metadata name="timerIO.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>545, 17</value>
</metadata>
<metadata name="timerMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>641, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAA8AMDAQAAEABABoBgAA9gAAACgoEAABAAQAyAQAAF4HAAAgIBAAAQAEAOgCAAAmDAAAGBgQAAEA
BADoAQAADg8AABAQEAABAAQAKAEAAPYQAAAwMAAAAQAIAKgOAAAeEgAAKCgAAAEACACoCwAAxiAAACAg
AAABAAgAqAgAAG4sAAAYGAAAAQAIAMgGAAAWNQAAEBAAAAEACABoBQAA3jsAADAwAAABACAAqCUAAEZB
AAAoKAAAAQAgAGgaAADuZgAAICAAAAEAIACoEAAAVoEAABgYAAABACAAiAkAAP6RAAAQEAAAAQAgAGgE
AACGmwAAKAAAADAAAABgAAAAAQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACA
gACAAAAAgACAAICAAACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAAwMDAAP///wAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA/lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAA
D///8AAAAAAAAAAAAAAAAAAAAAAAAAAE7////0AAAAAAAAAAAAAAAAAEZHZGBABP/////+AAQkJWZkAA
AAAAAAAG6+t3YAD///////8AB7brd2AAAAAAAAAHvtt0AA/////////kAEd77UAAAAAAAAAGt3ZgBO//
////////ACRnvlAAAAAAAAAHd0QAT///////////8EBHdmAAAAAAAAAEZ2QA////7uvb7v///kAkR0AA
AAAAAAAEdAAf///r69e+vb7///AAZ0AAAAAAAAAGUATv//vtvr2+t72+//9AB0AAAAAAAAAEAC///r6+
t76+vbe+7//gBCAAAAAAAAAABO//7t6+fX2+vre3vv//AAAAAAAAAAAAD///3r69t76+vb69vv//5AAA
AAAAAAAA///+vt5+3r7b69t723///wAAAAAAAAAP///3576+vre+vXvr23////AAAAAAAAD////73n19
7t6+vNvrdr7///8AAAAAAA7////t7r7ne+vtd9vr237////wAAAABP/////r7evt536+vr6+t7f////+
cAAAb//////r7r7evt7X1769vr3/////8AABD/////99fu5+7r7r7X6+t7f/////8AAAAP/////n7t7u
7Xfr6+vX233/////AAAAAA/////t7u7e7u3n7evr577////wAAAAAAD////+7u7u7t6+2+vr69////8A
AAAAAAAP///+3u7+7ufud33tt7////AAAAAAAAAA///+7u/u7e7evt6+vu///wAAAAAAAAAAD///7u7u
7u7N7r7evf//8AAAAAAAAAAEBP///u7u7ud9576+v//+QEAAAAAAAAAGcE7//u7u7t7r7efe7//wR0AA
AAAAAAAGe0D///7u7n5+fr6///8AfVAAAAAAAAALfXAP///u3n19vt7///BOt2AAAAAAAAAHd75A////
/u7u7v///kB3vrAAAAAAAAAE3rdwD///////////8ke+3kAAAAAAAAAE6+17ZP//////////AHvte3AA
AAAAAAAE6+vrcA/////////wRd63fVAAAAAAAAAG7XfXdgH///////8Aduvtd2AAAAAAAAAAVkdGVkAP
//////AGVkdGVgAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAAAA
AAAAAAAAAAAAAAAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA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AAAAAAH///m53e+t7e3vr7//3AAAAAAAH///uvtftfX3r22u+//9wAAAAAH///+vte+vr
6+vr6+7///cAAAAH////3nfu3u3r3r69tv///nAAAH/////r7evr6+vre9e+////9wAAf////75+7u3u
fn3rfbf////3AAAH////7e7t7uvtvrvr6////3AAAAB////u3u7t7ud+3r2+///3AAAAAAf//+7u7u7u
ve2+d37//3AAAAAAAH///u7v7u7r7evbf//3AAAAAAAAB///7u/t7Xfuvn7v/3AAAAAAAABAf//u7u7u
frd9vv/3BAAAAAAAAHdH//7u7n5+3tfv/3C3QAAAAAAAvVB//+7u1+vr7v/3C3cAAAAAAAB9e0f//+7n
7e7//3B96wAAAAAAALfeYH/////////3C+vmAAAAAAAAfr63R////////3B9e+ZAAAAAAAC3fXdwf///
///3C3fetwAAAAAAAGdnt2QH/////3BHZ7dnAAAAAAAAAAAAAAB////3AAAAAAAAAAAAAAAAAAAAAAf/
/3AAAAAAAAAAAAAAAAAAAAAAAH/3AAAAAAAAAAAAAAAAAAAAAAAAB3AAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////8AAAD//+f//wAAAP//w///AAAA//+B//8A
AAD//wD//wAAAPgAAAAfAAAA+AAAAB8AAAD4AAAAHwAAAPgAAAAfAAAA+AAAAB8AAAD4AAAAHwAAAPgA
AAAfAAAA+AAAAB8AAAD4AAAAHwAAAPgAAAAfAAAA+AAAAB8AAADwAAAADwAAAOAAAAAHAAAAwAAAAAMA
AACAAAAAAQAAAIAAAAABAAAAwAAAAAMAAADgAAAABwAAAPAAAAAPAAAA+AAAAB8AAAD4AAAAHwAAAPgA
AAAfAAAA+AAAAB8AAAD4AAAAHwAAAPgAAAAfAAAA+AAAAB8AAAD4AAAAHwAAAPgAAAAfAAAA+AAAAB8A
AAD4AAAAHwAAAP//AP//AAAA//+B//8AAAD//8P//wAAAP//5///AAAA//////8AAAAoAAAAIAAAAEAA
AAABAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICA
gAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AADAwMAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAG7gAAAAAAAAAAAAAAAAAADv/kAAAAAAAAAAAABARABO///gBARAAAAAAABH63tg
7////kZ3vrQAAAAAC+13Tv/////mt9dwAAAAAAfbdO///////gbr5AAAAABL5k7/7ut37v/iXXAAAAAA
DnDv/td729vv/kZ0AAAAAAZO/+vr6+vr6//lYAAAAAAA7/7r69t7e7v//gAAAAAATv/77efn13fbfv/k
AAAAAO//7ee+vbe9vr7//gAAAE7//+vt537uvr23///hAADv//933r7Xvbe3t////gAA7///5+7n7n7X
fXb///4AAA///+3u3u2+vr6+///mAAAA7//u7u7u7t69vv/+AAAAAA7//u/u7Xvr7c7/4AAAAAAA7/7u
7u7tfr3v/gAAAAAAB27/7+7ufuvu7+R0AAAAAEtw7/7u3r197/5GcAAAAAAO1U7//u7u7//gfrQAAAAA
S31w7//////+e11wAAAAAAfr607/////4WvtdAAAAABGd9dw7////kbm63AAAAAAAAQAAA7//+AABAAA
AAAAAAAAAAAA7/4AAAAAAAAAAAAAAAAAAA7nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA///////+f////D////gf//AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD+AA
AAfAAAADgAAAAYAAAAHAAAAD4AAAB/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD//4
H////D////5///////8oAAAAGAAAADAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
gAAAgAAAAICAAIAAAACAAIAAgIAAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AADAwMAA////AAAA
AAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAf+cAAAAAAAAAQkYF7/9gBgYAAAAGvrdv///3vr5AAAAA
7mX/////R31AAAAAtl/+7r7v87cAAAAEd//b69vb/2dAAAAAT/7r6+vrf+cAAAAC/+vr7be3vv9wAAB/
/+3r5969vv/wAAf//33N6+t76///YAD//+3u5+3rt///cAB//+7u3te+3v/xAAAE//7u7u6+vv8gAAAA
f/7u7r197vYAAAAEZP/u7u6+/1ZAAAAA53/+7t7v925AAAAEt2H/////R74AAAAE7eZ////wft5AAAAA
BAQA//9wBAQAAAAAAAAAf/QAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAP//////5////8P//+AA
B//gAAf/4AAH/+AAB//gAAf/4AAH/+AAB//AAAP/gAAB/4AAAf/AAAP/4AAH/+AAB//gAAf/4AAH/+AA
B//gAAf/4AAH///D////5////////ygAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAMDA
wAD///8AAAAADnAAAAAAAADufgAAAAAFZH/+RkQAAG6+///k5AAARu/ut/d2AABO+9vr3+QAB+7u7b6+
9+Du/+2+vrf/537/7u7Xe/9+Dn/u7uvt/uAAR/7t6+/gAABn7u7u97YAAE5u///m5gAABlDv9wZQAAAA
AH7uAAAAAAAADnAAAAD+f////D///8AD///AA///wAP//8AD//+AAf//AAD//wAA//+AAf//wAP//8AD
///AA///wAP///w////+f///KAAAADAAAABgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAEAgEABAQEAAgICAANDQ0AEQkGABISEgAUFBQAGRkZAB0dHQAnFg4AKBYOAC4aEQA9IhYAJSUlACws
LAAxMTEAODg4AD4+PgBFJxkAUy8fAFozIQBlOSUAcD8qAHJAKgB2QywAeUQtAEBAQABFRUUASEhIAFNT
UwBXV1cAXV1dAGFhYQBlZWUAampqAG5ubgBycnIAeHh4AH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+//7+
/v/+/v7//v7+//ixkf/0k2f/9JZr//WYb//1mnH/9Zpx//Wacf/1mXD/9Jhv//SWbP/xkWf/74xi/+yH
Xf/pglj/5n1T/+N5T//hdEr/3nBH/9xsQ//ZaD//1WQ8/9JfOf/QXDX/3Ypv//7+/f/+/v7//v7+//7+
/v/+/v7//f39/9jY2P8dHR3/AAAA+wAAAL8AAAB7AAAAQwAAAEEAAACNAAAA9h8fH//Z2dn//v7+//39
/f/9/f3//v7+//7+/f/+/v7//v7+//ahe//0lmz/9Ztx//Wedv/1n3j/9aB5//Wgef/1n3j/9Z11//Wb
cv/0mG7/8pJp/++NY//siF3/6YJY/+Z9U//jeU7/4XRK/95wRv/bbEP/2Gc//9VjPP/SXzj/13JQ//7+
/f/+/v7//v7+//7+/v/+/v7//f39//39/f/X19f/HR0d/wAAAPYAAACOAAAAQQAAAFQAAADvHR0d/9ra
2v/9/f3//v7+//39/f/9/f3//f39//39/f/+/v3//f39//Wbcv/1m3L/9aB5//akf//2poL/9qeD//an
g//2pYH/9aN9//Wgef/1nXX/9Jlw//KTaf/vjWL/64dc/+iBV//mfVL/43hO/+FzSf/eb0b/22tC/9dn
Pv/VYzv/1WdB//39/f/+/v3//v79//39/f/9/f3//f39//39/f/9/f3/2NjY/xwcHP8AAADvAAAAVAAA
AEMAAADrHh4e/tvb2//+/v7//v7+//7+/v/+/v3//v7+//7+/v/+/v7//v79//aed//1oHn/9qeD//es
iv/3r47/97CQ//ewkP/3roz/9qqI//angv/2onz/9Z52//SZcP/ykmj/7oxh/+uHXP/pgVb/5nxS/+R4
Tf/hc0n/3m9G/9prQf/YZj7/2GtE//7+/f/+/v3//v79//7+/v/+/v7//f39//7+/v/9/f3/2tra/x0d
Hf4AAADqAAAAQQAAAAwAAABGAAAA6yAgIP7a2tr//v7+//39/f/9/f3//v79//7+/f/+/v7//f39//eq
iP/2pYH/966N//i1l//4uJz/+Lqe//i6nf/4t5n/97KT//etjP/2p4T/9aJ8//Wddf/0l27/8ZFm/+6L
YP/rhVr/6YBV/+Z7UP/kd0z/4XJI/91uRP/aakD/3ntX//39/f/+/v3//v79//7+/f/+/v3//f39//39
/f/Z2dn/Hx8f/gAAAOsAAABIAAAADAAAAAMAAAAMAAAARQAAAO0gICD+29vb//39/f/9/f3//v79//7+
/f/+/v3//v79//i9ov/2qoj/97WX//i+o//4wqr/+cSt//nEq//4wKf/+Luf//e0lv/3rYz/9qaC//Wg
ef/1m3L/85Vr//CPZP/uiV7/64RY/+l/U//me0//43ZL/99xRv/dbUP/5pZ5//7+/f/+/v3//v79//7+
/f/+/v3//f39/9nZ2f8fHx//AAAA7wAAAFQAAAASAAAABAAAAAAAAAADAAAADAAAAEUAAADrHh4e/tvb
2//+/v7//v7+//7+/v/+/v7//v79//vXx//3r47/+Lyg//nGr//5zLj/+s+7//nNuf/5ybP/+MOr//i7
oP/3s5T/9qqI//ajfv/1nXX/9Jhu//OTaP/wjWL/7ohc/+uDV//pflL/5XlO/+J1Sf/gcUb/8b+r//7+
/f/+/v3//v79//7+/v/+/v7/2tra/x0dHf8AAADzAAAAcQAAACMAAAAJAAAAAQAAAAAAAAAAAAAAAwAA
AA0AAABJAAAA7CAgIP/a2tr//v79//7+/f/+/v3//v79//308P/4tJb/+MCm//nMuP/61MP/+tfH//rW
xf/60b7/+cm0//jAp//4t5r/966N//amgf/1n3j/9Zlw//SVav/zkWX/8Yxf/+6HWv/rglX/6H1Q/+V4
TP/keE7/++3o//39/f/+/v3//v7+//7+/f/Z2dn/Hx8f/wAAAPgAAACeAAAASgAAABsAAAAGAAAAAAAA
AAAAAAAAAAAAAAAAAAQAAAASAAAAVQAAAP8gICD/29vb//7+/f/+/v3//f39//7+/f/60L3/+MCn//rO
u//62Mn/+9zP//vbzf/61sX/+c25//nErP/4up7/97CQ//eng//2oHn/9Zpx//WWa//0k2b/9I9i//GK
Xf/uhVj/64BT/+h8T//vqo3//v79//39/f/9/f3//v7+/9ra2v8fHx//AAAA/wAAAMwAAACFAAAARAAA
ABgA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Z2f+AAAA8AAAAEsAAAAKAAAATgAA
APFpaWn++/v7//39/f/9/f3//v7+//7+/f/9/f3/962M//aqh//3tJb/+Lqf//i9ov/4vKH/97ib//ey
k//2q4n/9qR+//Wddf/0l23/8I9k/+2IXf/qglf/53xR/+N3TP/fcUf/3GxC/99+Wv/9/f3//v79//7+
/f/+/v3//f39//v7+/9oaGj+AAAA8gAAAFIAAAALAAAAAgAAAAoAAABOAAAA8WhoaP78/Pz//f39//7+
/v/+/v3//v79//nErP/3sJD/+L6j//nGr//5ybT/+ciy//jDq//4u6D/97KT//aphv/1oXv/9Zpx//OU
af/wjWH/7Ydb/+qAVf/ne0//4nVK/99wRf/pn4T//f39//7+/f/+/v3//v7+//v7+/9nZ2f/AAAA9QAA
AGcAAAATAAAAAwAAAAAAAAACAAAACgAAAFAAAADxaWlp//v7+//+/v3//v7+//7+/f/84tb/97WX//nF
rv/60L7/+tXE//rTwf/5zbj/+MOr//i4nP/3ro3/9qR///WddP/0l2z/85Jm//CLX//thVj/6n9T/+Z6
Tv/idEj/9M/A//39/f/+/v7//v79//v7+/9oaGj/AAAA+QAAAJMAAAAyAAAADAAAAAEAAAAAAAAAAAAA
AAIAAAAOAAAAWwAAAP9paWn//Pz8//7+/f/+/v3//fv6//nBp//5x7H/+tbF//vczv/72sz/+tPB//nI
sv/5vaL/97GR//amgv/2nnf/9Zhu//STaP/zj2P/8Ilc/+yDVv/pflH/6Ypj//36+P/9/f3//v79//v7
+/9oaGj/AAAA/wAAAMkAAABxAAAAKwAAAAoAAAABAAAAAAAAAAAAAAAAAAAABQAAAB8AAAD/AQAA/2ho
aP/7+/v//v79//7+/v/86N//+cSt//rTwv/73M7/+9zO//rVxP/5yrT/+L2j//exkf/2p4P/9Z53//WY
bv/0k2f/9JBj//KNXv/vh1n/7IJU//jVx//+/v3//v79//v7+/9nZ2f/AQEA/wAAAP8AAAC6AAAAbQAA
ACoAAAAKAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAXAAAA/3E/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AAAAgAA
AAUAAAAZAAAARwAAAJAAAAD/Dg4N/8PDw//+/v7//v79//i7oP/zjF3/8oxe/++IWv/rg1b/531S/+R3
Tf/fcUj/22xD/9dmPv/TYDn/zlo0/8pVMP/fmYT//v79//39/f/BwcH/Dg0N/wAAAP8AAADYAAAAfwAA
ACoAAAAGAAAAGAAAAEYAAACKAAAA0g0NDf/Dw8L//f39//39/f/86uL/9I5g//SPYv/0kGP/849j/++K
Xv/shVn/6H9U/+R4Tv/fckj/22xD/9dmPv/TYDn/z1s1/8tWMf/14Nn//f39//7+/f/BwcH/DAwM/wAA
AO4AAACsAAAAUwAAABkAAAA6AAAAgQAAAM4NDQ39w8PD//7+/v/+/v7//v7+//i+pP/0kWT/9JNo//SV
af/0lWr/85Nn/++NYv/shlv/6H9V/+N5Tv/fckj/22xD/9dmPv/TYDn/zlo0/+GeiP/+/v3//v7+//7+
/v/BwcH/DAwM/gAAANsAAACJAAAAOgAAAFAAAAC1DQ0N/cPDw//+/v7//v7+//7+/v/+/v7/9qR///SW
a//1mnH/9Ztz//Wbc//1mnH/9JZs//CPZf/sh13/54BV/+N5T//fckj/22xD/9dmPv/SXzj/13dW//7+
/f/+/v7//v7+//39/f/BwcH/DAwM/QAAALkAAABRAAAAcA0NDfrDw8P//v7+//39/f/+/v3//v79//39
/f/1mnH/9Z52//ajfv/2pYH/9qWA//aifP/1nnb/9Jhv//CQZv/rh13/539V/+N4Tv/fckj/22tC/9Zl
Pf/VZkD//f39//39/f/+/v3//f39//39/f/BwcH/DAwM+gAAAHAAAABVDQ0N9sPDw//+/v7//f39//7+
/v/+/v7//v79//agev/2p4P/96+P//eyk//3spL/962M//ang//2oHn/9Jlv//CPZP/rhlv/6H5U/+R3
Tf/gcUf/2mpB/9lsRf/+/v3//v79//7+/v/9/f3//f39/8PDw/8NDQ32AAAAVAAAAAgAAABWDQ0N9sPD
w//9/f3//v79//7+/f/+/v3/97KT//exkf/4vaL/+cGo//jAp//4up7/97GR//ang//1nnb/85Z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GT/64Za/+N5Tv/bbEP/02A5/9yMcv/+/v3/o6Oj/wMDA90AAABMAwMDnKSkpP79/f3//v7+//Wd
dP/1n3n/9Z94//OXbv/siF3/43hO/9tsQ//VaEP//v79//7+/f+jo6P+AwMDnQMDA2qkpKT9/f39//7+
/f/2q4j/+Lib//i2mf/2qIT/85dt/+uFWv/jd0z/3XJL//7+/f/+/v3/pKSk/QMDA20AAAACAwMDbqSk
pP/+/v3/+s25//rRv//6z7z/+LaZ//WfeP/ykGT/64JV/+yhgv/+/v3/pKSk/wMDA6YAAAAMAAAAAAAA
AAwtGxL/pqal//308P/60sD/+tG///i4m//1n3n/9JJl//KRZv/76+P/pqWk/y0bE/8AAACAAAAACgAA
AAAAAAAKd0Ms/5BTN/+mpqX//fTw//rNuf/3q4j/9Zx0//eykv/87OX/pqWl/5FTOP93Qyz/AAAAfwAA
AAoAAAAAAAAACnpFLf/xiFr/kFM3/6ampf/+/v3//v79//7+/v/+/v7/pqWl/5FTOP/xiFr/ekUt/wAA
AHoAAAAKAAAAAAAAAAU9Ihb/ekUt/3dDLP8tGxL/pKSk//7+/f/+/v3/pKSk/y0bE/93Qyz/ekUt/z0i
Fv8AAABAAAAABQAAAAAAAAAAAAAABQAAAAoAAAAKAAAADAMDA26kpKT8pKSk/AMDA20AAAAMAAAACgAA
AAoAAAAKAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAwMDZgMDA2UAAAACAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAwAGsQYAArEGAAKxBgACsQYAArEEAAKxBAACsQQAArEEAAKxBAACsQYAA
rEGAAKxBgACsQYAArEHAAaxB/D+sQQ==
</value>
</data>
</root>
\ No newline at end of file
using log4net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HuichuanLibrary
{
public partial class HCBoardManager
{
//private static UInt32 ret = 0; // 用于接收API返回值
private static Int32 nCardNo = 0; // 默认要打开的卡号
private static UInt64 nCardHandle = 0; // 卡句柄
private static bool CardIsOk = false;
//private static Int16 nTempAxNo = 0;
public static List<int> AxisList = new List<int>();
public static ImcApi.TRsouresNum tResource = new ImcApi.TRsouresNum();//实例化板卡外设硬件资源
private static string DeviceConfigPath = "";
private static string SystemConfigPath = "";
/// <summary>
/// 初始化配置信息,初始化板卡之前,先初始化配置
/// </summary>
/// <param name="deviceConfigPath"></param>
/// <param name="systemConfigPath"></param>
/// <param name="logName"></param>
public static void InitConfig(string deviceConfigPath="",string systemConfigPath="", string logName = "RollingLogFileAppender")
{
if (deviceConfigPath.Equals(""))
{
DeviceConfigPath = ".\\device_config.xml";
}
else
{
DeviceConfigPath = deviceConfigPath;
}
if (systemConfigPath.Equals(""))
{
SystemConfigPath = ".\\system_config.xml";
}
else
{
SystemConfigPath = systemConfigPath;
}
HCLogUtil.LOGGER = LogManager.GetLogger(logName);
}
private static string BoardName()
{
return " HCH[" + nCardNo + "][" + nCardHandle + "] ";
}
#region 板卡操作,初始化,关闭,急停
/// <summary>
/// 初始化板卡
/// </summary>
/// <returns></returns>
public static bool InitCard()
{
try
{
if (CardIsOk)
{
return true;
}
if (!File.Exists(DeviceConfigPath))
{
HCLogUtil.error("InitCard FAIL, 【" + DeviceConfigPath + "】not exists");
return false;
}
if (!File.Exists(SystemConfigPath))
{
HCLogUtil.error("InitCard FAIL, 【" + SystemConfigPath + "】not exists");
return false;
}
//【1】获取卡
Int32 nCardNum = 0;
UInt32 ret = ImcApi.IMC_GetCardsNum(ref nCardNum);
if (ret != 0)
{
ShowErrorLog(" GetCardsNum FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
if (nCardNum <= 0)
{
ShowErrorLog(" Not Find Card");
return false;
}
else
{
ShowLog("GetCardsNum = "+nCardNum+", 将默认打开第0号卡");
}
}
//【2】打开卡句柄
ret = ImcApi.IMC_OpenCardHandle(nCardNo, ref nCardHandle);
if (ret != 0)
{
ShowErrorLog(" OpenCardHandle FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog("OpenCardHandle OK");
}
//【3】下载设备参数
ret = ImcApi.IMC_DownLoadDeviceConfig(nCardHandle, DeviceConfigPath);
if (ret != 0)
{
ShowErrorLog(" DownLoadDeviceConfig FAIL, ErrorCode=0x" + ret.ToString("x8") + ",请检查是否有" + DeviceConfigPath + "文件");
return false;
}
else
{
ShowLog("DownLoadDeviceConfig OK");
}
//【4】启动主站
ShowLog("Begin ScanCardECAT... ...");
uint masterStatus = 0;
ret = ImcApi.IMC_GetECATMasterSts(nCardHandle, ref masterStatus);
if (ret != 0)
{
ShowErrorLog(" GetECATMasterSts FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
if (masterStatus != ImcApi.EC_MASTER_OP)
{
ret = ImcApi.IMC_ScanCardECAT(nCardHandle, 1); //默认阻塞式启动EtherCAT
if (ret != 0)
{
ShowErrorLog(" ScanCardECAT FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
}
}
ShowLog("ScanCardECAT OK");
//【5】下载系统参数
ret = ImcApi.IMC_DownLoadSystemConfig(nCardHandle, SystemConfigPath);
if (ret != 0)
{
ShowErrorLog(" DownLoadSystemConfig FAIL, ErrorCode=0x" + ret.ToString("x8") + ",请检查是否有" + SystemConfigPath + "文件");
return false;
}
else
{
ShowLog("DownLoadSystemConfig OK");
}
tResource = new ImcApi.TRsouresNum();//实例化板卡外设硬件资源
//【6】扫描卡内资源,初始化ComboBox
ret = ImcApi.IMC_GetCardResource(nCardHandle, ref tResource);
if (ret != 0)
{
ShowErrorLog(" GetCardResource FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog("Axis [" + tResource.axNum + "],DI [" + tResource.diNum + "],DO [" + tResource.doNum + "]");
//轴
AxisList = new List<int>();
if (tResource.axNum > 0)
{
for (int i = 0; i < tResource.axNum; i++)
{
AxisList.Add(i);
}
}
CardIsOk = true;
return true;
//IO
}
}
catch (Exception ex)
{
ShowErrorLog(ex.ToString());
}
return false;
}
/// <summary>
/// 关闭板卡
/// </summary>
/// <returns></returns>
public static bool CloseCard()
{
UInt32 ret = ImcApi.IMC_CloseCard(nCardHandle);
if (ret != 0)
{
ShowErrorLog("CloseCard FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
CardIsOk = false;
ShowLog("CloseCard OK");
return true;
}
}
/// <summary>
/// 板卡是否已经初始化OK
/// </summary>
/// <param name="isShowLog"></param>
/// <returns></returns>
public static bool CardInitOk(bool isShowLog = false)
{
if (CardIsOk)
{
return true;
}
else
{
if (isShowLog)
{
ShowErrorLog(" 板卡未初始化完成");
}
return false;
}
}
public static bool EmgStop()
{
if (!CardInitOk())
{
return false ;
}
//取反标志为0时触发急停
UInt32 ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 0);
if (ret != 0)
{
ShowErrorLog(" EmgStop FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog("EmgStop OK");
return true;
}
}
public static bool CancelEmg()
{
if (!CardInitOk())
{
return false;
}
//取反标志为1时取消急停
UInt32 ret = ImcApi.IMC_SetEmgTrigLevelInv(nCardHandle, 1);
if (ret != 0)
{
ShowErrorLog(" CancelEmg FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog("CancelEmg OK");
return true;
}
}
#endregion
#region IO控制
public static bool SetBitDO(short bitNo, short bitValue)
{
if (!CardInitOk())
{
return false;
}
//安装点位写Do
UInt32 ret = ImcApi.IMC_SetEcatDoBit(nCardHandle, bitNo, bitValue);
if (ret != 0)
{
ShowErrorLog(" bitNo["+bitNo+"]bitValue["+bitValue+ "] IMC_SetEcatDoBit FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
return true;
}
public static short GetBitDO(short bitNo)
{
if (!CardInitOk())
{
return 0;
}
short bitValue = 0;
UInt32 ret = ImcApi.IMC_GetEcatDoBit(nCardHandle, bitNo, ref bitValue);
if (ret != 0)
{
ShowErrorLog(" bitNo[" + bitNo + "] IMC_GetEcatDoBit FAIL, ErrorCode=0x" + ret.ToString("x8"));
return 0;
}
return bitValue;
}
public static short GetBitDI(short bitNo)
{
if (!CardInitOk())
{
return 0;
}
short bitValue = 0;
UInt32 ret = ImcApi.IMC_GetEcatDiBit(nCardHandle, bitNo, ref bitValue);
if (ret != 0)
{
ShowErrorLog(" bitNo[" + bitNo + "] IMC_GetEcatDiBit, ErrorCode=0x" + ret.ToString("x8"));
return 0;
}
return bitValue;
}
public static bool SetGroupDO(short groupNo, short groupValue)
{
if (!CardInitOk())
{
return false ;
}
UInt32 ret = ImcApi.IMC_SetEcatGrpDo(nCardHandle, groupNo, groupValue);
if (ret != 0)
{
ShowErrorLog(" groupNo[" + groupNo + "] IMC_SetEcatGrpDo FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
return true;
}
public static short GetGroupDO(short groupNo)
{
if (!CardInitOk())
{
return 0;
}
Int16 groupValue = 0;
UInt32 ret = ImcApi.IMC_GetEcatGrpDo(nCardHandle, groupNo, ref groupValue);
if (ret != 0)
{
ShowErrorLog(" groupNo[" + groupNo + "] IMC_GetEcatGrpDo FAIL, ErrorCode=0x" + ret.ToString("x8"));
return 0;
}
return groupValue;
}
public static short GetGroupDI(short groupNo)
{
if (!CardInitOk())
{
return 0;
}
Int16 groupValue = 0;
UInt32 ret = ImcApi.IMC_GetEcatGrpDi(nCardHandle, groupNo, ref groupValue);
if (ret != 0)
{
ShowErrorLog(" groupNo[" + groupNo + "] IMC_GetEcatGrpDi FAIL, ErrorCode=0x" + ret.ToString("x8"));
return 0;
}
return groupValue;
}
public static bool CloseAllDO()
{
if (!CardInitOk())
{
return false;
}
int groupCount = tResource.doNum / 8;
for (short i = 0; i < groupCount; i++)
{
SetGroupDO(i, 0);
}
return true;
}
public static List<short> GetIOValue(short groupValue )
{
List<short> groupList = new List<short>();
string value = Convert.ToString(groupValue, 2).PadLeft(8, '0');
for (int i = 0; i < 8; i++)
{
string v = value.Substring(i, 1);
//groupIOList[i].Text = "DO_" + i;
if (v.Equals("1"))
{
groupList.Insert(0,1);
}
else
{
groupList.Insert(0, 0);
}
}
return groupList;
}
#endregion
private static void ShowErrorLog(string msg)
{
Console.WriteLine(BoardName() + msg);
HCLogUtil.error(BoardName() + msg);
}
private static void ShowLog(string msg)
{
Console.WriteLine(BoardName() + msg);
HCLogUtil.info(BoardName() + msg);
}
}
public class AxisSts
{
/// <summary>
/// 轴报警信号
/// </summary>
public int ALM = -1;
/// <summary>
/// 轴警告信号
/// </summary>
public int WARN = -1;
/// <summary>
/// 轴急停信号
/// </summary>
public int EMG = -1;
/// <summary>
/// 轴伺服使能信号
/// </summary>
public int ServoOn = -1;
/// <summary>
/// 轴忙碌状态
/// </summary>
public int BUSY = -1;
/// <summary>
/// 轴到位信号
/// </summary>
public int INP = -1;
/// <summary>
/// 正限位信号
/// </summary>
public int PEL = -1;
/// <summary>
/// 原点信号
/// </summary>
public int ORG = -1;
/// <summary>
/// 负限位信号
/// </summary>
public int NEL = -1;
public string ToStr()
{
return "ALM=" + ALM + ";WARN=" + WARN + "EMG=" + EMG + "ServoOn=" + ServoOn + "BUSY=" + BUSY + "INP=" + INP + "PEL=" + PEL + "ORG=" + ORG + ";NEL="+ NEL;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HuichuanLibrary
{
partial class HCBoardManager
{
#region 单轴控制
public static bool ServoOn(short axisNo)
{
if (!CardInitOk())
{
return false;
}
//【2】上使能
UInt32 ret = ImcApi.IMC_AxServoOn(nCardHandle, axisNo, 1);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] ServoOn FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] ServoOn OK");
return true;
}
}
public static bool ServoOff(short axisNo)
{
if (!CardInitOk())
{
return false;
}
//【2】下使能
UInt32 ret = ImcApi.IMC_AxServoOff(nCardHandle, axisNo, 1);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] ServoOff FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] ServoOff OK");
return true;
}
}
#region 回零处理
/// <summary>
/// 开始回零
/// </summary>
/// <param name="axisNo">轴号</param>
/// <param name="highVel">回零高速</param>
/// <param name="lowVel">回零低速</param>
/// <param name="acc">回零加速度</param>
/// <param name="homeMethod">回零方法,默认29</param>
/// <param name="offset">回零偏移,默认0</param>
/// <param name="overtime">超时时间,默认120000</param>
/// <param name="posSrc">端子板信号源,默认0</param>
/// <returns></returns>
public static bool StartHomeMove(short axisNo,uint highVel, uint lowVel, uint acc,short homeMethod=28, int offset=0, uint overtime=120000, short posSrc=0)
{
if (!CardInitOk())
{
return false;
}
//【2】写入回原参数
ImcApi.THomingPara tHomingPara = new ImcApi.THomingPara();
tHomingPara.homeMethod = homeMethod;
tHomingPara.offset = offset;
tHomingPara.highVel = highVel;
tHomingPara.lowVel = lowVel;
tHomingPara.acc = acc;
tHomingPara.overtime = overtime;
tHomingPara.posSrc = posSrc;
//【3】开始回原
UInt32 ret = ImcApi.IMC_StartHoming(nCardHandle, axisNo, ref tHomingPara);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "]StartHoming FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] StartHoming OK");
return true;
}
}
public static bool StopHomeMove(short axisNo)
{
if (!CardInitOk())
{
return false;
}
//【2】触发停止回原
UInt32 ret = ImcApi.IMC_StopHoming(nCardHandle, axisNo, 0); //0:表示平滑停止 1:表示急停
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] StopHoming FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false; ;
}
else
{
ShowLog(" Axis[" + axisNo + "] StopHoming OK");
return true;
}
}
public static short GetHomeStatus(short axisNo)
{
if (!CardInitOk())
{
return -1;
}
//【2】获取回原状态
short nHomingStatus = 0;
UInt32 ret = ImcApi.IMC_GetHomingStatus(nCardHandle, axisNo, ref nHomingStatus);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetHomingStatus FAIL, ErrorCode=0x" + ret.ToString("x8"));
return -1;
}
else
{
//ShowLog("轴回原状态为" + nHomingStatus.ToString());
return nHomingStatus;
}
}
public static bool FinishHome(short axisNo)
{
if (!CardInitOk())
{
return false;
}
//【2】退出回原模式
UInt32 ret = ImcApi.IMC_FinishHoming(nCardHandle, axisNo);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] FinishHoming FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] FinishHoming OK!");
return true;
}
}
/// <summary>
/// 判断回零是否完成
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static bool HomeingIsEnd(short axisNo)
{
//回零状态结束,并且不再忙碌中
AxisSts sts = GetAxisSts(axisNo);
if (sts.BUSY.Equals(0) && sts.INP.Equals(0))
{
short homests = GetHomeStatus(axisNo);
if (homests.Equals(HomeSts_OK))
{
return true;
}
}
return false;
}
#endregion
/// <summary>
/// 判断轴是否在指定的位置
/// </summary>
/// <param name="axisNo">轴号</param>
/// <param name="targetPos">目标位置</param>
/// <param name="maxError">最大误差脉冲值</param>
/// <returns></returns>
public static bool IsInPosition(short axisNo, double targetPos, double maxError = 10)
{
double currP = GetAxisCurrPos(axisNo);
double chazhi = Math.Abs(currP - targetPos);
if (chazhi < maxError)
{
return true ;
}
return false;
}
public static bool AbsMoveIsEnd(short axisNo, double targetPos)
{
AxisSts sts = GetAxisSts(axisNo);
if (sts.BUSY.Equals(0) && sts.INP.Equals(0))
{
if (IsInPosition(axisNo, targetPos))
{
return true;
}
}
return false;
}
public static bool AbsMove(short axisNo, double ptpPos, double ptpVel=0, double ptpAcc=0, double ptpDec=0)
{
if (!CardInitOk())
{
return false;
}
if (ptpVel > 0 && ptpAcc > 0 && ptpDec > 0)
{
if (!SetPTPSpeed(axisNo, ptpVel, ptpAcc, ptpDec))
{
return false;
}
}
short ptpType = 0;
return StartPtpMove(axisNo, ptpType, ptpPos);
}
public static bool RelMove(short axisNo, double ptpPos, double ptpVel = 0, double ptpAcc = 0, double ptpDec = 0)
{
if (!CardInitOk())
{
return false;
}
if (ptpVel > 0 && ptpAcc > 0 && ptpDec > 0)
{
if (!SetPTPSpeed(axisNo, ptpVel, ptpAcc, ptpDec))
{
return false;
}
}
short ptpType = 1;
return StartPtpMove(axisNo, ptpType, ptpPos);
}
private static bool StartPtpMove(short axisNo, short ptpType, double ptpPos)
{
//【3】启动PTP
UInt32 ret = ImcApi.IMC_StartPtpMove(nCardHandle, axisNo, ptpPos, ptpType);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] StartPtpMove " + ptpType + " FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] StartPtpMove " + ptpType + " OK");
return true;
}
}
public static bool SetPTPSpeed(short axisNo, double ptpVel, double ptpAcc, double ptpDec)
{
if (!CardInitOk())
{
return false;
}
UInt32 ret = ImcApi.IMC_SetSingleAxMvPara(nCardHandle, axisNo, ptpVel, ptpAcc, ptpDec);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] SetSingleAxMvPara FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] SetSingleAxMvPara OK");
return true;
}
}
public static bool AxisStop(short axisNo)
{
if (!CardInitOk())
{
return false;
}
//【2】轴停止
UInt32 ret = ImcApi.IMC_AxMoveStop(nCardHandle, axisNo, 1); //StopType=1,立即停止
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] MoveStop FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] MoveStop OK");
return true;
}
}
/// <summary>
/// 设置齿轮比
/// </summary>
/// <param name="axisNo">轴号</param>
/// <param name="Motor_Revolution">电子齿轮分子:电机分辨率</param>
/// <param name="Shaft_Revolution">电子齿轮分母:一圈脉冲数</param>
/// <returns></returns>
public static bool SetEcatSdo(ushort axisNo, int Motor_Revolution, int Shaft_Revolution)
{
if (!CardInitOk())
{
return false;
}
//【3】获取轴号对应的实际地址
short nphyStationId = 0, nphySlotId = 0;
uint abort_code = 0;
UInt32 ret = ImcApi.IMC_GetAxEcatStation(nCardHandle, axisNo, ref nphyStationId, ref nphySlotId);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] IMC_GetAxEcatStation FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
//【4】设置电子齿轮分子
ret = ImcApi.IMC_SetEcatSdo(nCardHandle, nphyStationId, 0x6091, 0x01, BitConverter.GetBytes(Motor_Revolution), 4, ref abort_code);
if (ret != 0 | abort_code != 0)
{
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_1 FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_1 FAIL, ErrorCode=0x" + abort_code.ToString("x8"));
return false;
}
}
//【4】设置电子齿轮分母
ret = ImcApi.IMC_SetEcatSdo(nCardHandle, nphyStationId, 0x6091, 0x02, BitConverter.GetBytes(Shaft_Revolution), 4, ref abort_code);
if (ret != 0 | abort_code != 0)
{
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_2 FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowErrorLog(" Axis[" + axisNo + "] IMC_SetEcatSdo_2 FAIL, ErrorCode=0x" + abort_code.ToString("x8"));
return false;
}
}
return true;
}
public static bool SpeedMove(short axisNo, double targetVel)
{
if (!CardInitOk())
{
return false;
}
UInt32 ret = ImcApi.IMC_StartJogMove(nCardHandle, axisNo, targetVel);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] speed ["+targetVel+ "] StartJogMove FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
else
{
ShowLog(" Axis[" + axisNo + "] speed [" + targetVel + "] StartJogMove OK");
return true;
}
}
/// <summary>
/// 获取轴规划模式
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static short GetAxisPrfMode(short axisNo)
{
if (!CardInitOk())
{
return -1;
}
try
{
Int16[] nTimerAxPrfMode = { 0 };
UInt32 ret = ImcApi.IMC_GetAxPrfMode(nCardHandle, axisNo, nTimerAxPrfMode, 1); //变量需要定义为数组,默认读取1个轴
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfMode FAIL, ErrorCode=0x" + ret.ToString("x8"));
return -1;
}
if (nTimerAxPrfMode.Length > 0)
{
return nTimerAxPrfMode[0];
}
}
catch (Exception ex)
{
ShowErrorLog("" + ex.ToString());
}
return -1;
}
/// <summary>
/// 获取轴状态
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static AxisSts GetAxisSts(short axisNo)
{
AxisSts sts = new AxisSts();
if (!CardInitOk())
{
return sts;
}
Int32[] nTimerAxSts = { 0 };
UInt32 ret = ImcApi.IMC_GetAxSts(nCardHandle, axisNo, nTimerAxSts, 1);
if (ret != 0 || nTimerAxSts.Length <= 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetAxSts FAIL, ErrorCode=0x" + ret.ToString("x8"));
return sts;
}
int axisState = nTimerAxSts[0];
//【3】更新界面显示
sts.ALM = ((axisState & 0x01) == 0x01) ? 1 : 0; //报警信号
sts.ServoOn = ((axisState & 0x02) == 0x02) ? 1 : 0; //使能信号
sts.BUSY = ((axisState & 0x04) == 0x04) ? 1 : 0; //轴忙信号
sts.INP = ((axisState & 0x08) == 0x08) ? 1 : 0; //轴到位信号
sts.WARN = ((axisState & 0x1000) == 0x1000) ? 1 : 0; //警告信号
sts.EMG = ((axisState & 0x200) == 0x200) ? 1 : 0; //急停信号
Int16 nTimerAxInput = 0;
ret = ImcApi.IMC_GetAxEcatDigitalInput(nCardHandle, axisNo, ref nTimerAxInput);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "]GetAxEcatDigitalInput ,ErrorCode=0x" + ret.ToString("x8"));
return sts;
}
sts.NEL = ((nTimerAxInput & 0x01) == 0x01) ? 1 : 0; //负限位信号
sts.PEL = ((nTimerAxInput & 0x02) == 0x02) ? 1 : 0; //正限位信号
sts.ORG = ((nTimerAxInput & 0x04) == 0x04) ? 1 : 0; //原点信号
return sts;
}
/// <summary>
/// 获取轴规划位置
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static double GetAxisPrfPos(short axisNo)
{
if (!CardInitOk())
{
return -1;
}
double[] nTimerAxPrfPos = { 0 };
UInt32 ret = ImcApi.IMC_GetAxPrfPos(nCardHandle, axisNo, nTimerAxPrfPos, 1);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfPos FAIL, ErrorCode=0x" + ret.ToString("x8"));
return -1;
}
return nTimerAxPrfPos[0];
}
/// <summary>
/// 获取轴规划速度
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static double GetAxisPrfVel(short axisNo)
{
if (!CardInitOk())
{
return -1;
}
double[] nTimerAxPrfVel = { 0 };
UInt32 ret = ImcApi.IMC_GetAxPrfVel(nCardHandle, axisNo, nTimerAxPrfVel, 1);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetAxPrfVel FAIL, ErrorCode=0x" + ret.ToString("x8"));
return -1;
}
return nTimerAxPrfVel[0];
}
/// <summary>
/// 获取轴反馈位置
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static double GetAxisCurrPos(short axisNo)
{
if (!CardInitOk())
{
return -1;
}
double[] nTimerAxEncPos = { 0 };
UInt32 ret = ImcApi.IMC_GetAxEncPos(nCardHandle, axisNo, nTimerAxEncPos, 1);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetAxEncPos FAIL, ErrorCode=0x" + ret.ToString("x8"));
return -1;
}
return nTimerAxEncPos[0];
}
/// <summary>
///获取轴反馈速度
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static double GetAxisCurrVel(short axisNo)
{
if (!CardInitOk())
{
return -1;
}
double[] nTimerAxEncVel = { 0 };
UInt32 ret = ImcApi.IMC_GetAxEncVel(nCardHandle, axisNo, nTimerAxEncVel, 1);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetAxEncVel FAIL, ErrorCode=0x" + ret.ToString("x8"));
return -1;
}
return nTimerAxEncVel[0];
}
/// <summary>
/// 获取轴反馈加速度
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static double GetAxisCurrAcc(short axisNo)
{
if (!CardInitOk())
{
return -1;
}
double[] nTimerAxEncAcc = { 0 };
UInt32 ret = ImcApi.IMC_GetAxEncAcc(nCardHandle, axisNo, nTimerAxEncAcc, 1);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] GetAxEncAcc FAIL, ErrorCode=0x" + ret.ToString("x8"));
return -1;
}
return nTimerAxEncAcc[0];
}
/// <summary>
/// 清楚轴报警状态
/// </summary>
///<param name="axisNo">轴号</param>
/// <returns></returns>
public static bool ClearAxisSts(short axisNo)
{
if (!CardInitOk())
{
return false;
}
UInt32 ret = ImcApi.IMC_ClrAxSts(nCardHandle, axisNo);
if (ret != 0)
{
ShowErrorLog(" Axis[" + axisNo + "] ClrAxSts FAIL, ErrorCode=0x" + ret.ToString("x8"));
return false;
}
return true;
}
#endregion
#region 轴状态
public static string AxisPrfMode(short axCtrlMode)
{
axCtrlMode = (short)(axCtrlMode & 0xf);
string strCtrlMode = string.Empty;
switch (axCtrlMode)
{
case 0:
strCtrlMode = "0=无模式";
break;
case 1:
strCtrlMode = "1=点对点";
break;
case 2:
strCtrlMode = "2=JOG";
break;
case 3:
strCtrlMode = "3=电子齿轮";
break;
case 4:
strCtrlMode = "4=电子凸轮";
break;
case 5:
strCtrlMode = "5=PVT";
break;
case 6:
strCtrlMode = "6=龙门";
break;
case 7:
strCtrlMode = "7=手轮";
break;
case 9:
strCtrlMode = "8=点位连续";
break;
case 11:
strCtrlMode = "11=插补同步轴";
break;
case 15:
strCtrlMode = "15=回零";
break;
default:
break;
}
return strCtrlMode;
}
public static string AxisHomeSts(short homeStatus)
{
string sStr = "";
switch (homeStatus)
{
case 0:
sStr = "0=正在回零中";
break;
case 1:
sStr = "1=回零中断或者没有开始启动";
break;
case 2:
sStr = "2=回零结束,但没有到设定的目标位置";
break;
case 3:
sStr = "3=回零完成";
break;
case 4:
sStr = "4=回零中发生错误,同时速度不为0";
break;
case 5:
sStr = "5=回零中发生错误,同时速度为0";
break;
default:
break;
}
return sStr;
}
#endregion
/// <summary>
/// 回原点状态:0=正在回零中
/// </summary>
public static short HomeSts_Moveing = 0;
/// <summary>
/// 回原点状态:1=回零中断或者没有开始启动
/// </summary>
public static short HomeSts_NotStart = 1;
/// <summary>
/// 回原点状态:3=回零完成
/// </summary>
public static short HomeSts_OK = 3;
}
}
using log4net;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace HuichuanLibrary
{
public class HCLogUtil
{
public static ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender");
public static ConcurrentDictionary<int, DateTime> lastErrorLogTime = new ConcurrentDictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null;
public static int showCount = 20;
public static bool debug_opened = false;
public static void info(ILog log, string msg)
{
if (log == null)
{
return;
}
log.Info(msg);
AddToBox(msg, Color.Black);
//clear();
}
public static void info(ILog log, string msg, Color color)
{
log.Info(msg);
AddToBox(msg, color);
}
public static void debug(ILog log, string msg, Color color)
{
log.Debug(msg);
if (debug_opened)
{
AddToBox(msg, color);
}
}
public static void debug(ILog log, string msg)
{
log.Debug(msg);
if (debug_opened)
{
AddToBox(msg, Color.Gray);
}
}
public static void error(string errorMsg, int type, int seconds = 10)
{
try
{
if (lastErrorLogTime.ContainsKey(type))
{
TimeSpan span = DateTime.Now - lastErrorLogTime[type];
if (span.TotalSeconds > seconds)
{
lastErrorLogTime[type] = DateTime.Now;
error(LOGGER, errorMsg);
}
}
else
{
lastErrorLogTime.TryAdd(type, DateTime.Now);
error(LOGGER, errorMsg);
}
}
catch (Exception ex)
{
LOGGER.Error(" 打印日志【" + type + "-" + errorMsg + "】出错:" + ex.ToString());
}
}
public static void error(ILog log, string errorMsg, Exception ex = null)
{
if (errorMsg.Trim().Equals("") && (ex == null))
{
return;
}
if (ex == null)
{
log.Error(errorMsg);
}
else
{
log.Error(errorMsg, ex);
}
AddToBox(errorMsg, Color.Red);
}
private static object lockObj = "";
private static void AddToBox(string msg, Color color)
{
if (Monitor.TryEnter(lockObj, 2))
{
try
{
ShowLogPro(msg, color);
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
}
finally
{
Monitor.Exit(lockObj);
}
}
else
{
LOGGER.Debug("ShowLogPro【" + msg + "】失败,未得到锁");
}
}
private static List<string> logList = new List<string>();
public static string LastText = "";
[HandleProcessCorruptedStateExceptions]
private static void ShowLogPro(string msg, Color color)
{
try
{
if (logList.Count >= showCount)
{
logList.RemoveAt(0);
}
string text = "";
foreach (string str in logList)
{
text += str;
}
System.DateTime now = System.DateTime.Now;
logList.Add(now.ToLongTimeString() + " " + msg + Environment.NewLine);
if (logBox == null)
{
return;
}
LastText = text;
if (logBox.Visible)
{
logBox.Text = text;
// logBox.Focus(); //使文本框获取焦点
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine); //增加文本
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
catch (AccessViolationException e)
{
LOGGER.Error(" ShowLogPro 出错:" + e.ToString());
}
catch (Exception ex)
{
LOGGER.Error("出错:" + ex.ToString());
}
}
private static DateTime lastTime = DateTime.Now;
public static void UpdateLogbox()
{
if (logBox != null && logBox.Visible)
{
logBox.Text = LastText;
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
public static void ClearLog()
{
if (logBox != null)
{
LastText = "";
logList.Clear();
logBox.Text = "";
}
}
public static void debug(string msg)
{
debug(LOGGER, msg);
}
public static void error(string errorMsg, Exception ex = null)
{
error(LOGGER, errorMsg, ex);
}
public static void info(string msg)
{
info(LOGGER, msg);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C9575C5E-9D4B-4B4F-BE41-926652B8985F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HuichuanLibrary</RootNamespace>
<AssemblyName>HuichuanLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="FrmHuiChuanTest.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmHuiChuanTest.Designer.cs">
<DependentUpon>FrmHuiChuanTest.cs</DependentUpon>
</Compile>
<Compile Include="HCBoardManager.cs" />
<Compile Include="HCBoardManager_Axis.cs" />
<Compile Include="ImcApi.cs" />
<Compile Include="HCLogUtil.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="huichuan\x64\IMC_API_x64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="huichuan\x64\msvcr100.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="huichuan\x64\msvcr100d.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="huichuan\x86\IMC_API_x86.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="huichuan\x86\msvcr100.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="huichuan\x86\msvcr100d.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="huichuan\x64\IMC_API_x64.lib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="huichuan\x86\IMC_API_x86.lib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="FrmHuiChuanTest.resx">
<DependentUpon>FrmHuiChuanTest.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
此文件的差异太大,无法显示。
using log4net;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace HuichuanLibrary
{
public class LogUtil
{
public static ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender");
public static ConcurrentDictionary<int, DateTime> lastErrorLogTime = new ConcurrentDictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null;
public static int showCount = 15;
public static bool debug_opened = false;
public static void info(ILog log, string msg)
{
if (log == null)
{
return;
}
log.Info(msg);
AddToBox(msg, Color.Black);
//clear();
}
public static void info(ILog log, string msg, Color color)
{
log.Info(msg);
AddToBox(msg, color);
}
public static void debug(ILog log, string msg, Color color)
{
log.Debug(msg);
if (debug_opened)
{
AddToBox(msg, color);
}
}
public static void debug(ILog log, string msg)
{
log.Debug(msg);
if (debug_opened)
{
AddToBox(msg, Color.Gray);
}
}
public static void error(string errorMsg, int type, int seconds = 10)
{
try
{
if (lastErrorLogTime.ContainsKey(type))
{
TimeSpan span = DateTime.Now - lastErrorLogTime[type];
if (span.TotalSeconds > seconds)
{
lastErrorLogTime[type] = DateTime.Now;
error(LOGGER, errorMsg);
}
}
else
{
lastErrorLogTime.TryAdd(type, DateTime.Now);
error(LOGGER, errorMsg);
}
}
catch (Exception ex)
{
LOGGER.Error(" 打印日志【" + type + "-" + errorMsg + "】出错:" + ex.ToString());
}
}
public static void error(ILog log, string errorMsg, Exception ex = null)
{
if (errorMsg.Trim().Equals("") && (ex == null))
{
return;
}
if (ex == null)
{
log.Error(errorMsg);
}
else
{
log.Error(errorMsg, ex);
}
AddToBox(errorMsg, Color.Red);
}
private static object lockObj = "";
private static void AddToBox(string msg, Color color)
{
if (Monitor.TryEnter(lockObj, 2))
{
try
{
ShowLogPro(msg, color);
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
}
finally
{
Monitor.Exit(lockObj);
}
}
else
{
LOGGER.Debug("ShowLogPro【" + msg + "】失败,未得到锁");
}
}
private static List<string> logList = new List<string>();
public static string LastText = "";
[HandleProcessCorruptedStateExceptions]
private static void ShowLogPro(string msg, Color color)
{
try
{
if (logList.Count >= showCount)
{
logList.RemoveAt(0);
}
string text = "";
foreach (string str in logList)
{
text += str;
}
System.DateTime now = System.DateTime.Now;
logList.Add(now.ToLongTimeString() + " " + msg + Environment.NewLine);
if (logBox == null)
{
return;
}
LastText = text;
if (logBox.Visible)
{
logBox.Text = text;
// logBox.Focus(); //使文本框获取焦点
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine); //增加文本
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
catch (AccessViolationException e)
{
LOGGER.Error(" ShowLogPro 出错:" + e.ToString());
}
catch (Exception ex)
{
LOGGER.Error("出错:" + ex.ToString());
}
}
private static DateTime lastTime = DateTime.Now;
public static void UpdateLogbox()
{
if (logBox != null && logBox.Visible)
{
logBox.Text = LastText;
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
public static void ClearLog()
{
if (logBox != null)
{
LastText = "";
logList.Clear();
logBox.Text = "";
}
}
public static void debug(string msg)
{
debug(LOGGER, msg);
}
public static void error(string errorMsg, Exception ex = null)
{
error(LOGGER, errorMsg, ex);
}
public static void info(string msg)
{
info(LOGGER, msg);
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("HuichuanLibrary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HuichuanLibrary")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c9575c5e-9d4b-4b4f-be41-926652b8985f")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!