Commit c4766ffe 几米阳光

伺服通信模式修改。扫码模式修改。

1 个父辈 b1f19f32
此文件类型无法预览
此文件类型无法预览
......@@ -38,15 +38,25 @@
<ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Basler.Pylon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e389355f398382ab, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Basler.Pylon.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="DataMatrix.net">
<HintPath>..\..\dll\DataMatrix.net.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="MvCameraControl.Net">
<HintPath>..\..\dll\MvCameraControl.Net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceModel" />
......@@ -73,12 +83,6 @@
<Compile Include="FrmBase.Designer.cs">
<DependentUpon>FrmBase.cs</DependentUpon>
</Compile>
<Compile Include="FrmCamera.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmCamera.Designer.cs">
<DependentUpon>FrmCamera.cs</DependentUpon>
</Compile>
<Compile Include="FrmIOStatus.cs">
<SubType>Form</SubType>
</Compile>
......@@ -100,9 +104,6 @@
<EmbeddedResource Include="FrmBase.resx">
<DependentUpon>FrmBase.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmCamera.resx">
<DependentUpon>FrmCamera.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmIOStatus.resx">
<DependentUpon>FrmIOStatus.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -148,9 +148,13 @@
this.iO状态查看ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.查看IOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.料仓运转ONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.料仓运转OFFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.料仓运转ONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.打开舱门ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
......@@ -160,8 +164,6 @@
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
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();
this.学习二维码ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.配置信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.轴运动配置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
......@@ -179,10 +181,6 @@
this.显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
this.groupBox5.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -1750,55 +1748,79 @@
// 查看IOToolStripMenuItem
//
this.查看IOToolStripMenuItem.Name = "查看IOToolStripMenuItem";
this.查看IOToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.查看IOToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.查看IOToolStripMenuItem.Text = "查看IO";
this.查看IOToolStripMenuItem.Click += new System.EventHandler(this.查看IOToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(173, 6);
//
// 料仓运转ONToolStripMenuItem
// toolStripMenuItem3
//
this.料仓运转ONToolStripMenuItem.Name = "料仓运转ONToolStripMenuItem";
this.料仓运转ONToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.料仓运转ONToolStripMenuItem.Text = "料仓运转ON";
this.料仓运转ONToolStripMenuItem.Click += new System.EventHandler(this.料仓运转ONToolStripMenuItem_Click);
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(176, 26);
this.toolStripMenuItem3.Text = "门禁功能屏蔽";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// toolStripSeparator6
// toolStripSeparator14
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(173, 6);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(176, 26);
this.toolStripMenuItem2.Text = "门禁功能打开";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(173, 6);
//
// 料仓运转OFFToolStripMenuItem
//
this.料仓运转OFFToolStripMenuItem.Name = "料仓运转OFFToolStripMenuItem";
this.料仓运转OFFToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.料仓运转OFFToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.料仓运转OFFToolStripMenuItem.Text = "料仓运转OFF";
this.料仓运转OFFToolStripMenuItem.Click += new System.EventHandler(this.料仓运转OFFToolStripMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(173, 6);
//
// 料仓运转ONToolStripMenuItem
//
this.料仓运转ONToolStripMenuItem.Name = "料仓运转ONToolStripMenuItem";
this.料仓运转ONToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.料仓运转ONToolStripMenuItem.Text = "料仓运转ON";
this.料仓运转ONToolStripMenuItem.Click += new System.EventHandler(this.料仓运转ONToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(173, 6);
//
// 打开舱门ToolStripMenuItem
//
this.打开舱门ToolStripMenuItem.Name = "打开舱门ToolStripMenuItem";
this.打开舱门ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.打开舱门ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.打开舱门ToolStripMenuItem.Text = "打开仓门";
this.打开舱门ToolStripMenuItem.Click += new System.EventHandler(this.打开舱门ToolStripMenuItem_Click);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator8.Size = new System.Drawing.Size(173, 6);
//
// 关闭仓门ToolStripMenuItem
//
this.关闭仓门ToolStripMenuItem.Name = "关闭仓门ToolStripMenuItem";
this.关闭仓门ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.关闭仓门ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.关闭仓门ToolStripMenuItem.Text = "关闭仓门";
this.关闭仓门ToolStripMenuItem.Click += new System.EventHandler(this.关闭仓门ToolStripMenuItem_Click);
//
......@@ -1809,8 +1831,6 @@
this.toolStripSeparator9,
this.扫码测试ToolStripMenuItem,
this.toolStripSeparator10,
this.摄像机调试ToolStripMenuItem,
this.toolStripSeparator11,
this.学习二维码ToolStripMenuItem});
this.设备调试ToolStripMenuItem.Name = "设备调试ToolStripMenuItem";
this.设备调试ToolStripMenuItem.Size = new System.Drawing.Size(86, 25);
......@@ -1819,43 +1839,31 @@
// 轴卡点动ToolStripMenuItem
//
this.轴卡点动ToolStripMenuItem.Name = "轴卡点动ToolStripMenuItem";
this.轴卡点动ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.轴卡点动ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.轴卡点动ToolStripMenuItem.Text = "轴卡点动";
this.轴卡点动ToolStripMenuItem.Click += new System.EventHandler(this.轴卡点动ToolStripMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(157, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
//
// 扫码测试ToolStripMenuItem
//
this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem";
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(157, 6);
//
// 摄像机调试ToolStripMenuItem
//
this.摄像机调试ToolStripMenuItem.Name = "摄像机调试ToolStripMenuItem";
this.摄像机调试ToolStripMenuItem.Size = new System.Drawing.Size(160, 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(157, 6);
this.toolStripSeparator10.Size = new System.Drawing.Size(177, 6);
//
// 学习二维码ToolStripMenuItem
//
this.学习二维码ToolStripMenuItem.Name = "学习二维码ToolStripMenuItem";
this.学习二维码ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.学习二维码ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.学习二维码ToolStripMenuItem.Text = "学习二维码";
this.学习二维码ToolStripMenuItem.Click += new System.EventHandler(this.学习二维码ToolStripMenuItem_Click);
//
......@@ -2004,30 +2012,6 @@
this.notifyIcon1.Text = "料仓客户端";
this.notifyIcon1.Visible = true;
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem2.Text = "门禁功能打开";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Text = "门禁功能屏蔽";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(177, 6);
//
// toolStripSeparator14
//
this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(177, 6);
//
// FrmStoreBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -2207,7 +2191,6 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 摄像机调试ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 学习二维码ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
......@@ -2215,7 +2198,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
......
......@@ -300,6 +300,7 @@ namespace OnlineStore.ACSingleStore
lblServerOn.Text = "伺服OFF";
}
string deviceName = GetPortName();
short slvValue=(short) GetSlaveAddr();
if (ACServerManager.ServerOnStatus(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue()))
{
axis_1_Alarm.IOValue = ACServerManager.GetAlarmStatus(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue());
......@@ -309,7 +310,8 @@ namespace OnlineStore.ACSingleStore
int lCountPulse1 = ACServerManager.GetActualtPosition(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue());
lblCountPulse1.Text = string.Format("{0:d}", lCountPulse1);
txtMiddleTarget.Text = store.Config.Middle_Axis.TargetPosition.ToString();
if (deviceName.Equals(store.Config.Middle_Axis.DeviceName))
//if (deviceName.Equals(store.Config.Middle_Axis.DeviceName))
if (store.Config.Middle_Axis.IsSameAxis(deviceName, slvValue))
{
lblOutPulse.Text = lblOutPulse1.Text;
lblCountPulse.Text = lblCountPulse1.Text;
......@@ -324,7 +326,8 @@ namespace OnlineStore.ACSingleStore
int lCountPulse2 = ACServerManager.GetActualtPosition(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue());
lblCountPulse2.Text = string.Format("{0:d}", lCountPulse2);
txtInoutTarget.Text = store.Config.InOut_Axis.TargetPosition.ToString();
if (deviceName.Equals(store.Config.UpDown_Axis.DeviceName))
//if (deviceName.Equals(store.Config.UpDown_Axis.DeviceName))
if (store.Config.UpDown_Axis.IsSameAxis(deviceName, slvValue))
{
lblOutPulse.Text = lblOutPulse2.Text;
lblCountPulse.Text = lblCountPulse2.Text;
......@@ -338,7 +341,8 @@ namespace OnlineStore.ACSingleStore
int lCountPulse3 = ACServerManager.GetActualtPosition(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue());
lblCountPulse3.Text = string.Format("{0:d}", lCountPulse3);
txtUpdownTarget.Text = store.Config.UpDown_Axis.TargetPosition.ToString();
if (deviceName.Equals(store.Config.InOut_Axis.DeviceName))
//if (deviceName.Equals(store.Config.InOut_Axis.DeviceName))
if (store.Config.InOut_Axis.IsSameAxis(deviceName, slvValue))
{
lblOutPulse.Text = lblOutPulse3.Text;
lblCountPulse.Text = lblCountPulse3.Text;
......@@ -502,7 +506,8 @@ namespace OnlineStore.ACSingleStore
// MessageBox.Show("位置超出" + axisC.Explain + "上下限(" + axisC.PositionMin + "-" + axisC.PositionMax + ")");
// return;
//}
if (portName.Equals(store.Config.InOut_Axis.DeviceName) && (store.LoacationIsDown().Equals(false)))
//if (portName.Equals(store.Config.InOut_Axis.DeviceName) && (store.LoacationIsDown().Equals(false)))
if (store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (store.LoacationIsDown().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
......@@ -516,7 +521,8 @@ namespace OnlineStore.ACSingleStore
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
int speed = FormUtil.GetIntValue(txtASpeed);
if (portName.Equals(store.Config.InOut_Axis.DeviceName) && (store.LoacationIsDown().Equals(false)))
//if (portName.Equals(store.Config.InOut_Axis.DeviceName) && (store.LoacationIsDown().Equals(false)))
if (store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (store.LoacationIsDown().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
......@@ -540,7 +546,8 @@ namespace OnlineStore.ACSingleStore
// return;
//}
if (portName.Equals(store.Config.InOut_Axis.DeviceName) && (store.LoacationIsDown().Equals(false)))
//if (portName.Equals(store.Config.InOut_Axis.DeviceName) && (store.LoacationIsDown().Equals(false)))
if (store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (store.LoacationIsDown().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
......@@ -833,6 +840,7 @@ namespace OnlineStore.ACSingleStore
{
int currIndex = cmbPosition.SelectedIndex;
store.autoPositionIndex = currIndex;
store.AutoStartIndex = currIndex;
string poText = cmbPosition.Text;
store.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
......@@ -929,11 +937,16 @@ namespace OnlineStore.ACSingleStore
{
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
string message = "";
List<string> codeList = HDevelopExport.CameraScan();
//List<string> codeList = HDevelopExport.CameraScan();
//foreach (string str in codeList)
//{
// string code = HDevelopExport.SubStrCode(str);
// message = message + code + "##";
//}
List<string> codeList = CodeManager.CameraScan();
foreach (string str in codeList)
{
string code = HDevelopExport.SubStrCode(str);
message = message + code + "##";
message = message + str + "##";
}
LogUtil.info("扫码测试收到二维码:" + message);
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
......@@ -1015,7 +1028,7 @@ namespace OnlineStore.ACSingleStore
{
msg = "";
string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue();
int axisNo = moveAxis.GetAxisValue();
bool isend = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
......@@ -1024,7 +1037,7 @@ namespace OnlineStore.ACSingleStore
{
if (errorCount > moveAxis.CanErrorCountMax)
{
msg = " DeviceName=" + deviceName + ",AxisNo=" + axisNo + ",targetPosition=" + targetPosition + ",targetSpeed=" + targetSpeed + ",当前outCount=" + outCount + ",误差值大于最大误差【" + moveAxis.CanErrorCountMax + "】,但是轴已经停止运动,需要报警";
msg =moveAxis.Explain + ",targetPosition=" + targetPosition + ",targetSpeed=" + targetSpeed + ",当前outCount=" + outCount + ",误差值大于最大误差【" + moveAxis.CanErrorCountMax + "】,但是轴已经停止运动,需要报警";
LogUtil.error(LOGGER, msg);
return false;
}
......@@ -1216,19 +1229,27 @@ namespace OnlineStore.ACSingleStore
}
}
private void 摄像机调试ToolStripMenuItem_Click(object sender, EventArgs e)
{
FrmCamera frm = new FrmCamera(store);
frm.ShowDialog();
}
//private void 摄像机调试ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// FrmCamera frm = new FrmCamera(store);
// frm.ShowDialog();
//}
private void 学习二维码ToolStripMenuItem_Click(object sender, EventArgs e)
{
//string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
//string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
//HDCodeLearnHelper.LoadConfig(nameStr, codeStr);
//FrmCodeLearn learn = new FrmCodeLearn();
//learn.ShowDialog();
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
HDCodeLearnHelper.LoadConfig(nameStr, codeStr);
FrmCodeLearn learn = new FrmCodeLearn();
learn.ShowDialog();
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
}
private void btnReadHomeSingle_Click(object sender, EventArgs e)
......
......@@ -59,7 +59,7 @@
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" />
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" />
<Compile Include="acSingleStore\ACStoreManager.cs" />
<Compile Include="halcon\HDevelopExport.cs" />
<Compile Include="halcon\CodeManager.cs" />
<Compile Include="KangNaiDe\KNDManager.cs" />
<Compile Include="KangNaiDe\MasterTcpClient.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" />
......
......@@ -314,8 +314,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (dataByte.Length == 2)
{
sendData[4] = dataByte[1];
sendData[5] = dataByte[0];
sendData[4] = dataByte[0];
sendData[5] = dataByte[1];
//sendData[4] = dataByte[1];
//sendData[5] = dataByte[0];
}
sendData = buildCheckData(sendData, sendData.Length - 2);
......
......@@ -19,13 +19,14 @@ namespace OnlineStore.DeviceLibrary
private static Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
private static string mapObj = "";
private static int GetAddrValue(string portName, string addr)
private static int GetAddrValue(string portName,int slvAddr, string addr)
{
int value = -1;
try
{
string name = portName + "_" + slvAddr;
Dictionary<string, int> map = null;
ComAddrValue.TryGetValue(portName, out map);
ComAddrValue.TryGetValue(name, out map);
if (map == null)
{
return -1;
......@@ -41,27 +42,28 @@ namespace OnlineStore.DeviceLibrary
}
return value;
}
private static void UpdateAddrValue(string portName, string addr, int value)
private static void UpdateAddrValue(string portName,int slvAddr, string addr, int value)
{
try
{
lock (mapObj)
{
string name = portName + "_" + slvAddr;
Dictionary<string, int> map = null;
ComAddrValue.TryGetValue(portName, out map);
ComAddrValue.TryGetValue(name, out map);
if (map == null)
{
map = new Dictionary<string, int>();
ComAddrValue.Add(portName, map);
ComAddrValue.Add(name, map);
}
if (map.ContainsKey(addr))
{
ComAddrValue[portName][addr] = value;
ComAddrValue[name][addr] = value;
}
else
{
ComAddrValue[portName].Add(addr, value);
ComAddrValue[name].Add(addr, value);
}
}
}
......@@ -309,12 +311,14 @@ namespace OnlineStore.DeviceLibrary
if (isHomeEnd.Equals(1))
{
int value = 2000;
if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName) ||
portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
//if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName) ||
// portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
if(ACStoreManager.store.Config.Middle_Axis.IsSameAxis(portName, slvAddr) ||
ACStoreManager.store.Config.InOut_Axis.IsSameAxis(portName,slvAddr))
{
value = -2000;
}
LogUtil.info("轴【" + portName + "】原点返回时发现原点已亮且回过原点,需要先相对走" + value);
LogUtil.info("轴【" + portName +"_"+ slvAddr + "】原点返回时发现原点已亮且回过原点,需要先相对走" + value);
RelMove(portName, slvAddr, value);
bool isStop = false;
for (int i = 0; i <= 10; i++)
......@@ -323,13 +327,13 @@ namespace OnlineStore.DeviceLibrary
if (GetBusyStatus(portName, slvAddr).Equals(0))
{
isStop = true;
LogUtil.info("轴【" + portName + "相对走" + value + "已结束");
LogUtil.info("轴【" + portName + "_" + slvAddr + "】相对走" + value + "已结束");
break;
}
}
if (!isStop)
{
LogUtil.info("轴【" + portName + "相对走" + value + "已等待2分钟,直接停止");
LogUtil.info("轴【" + portName + "_" + slvAddr + "】相对走" + value + "已等待2分钟,直接停止");
SuddenStop(portName, slvAddr);
}
}
......@@ -337,15 +341,15 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("轴【" + portName + "】原点返回前验证是否在原点出错:" + ex.StackTrace);
LogUtil.error("轴【" + portName + "_" + slvAddr + "】原点返回前验证是否在原点出错:" + ex.StackTrace);
}
//旋转轴回正方向,其他轴回负方向
if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName))
if (ACStoreManager.store.Config.Middle_Axis.IsSameAxis(portName, slvAddr))
{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
LogUtil.info("旋转轴原点返回方向:正方向");
}
else if (portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
else if (ACStoreManager.store.Config.InOut_Axis.IsSameAxis(portName, slvAddr))
{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
LogUtil.info("进出轴原点返回方向:正方向");
......@@ -361,28 +365,22 @@ namespace OnlineStore.DeviceLibrary
public static void SpeedMove(string portName, int slvAddr, int speed)
{
int preSpeed = GetAddrValue(portName, ACCMDManager.Speed_Addr);
int preSpeed = GetAddrValue(portName,slvAddr, ACCMDManager.Speed_Addr);
if ((preSpeed.Equals(-1)) || (!preSpeed.Equals(Math.Abs(speed))))
{
byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, "4601", string.Format("{0:X2}", Math.Abs(speed)), 2);
SendData(portName, data);
UpdateAddrValue(portName, ACCMDManager.Speed_Addr, Math.Abs(speed));
UpdateAddrValue(portName,slvAddr, ACCMDManager.Speed_Addr, Math.Abs(speed));
Thread.Sleep(SleepMSendons);
}
if (speed > 0)
{
//byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_VolMove0, 2);
//SendData(portName, data);
UpdateBlock(portName, slvAddr, ACCMDManager.Block_VolMove0);
}
else
{
//byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_VolMove1, 2);
//SendData(portName, data);
UpdateBlock(portName, slvAddr, ACCMDManager.Block_VolMove1);
}
//Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
public static void AbsMove(string portName, int slvAddr, int targetPosition, int targetSpeed)
......@@ -390,13 +388,13 @@ namespace OnlineStore.DeviceLibrary
//先更新速度
string slvAddrStr = string.Format(strFromat, slvAddr);
int preSpeed = GetAddrValue(portName, ACCMDManager.Speed_Addr);
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, ACCMDManager.Speed_Addr, targetSpeed);
UpdateAddrValue(portName,slvAddr, ACCMDManager.Speed_Addr, targetSpeed);
}
//绝对运动
AbsMove(portName, slvAddr, targetPosition);
......@@ -442,9 +440,7 @@ namespace OnlineStore.DeviceLibrary
SendData(portName, data);
Thread.Sleep(SleepMSendons);
UpdateBlock(portName, slvAddr, ACCMDManager.Block_AbsMove);
//data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_AbsMove, 2);
//SendData(portName, data);
//Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
}
......
......@@ -260,6 +260,7 @@ namespace OnlineStore.DeviceLibrary
else
{
bean.SendCommand(data, ref returnData, outTime, reviceLength);
System.Threading.Thread.Sleep(2);
}
}
catch (Exception ex)
......@@ -323,6 +324,7 @@ namespace OnlineStore.DeviceLibrary
OnlyOpenSTB(portName, slvAddr);
System.Threading.Thread.Sleep(100);
CloseSTB(portName, slvAddr);
System.Threading.Thread.Sleep(100);
}
public static void OnlyOpenSTB(string portName, int slvAddr)
......@@ -344,13 +346,13 @@ namespace OnlineStore.DeviceLibrary
public static void UpdateBlock(string portName, int slvAddr, string blockNum)
{
int preNum = GetAddrValue(portName, ACCMDManager.BlockNo);
int preNum = GetAddrValue(portName,slvAddr, ACCMDManager.BlockNo);
if (preNum.Equals(-1) || (!preNum.ToString().Equals(blockNum)))
{
byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, blockNum , 2);
SendData(portName, data);
int value = Convert.ToInt16(blockNum);
UpdateAddrValue(portName, ACCMDManager.BlockNo, value);
UpdateAddrValue(portName,slvAddr, ACCMDManager.BlockNo, value);
Thread.Sleep(SleepMSendons);
}
}
......
......@@ -31,75 +31,75 @@ DO,相机照明开,CameraLight_Power,110,192.168.200.10,0,相机照明开,Y11,DO-11,0
,,,113,192.168.200.10,0,,Y14,DO-14,0
DO,门禁功能屏蔽,DisableDoorControl,114,192.168.200.10,0,门禁功能屏蔽,Y15,DO-15,0
,,,115,192.168.200.10,0,,Y16,DO-16,0
AXIS,(轴一)旋转轴,Middle_Axis,1,COM3,0,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM4,0,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM5,0,,,,
PRO,温湿度传感器地址,Temperate_ServerAddress,192.168.200.14,,,,,,
PRO,扫码枪IP,Scanner_Ip,192.168.200.13,,,,,,
PRO,扫码枪端口号,Scanner_Port,51236,,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,423300,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,450000,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,450000,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,423300,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,-200400,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,500,,,,,,
PRO,押金轴(轴4)P1待机原位点,CompressAxis_P1_Position,0,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,1,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,0,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,0,,,,, ,
PRO,设备是否处于调试状态(1=调试,0=正常),IsInDebug,0,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,
PRO,温湿度传感器地址,TemperateServer_Port,9001,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,40,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,2500,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,2500,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,800,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,60,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,500,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,40,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,1500,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,1500,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,40,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,2500,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,2500,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,800,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,800,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,800,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,200,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,800,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,200,,,,,,
PRO,升降轴(轴2)P7速度,UpDownAxis_P7_Speed,200,,,,,,
PRO,升降轴(轴2)P8速度,UpDownAxis_P8_Speed,200,,,,,,
PRO,旋转轴(轴1)P1速度,MiddleAxis_P1_Speed,400,,,,,,
PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,400,,,,,,
PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,150,,,,,,
PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,150,,,,,,
PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,150,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,
AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,
PRO,温湿度传感器地址,Temperate_ServerAddress,192.168.200.14,,,,,,,,
PRO,扫码枪IP,Scanner_Ip,192.168.200.13,,,,,,,,
PRO,扫码枪端口号,Scanner_Port,51236,,,,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,423300,,,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,450000,,,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,450000,,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,423300,,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,-199999,,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,500,,,,,,,,
PRO,押金轴(轴4)P1待机原位点,CompressAxis_P1_Position,0,,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,1,,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,0,,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,0,,,,, ,,,
PRO,设备是否处于调试状态(1=调试,0=正常),IsInDebug,0,,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,,
PRO,温湿度传感器地址,TemperateServer_Port,9001,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,40,,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,2500,,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,2500,,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,800,,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,60,,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,500,,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,40,,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,1500,,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,1500,,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,40,,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,2500,,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,2500,,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,800,,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,800,,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,800,,,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,200,,,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,800,,,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,200,,,,,,,,
PRO,升降轴(轴2)P7速度,UpDownAxis_P7_Speed,200,,,,,, ,,
PRO,升降轴(轴2)P8速度,UpDownAxis_P8_Speed,200,,,,,,,,
PRO,旋转轴(轴1)P1速度,MiddleAxis_P1_Speed,400,,,,,,,,
PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,400,,,,,,,,
PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,150,,,,,,,,
PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,150,,,,,,,,
PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,150,,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,, ,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,10000,,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,,
位置,优先级,高度,宽度,料仓ID,中轴位置P2,升降轴库位出料前点P5,升降轴库位出料缓冲点P6,升降轴库位入料前点P3,升降轴库位入料缓冲点P4,进出轴库位点取料点P3,压紧轴压紧点P2,压紧轴压紧前点P3,进出轴进料口取料点P2
1#AC1_1_1_1,,120,350,1,-200400,423600,436400,436400,423600,-106050,0,0,-109000
1#AC1_1_1_2,,120,350,1,-200400,570000,600000,600000,570000,-106050,0,0,-109000
1#AC1_1_1_3,,120,350,1,-200400,570000,600000,600000,570000,-106050,0,0,-109000
1#AC1_1_1_4,,190,350,1,-200400,570000,600000,600000,570000,-106050,0,0,-109000
1#AC1_1_1_5,,190,350,1,-200400,570000,600000,600000,570000,-106050,0,0,-109000
,,,350,,,,,,,,0,0,-109000
1#AC1_2_1_1,,120,350,1,-135095,52800,72800,72800,52800,-106050,0,0,-109000
1#AC1_2_1_2,,120,350,1,-135095,100800,120800,120800,100800,-106050,0,0,-109000
1#AC1_2_1_3,,120,350,1,-135095,148800,168800,168800,148800,-106050,0,0,-109000
1#AC1_2_1_4,,120,350,1,-135095,196800,216800,216800,196800,-106050,0,0,-109000
1#AC1_2_1_5,,120,350,1,-135095,244800,264800,264800,244800,-106050,0,0,-109000
1#AC1_2_2_1,,120,350,1,-135095,292800,312800,312800,292800,-106050,0,0,-109000
1#AC1_2_2_2,,120,350,1,-135095,340800,360800,360800,340800,-106050,0,0,-109000
1#AC1_2_2_3,,120,350,1,-135095,388800,408800,408800,388800,-106050,0,0,-109000
1#AC1_2_2_4,,120,350,1,-135095,436800,456800,456800,436800,-106050,0,0,-109000
1#AC1_2_2_5,,120,350,1,-135095,553200,541600,547400,524200,-106050,0,0,-109000
1#AC1_2_3_1,,190,350,1,-135095,423600,436400,436400,423600,-106050,0,0,-109000
1#AC1_2_3_2,,120,350,1,-135095,353600,366400,366400,353600,-106050,0,0,-109000
1#AC1_2_3_3,,120,350,1,-135095,283600,296400,296400,283600,-106050,0,0,-109000
1#AC1_2_3_4,,120,350,1,-135095,213600,226400,226400,213600,-106050,0,0,-109000
1#AC1_2_3_5,,120,350,,-135095,143600,156400,156400,143600,-106050,0,0,-109000
1#AC1_2_3_6,,120,350,1,-135095,73600,86400,86400,73600,-106050,0,0,-109000
1#AC1_2_3_7,,120,350,1,-135095,3600,16400,16400,3600,-106050,0,0,-109000
,,,350,,,,,,,-106050,0,0,-109000
1#AC1_3_1_1,,120,350,1,-69790,148800,168800,168800,148800,-106050,0,0,-109000
1#AC1_3_1_2,,120,350,1,-69790,196800,216800,216800,196800,-106050,0,0,-109000
1#AC1_3_1_3,,120,350,1,-69790,244800,264800,264800,244800,-106050,0,0,-109000
1#AC1_3_1_4,,120,350,1,-69790,292800,312800,312800,292800,-106050,0,0,-109000
1#AC1_3_1_5,,120,350,1,-69790,340800,360800,360800,340800,-106050,0,0,-109000
1#AC1_3_2_1,,120,350,1,-69790,388800,408800,408800,388800,-106050,0,0,-109000
1#AC1_3_2_2,,120,350,1,-69790,436800,456800,456800,436800,-106050,0,0,-109000
1#AC1_3_2_3,,120,350,1,-69790,484800,504800,504800,484800,-106050,0,0,-109000
1#AC1_3_2_4,,120,350,1,-69790,532800,552800,552800,532800,-106050,0,0,-109000
1#AC1_3_2_5,,120,350,1,-69790,580800,600800,600800,580800,-106050,0,0,-109000
1#AC1_3_3_1,,190,350,1,-69790,628800,648800,648800,628800,-106050,0,0,-109000
1#AC1_3_3_2,,120,350,1,-69790,676800,696800,696800,676800,-106050,0,0,-109000
1#AC1_3_3_3,,120,350,1,-69790,724800,744800,744800,724800,-106050,0,0,-109000
1#AC1_3_3_4,,120,350,,-69790,,,,,-106050,0,0,-109000
1#AC1_3_3_5,,120,350,1,-69790,52800,72800,72800,52800,-106050,0,0,-109000
1#AC1_3_3_6,,120,350,,-69790,,,,,-106050,0,0,-109000
1#AC1_3_3_7,,120,350,1,-69790,100800,120800,120800,100800,-106050,0,0,-109000
,,,350,,,,,,,-106050,0,0,-109000
1#AC1_4_1_1,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_1_2,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_1_3,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_1_4,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_1_5,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_2_1,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_2_2,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_2_3,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_2_4,,120,350,1,-4485,,,,,-106050,0,0,-109000
1#AC1_4_2_5,19,120,350,1,-4485,553200,541600,547400,524200,-106050,0,0,-109000
1#AC1_4_3_1,20,190,350,1,-4485,423600,436400,436400,423600,-106050,0,0,-109000
1#AC1_4_3_2,21,120,350,1,-4485,353600,366400,366400,353600,-106050,0,0,-109000
1#AC1_4_3_3,22,120,350,1,-4485,283600,296400,296400,283600,-106050,0,0,-109000
1#AC1_4_3_4,23,120,350,1,-4485,213600,226400,226400,213600,-106050,0,0,-109000
1#AC1_4_3_5,24,120,350,1,-4485,143600,156400,156400,143600,-106050,0,0,-109000
1#AC1_4_3_6,25,120,350,1,-4485,73600,86400,86400,73600,-106050,0,0,-109000
1#AC1_4_3_7,26,120,350,1,-4485,3600,16400,16400,3600,-106050,0,0,-109000
,,,350,,,,,,,-106050,0,0,-109000
1#AC1_5_1_1,,120,350,1,-331010,148800,168800,168800,148800,-106050,0,0,-109000
1#AC1_5_1_2,,120,350,1,-331010,196800,216800,216800,196800,-106050,0,0,-109000
1#AC1_5_1_3,,120,350,1,-331010,244800,264800,264800,244800,-106050,0,0,-109000
1#AC1_5_1_4,,120,350,1,-331010,292800,312800,312800,292800,-106050,0,0,-109000
1#AC1_5_1_5,,120,350,1,-331010,340800,360800,360800,340800,-106050,0,0,-109000
1#AC1_5_2_1,,120,350,1,-331010,388800,408800,408800,388800,-106050,0,0,-109000
1#AC1_5_2_2,,120,350,1,-331010,436800,456800,456800,436800,-106050,0,0,-109000
1#AC1_5_2_3,,120,350,1,-331010,484800,504800,504800,484800,-106050,0,0,-109000
1#AC1_5_2_4,,120,350,1,-331010,532800,552800,552800,532800,-106050,0,0,-109000
1#AC1_5_2_5,,120,350,1,-331010,580800,600800,600800,580800,-106050,0,0,-109000
1#AC1_5_3_1,,190,350,1,-331010,423600,436400,436400,423600,-106050,0,0,-109000
1#AC1_5_3_2,,120,350,1,-331010,353600,366400,366400,353600,-106050,0,0,-109000
1#AC1_5_3_3,,120,350,1,-331010,283600,296400,296400,283600,-106050,0,0,-109000
1#AC1_5_3_4,,120,350,,-331010,213600,226400,226400,213600,-106050,0,0,-109000
1#AC1_5_3_5,,120,350,1,-331010,143600,156400,156400,143600,-106050,0,0,-109000
1#AC1_5_3_6,,120,350,1,-331010,73600,86400,86400,73600,-106050,0,0,-109000
1#AC1_5_3_7,,120,350,1,-331010,3600,16400,16400,3600,-106050,0,0,-109000
,,,350,,,,,,,-106050,0,0,-109000
1#AC1_6_1_1,,120,350,1,-265705,148800,168800,168800,148800,-106050,0,0,-109000
1#AC1_6_1_2,,120,350,1,-265705,196800,216800,216800,196800,-106050,0,0,-109000
1#AC1_6_1_3,,120,350,1,-265705,244800,264800,264800,244800,-106050,0,0,-109000
1#AC1_6_1_4,,120,350,1,-265705,292800,312800,312800,292800,-106050,0,0,-109000
1#AC1_6_1_5,,120,350,1,-265705,340800,360800,360800,340800,-106050,0,0,-109000
1#AC1_6_2_1,,120,350,1,-265705,388800,408800,408800,388800,-106050,0,0,-109000
1#AC1_6_2_2,,120,350,1,-265705,436800,456800,456800,436800,-106050,0,0,-109000
1#AC1_6_2_3,,120,350,1,-265705,484800,504800,504800,484800,-106050,0,0,-109000
1#AC1_6_2_4,,120,350,1,-265705,532800,552800,552800,532800,-106050,0,0,-109000
1#AC1_6_2_5,,120,350,1,-265705,580800,600800,600800,580800,-106050,0,0,-109000
1#AC1_6_3_1,,190,350,1,-265705,423600,436400,436400,423600,-106050,0,0,-109000
1#AC1_6_3_2,,120,350,1,-265705,353600,366400,366400,353600,-106050,0,0,-109000
1#AC1_6_3_3,,120,350,1,-265705,283600,296400,296400,283600,-106050,0,0,-109000
1#AC1_6_3_4,,120,350,,-265705,213600,226400,226400,213600,-106050,0,0,-109000
1#AC1_6_3_5,,120,350,1,-265705,143600,156400,156400,143600,-106050,0,0,-109000
1#AC1_6_3_6,,120,350,1,-265705,73600,86400,86400,73600,-106050,0,0,-109000
1#AC1_6_3_7,,120,350,1,-265705,3600,16400,16400,3600,-106050,0,0,-109000
1#AC1_1_1_1,84,190,350,1,-200400,805000,817674,817674,805000,-106050,0,0,-109000
1#AC1_1_1_2,83,190,350,1,-200400,915909,928501,928501,915909,-106050,0,0,-109000
1#AC1_1_1_3,82,120,350,1,-200400,1021736,1034328,1034328,1021736,-106050,0,0,-109000
1#AC1_1_1_4,81,120,350,1,-200400,1091180,1103772,1103772,1091180,-106050,0,0,-109000
1#AC1_2_1_1,80,120,350,1,-134535,883998,899590,899590,883998,-106050,0,0,-109000
1#AC1_2_1_2,79,120,350,1,-134535,954442,970034,970034,954442,-106050,0,0,-109000
1#AC1_2_1_3,78,120,350,1,-134535,1023886,1039478,1039478,1023886,-106050,0,0,-109000
1#AC1_2_1_4,77,120,350,1,-134535,1093330,1110922,1110922,1093330,-106050,0,0,-109000
1#AC1_2_2_1,76,120,350,1,-134535,530342,547934,547934,530342,-106050,0,0,-109000
1#AC1_2_2_2,75,120,350,1,-134535,599786,617378,617378,599786,-106050,0,0,-109000
1#AC1_2_2_3,74,120,350,1,-134535,669230,686822,686822,669230,-106050,0,0,-109000
1#AC1_2_2_4,73,120,350,1,-134535,738674,756266,756266,738674,-106050,0,0,-109000
1#AC1_2_2_5,72,120,350,1,-134535,808118,825710,825710,808118,-106050,0,0,-109000
1#AC1_2_3_1,71,120,350,1,-134535,-2000,14429,14429,-2000,-106050,0,0,-109000
1#AC1_2_3_2,70,120,350,1,-134535,69281,84873,84873,69281,-106050,0,0,-109000
1#AC1_2_3_3,69,120,350,1,-134535,138725,156317,156317,138725,-106050,0,0,-109000
1#AC1_2_3_4,68,120,350,1,-134535,208169,225761,225761,208169,-106050,0,0,-109000
1#AC1_2_3_5,67,120,350,1,-134535,277613,295205,295205,277613,-106050,0,0,-109000
1#AC1_2_3_6,66,120,350,1,-134535,347057,364649,364649,347057,-106050,0,0,-109000
1#AC1_2_3_7,65,190,350,1,-134535,421501,434093,434093,421501,-106050,0,0,-109000
1#AC1_3_1_1,64,120,350,1,-69890,883998,899590,899590,883998,-106050,0,0,-109000
1#AC1_3_1_2,63,120,350,1,-69890,954442,970034,970034,954442,-106050,0,0,-109000
1#AC1_3_1_3,62,120,350,1,-69890,1023886,1039478,1039478,1023886,-106050,0,0,-109000
1#AC1_3_1_4,61,120,350,1,-69890,1093330,1110922,1110922,1093330,-106050,0,0,-109000
1#AC1_3_2_1,60,120,350,1,-69890,530342,547934,547934,530342,-106050,0,0,-109000
1#AC1_3_2_2,59,120,350,1,-69890,599786,617378,617378,599786,-106050,0,0,-109000
1#AC1_3_2_3,58,120,350,1,-69890,669230,686822,686822,669230,-106050,0,0,-109000
1#AC1_3_2_4,57,120,350,1,-69890,738674,756266,756266,738674,-106050,0,0,-109000
1#AC1_3_2_5,56,120,350,1,-69890,808118,825710,825710,808118,-106050,0,0,-109000
1#AC1_3_3_1,55,120,350,1,-69890,-2000,14429,14429,-2000,-106050,0,0,-109000
1#AC1_3_3_2,54,120,350,1,-69890,69281,84873,84873,69281,-106050,0,0,-109000
1#AC1_3_3_3,53,120,350,1,-69890,138725,156317,156317,138725,-106050,0,0,-109000
1#AC1_3_3_4,52,120,350,1,-69890,208169,225761,225761,208169,-106050,0,0,-109000
1#AC1_3_3_5,51,120,350,1,-69890,277613,295205,295205,277613,-106050,0,0,-109000
1#AC1_3_3_6,50,120,350,1,-69890,347057,364649,364649,347057,-106050,0,0,-109000
1#AC1_3_3_7,49,190,350,1,-69890,421000,434000,434000,421000,-106050,0,0,-109000
1#AC1_4_1_1,48,120,350,1,-4842,883998,899590,899590,883998,-106050,0,0,-109000
1#AC1_4_1_2,47,120,350,1,-4842,954442,970034,970034,954442,-106050,0,0,-109000
1#AC1_4_1_3,46,120,350,1,-4842,1023886,1039478,1039478,1023886,-106050,0,0,-109000
1#AC1_4_1_4,45,120,350,1,-4842,1093330,1110922,1110922,1093330,-106050,0,0,-109000
1#AC1_4_2_1,44,120,350,1,-4842,530342,547934,547934,530342,-106050,0,0,-109000
1#AC1_4_2_2,43,120,350,1,-4842,599786,617378,617378,599786,-106050,0,0,-109000
1#AC1_4_2_3,42,120,350,1,-4842,669230,686822,686822,669230,-106050,0,0,-109000
1#AC1_4_2_4,41,120,350,1,-4842,738674,756266,756266,738674,-106050,0,0,-109000
1#AC1_4_2_5,40,120,350,1,-4842,808118,825710,825710,808118,-106050,0,0,-109000
1#AC1_4_3_1,39,120,350,1,-4842,-2000,14429,14429,-2000,-106050,0,0,-109000
1#AC1_4_3_2,38,120,350,1,-4842,69281,84873,84873,69281,-106050,0,0,-109000
1#AC1_4_3_3,37,120,350,1,-4842,138725,156317,156317,138725,-106050,0,0,-109000
1#AC1_4_3_4,36,120,350,1,-4842,208169,225761,225761,208169,-106050,0,0,-109000
1#AC1_4_3_5,35,120,350,1,-4842,277613,295205,295205,277613,-106050,0,0,-109000
1#AC1_4_3_6,34,120,350,1,-4842,347057,364649,364649,347057,-106050,0,0,-109000
1#AC1_4_3_7,33,190,350,1,-4842,421501,434093,434093,421501,-106050,0,0,-109000
1#AC1_5_1_1,32,120,350,1,-330380,883998,899590,899590,883998,-106050,0,0,-109000
1#AC1_5_1_2,31,120,350,1,-330380,954442,970034,970034,954442,-106050,0,0,-109000
1#AC1_5_1_3,30,120,350,1,-330380,1023886,1039478,1039478,1023886,-106050,0,0,-109000
1#AC1_5_1_4,29,120,350,1,-330380,1093330,1110922,1110922,1093330,-106050,0,0,-109000
1#AC1_5_2_1,28,120,350,1,-330380,530342,547934,547934,530342,-106050,0,0,-109000
1#AC1_5_2_2,27,120,350,1,-330380,599786,617378,617378,599786,-106050,0,0,-109000
1#AC1_5_2_3,26,120,350,1,-330380,669230,686822,686822,669230,-106050,0,0,-109000
1#AC1_5_2_4,25,120,350,1,-330380,738674,756266,756266,738674,-106050,0,0,-109000
1#AC1_5_2_5,24,120,350,1,-330380,808118,825710,825710,808118,-106050,0,0,-109000
1#AC1_5_3_1,23,120,350,1,-330380,-2000,14429,14429,-2000,-106050,0,0,-109000
1#AC1_5_3_2,22,120,350,1,-330380,69281,84873,84873,69281,-106050,0,0,-109000
1#AC1_5_3_3,21,120,350,1,-330380,138725,156317,156317,138725,-106050,0,0,-109000
1#AC1_5_3_4,20,120,350,1,-330380,208169,225761,225761,208169,-106050,0,0,-109000
1#AC1_5_3_5,19,120,350,1,-330380,277613,295205,295205,277613,-106050,0,0,-109000
1#AC1_5_3_6,18,120,350,1,-330380,347057,364649,364649,347057,-106050,0,0,-109000
1#AC1_5_3_7,17,190,350,1,-330380,421501,434093,434093,421501,-106050,0,0,-109000
1#AC1_6_1_1,16,120,350,1,-264207,883998,899590,899590,883998,-106050,0,0,-109000
1#AC1_6_1_2,15,120,350,1,-264207,954442,970034,970034,954442,-106050,0,0,-109000
1#AC1_6_1_3,14,120,350,1,-264207,1023886,1039478,1039478,1023886,-106050,0,0,-109000
1#AC1_6_1_4,13,120,350,1,-264207,1093330,1110922,1110922,1093330,-106050,0,0,-109000
1#AC1_6_2_1,12,120,350,1,-264207,530342,547934,547934,530342,-106050,0,0,-109000
1#AC1_6_2_2,11,120,350,1,-264207,599786,617378,617378,599786,-106050,0,0,-109000
1#AC1_6_2_3,10,120,350,1,-264207,669230,686822,686822,669230,-106050,0,0,-109000
1#AC1_6_2_4,9,120,350,1,-264207,738674,756266,756266,738674,-106050,0,0,-109000
1#AC1_6_2_5,8,120,350,1,-264207,808118,825710,825710,808118,-106050,0,0,-109000
1#AC1_6_3_1,7,120,350,1,-264207,-2000,14429,14429,-2000,-106050,0,0,-109000
1#AC1_6_3_2,6,120,350,1,-264207,69281,84873,84873,69281,-106050,0,0,-109000
1#AC1_6_3_3,5,120,350,1,-264207,138725,156317,156317,138725,-106050,0,0,-109000
1#AC1_6_3_4,4,120,350,1,-264207,208169,225761,225761,208169,-106050,0,0,-109000
1#AC1_6_3_5,3,120,350,1,-264207,277613,295205,295205,277613,-106050,0,0,-109000
1#AC1_6_3_6,2,120,350,1,-264207,347057,364649,364649,347057,-106050,0,0,-109000
1#AC1_6_3_7,1,190,350,1,-264207,421501,434093,434093,421501,-106050,0,0,-109000
......@@ -85,7 +85,9 @@ namespace OnlineStore.DeviceLibrary
//初始化摄像机配置
string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
HDevelopExport.LoadConfig(nameStr,codeStr);
//HDevelopExport.LoadConfig(nameStr,codeStr);
CodeManager.LoadConfig(nameStr, codeStr);
//初始化 //连接设备
KNDManager.ConnectionKND(Config.DIODeviceNameList);
......@@ -300,9 +302,9 @@ namespace OnlineStore.DeviceLibrary
moveAxisList.Add(Config.UpDown_Axis);
moveAxisList.Add(Config.InOut_Axis);
this.AxisAlarmCodeMap = new Dictionary<string , AxisAlarmInfo>();
this.AxisAlarmCodeMap.Add(Config.UpDown_Axis.DeviceName, new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(Config.InOut_Axis.DeviceName, new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(this.Config.Middle_Axis.DeviceName, new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(Config.UpDown_Axis.GetNameStr(), new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(Config.InOut_Axis.GetNameStr(), new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(this.Config.Middle_Axis.GetNameStr(), new AxisAlarmInfo());
}
......@@ -343,10 +345,10 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.HomeMoving;
//启动温湿度服务器
HumitureServer.StartTemperateServer(Config.TemperateServer_Port);
Task.Factory.StartNew(delegate ()
{
HDevelopExport.OpenAllCamera();
});
//Task.Factory.StartNew(delegate ()
//{
// HDevelopExport.OpenAllCamera();
//});
ReturnHome();
StartTime = DateTime.Now;
timersTimer.Enabled = true;
......@@ -421,10 +423,10 @@ namespace OnlineStore.DeviceLibrary
autoNext = false;
}
Task.Factory.StartNew(delegate ()
{
HDevelopExport.OpenAllCamera();
});
//Task.Factory.StartNew(delegate ()
//{
// //HDevelopExport.OpenAllCamera();
//});
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());
......@@ -681,7 +683,7 @@ namespace OnlineStore.DeviceLibrary
foreach (ConfigMoveAxis moveAxis in moveAxisList)
{
string portName = moveAxis.DeviceName;
short slvAddr = moveAxis.GetAxisValue();
int slvAddr = moveAxis.GetAxisValue();
ACServerManager.OpenPort(portName);
Thread.Sleep(50);
//初始化串口
......@@ -807,7 +809,7 @@ namespace OnlineStore.DeviceLibrary
ShuoKeControls.ClosePort();
}
//scanSocket.StopScanner();
HDevelopExport.CloseAllCamera();
//HDevelopExport.CloseAllCamera();
HumitureServer.StopTemperateServer();
LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + span.ToString());
......@@ -1233,9 +1235,9 @@ namespace OnlineStore.DeviceLibrary
foreach (ConfigMoveAxis axisInfo in moveAxisList)
{
short axis = axisInfo.GetAxisValue();
int axis = axisInfo.GetAxisValue();
string deviceName = axisInfo.DeviceName;
AxisAlarmInfo info = AxisAlarmCodeMap[deviceName];
AxisAlarmInfo info = AxisAlarmCodeMap[axisInfo.GetNameStr()];
int alarmIo = ACServerManager.GetAlarmStatus(deviceName, axis);
......@@ -1254,7 +1256,7 @@ namespace OnlineStore.DeviceLibrary
info.AlarmIoValue = alarmIo;
}
}
AxisAlarmCodeMap[deviceName] = info;
AxisAlarmCodeMap[axisInfo.GetNameStr()] = info;
}
//判断报警状态
return isInAlarm;
......@@ -1264,7 +1266,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public override void StopMove()
{
HDevelopExport.CloseAllCamera();
//HDevelopExport.CloseAllCamera();
//运动版停止
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
......@@ -1439,11 +1441,16 @@ namespace OnlineStore.DeviceLibrary
KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
string message = "";
List<string> codeList = HDevelopExport.CameraScan();
//List<string> codeList = HDevelopExport.CameraScan();
//foreach (string str in codeList)
//{
// string code = HDevelopExport.SubStrCode(str);
// message = message + code + spiltStr;
//}
List<string> codeList = CodeManager.CameraScan();
foreach (string str in codeList)
{
string code = HDevelopExport.SubStrCode(str);
message = message + code + spiltStr;
message = message + str + spiltStr;
}
KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
onCodeReceived(message);
......
......@@ -25,6 +25,7 @@ namespace OnlineStore.DeviceLibrary
public int autoJiange = 3;
public int autoPositionIndex = 0;
public string autoMsg = "";
public int AutoStartIndex = -1;
#endregion
#region 出入库参数
......@@ -919,10 +920,18 @@ namespace OnlineStore.DeviceLibrary
//}
if (newIndex < 0)
{
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{
newIndex = AutoStartIndex;
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex+"】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,自动 出入库结束!");
}
}
else
{
autoPositionIndex = newIndex;
......@@ -956,10 +965,18 @@ namespace OnlineStore.DeviceLibrary
int newIndex = autoPositionIndex - autoJiange;
if (newIndex < 0)
{
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{
newIndex = AutoStartIndex;
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,自动 出入库结束!");
}
}
else
{
autoPositionIndex = newIndex;
......
using CodeLibrary;
using HalconDotNet;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
public class CodeManager
{
public static List<string> cameraNameList = new List<string>();
public static List<string> codeTypeList = new List<string>();
public static List<string> balserNameList = new List<string>();
public static List<string> hikNameList = new List<string>();
private static char spiltChar = '#';
/// <summary>
/// 初始化摄像机名称和二维码类型
/// </summary>
/// <param name="nameStr">摄像机名称,多个用#分割</param>
/// <param name="codeStr">二维码类型,多个用#分割</param>
public static void LoadConfig(string nameStr, string codeStr)
{
cameraNameList = new List<string>();
codeTypeList = new List<string>();
try
{
string[] nameArray = nameStr.Split(spiltChar);
foreach (string str in nameArray)
{
LogUtil.info("加载到配置摄像机名称:" + str.Trim());
cameraNameList.Add(str.Trim());
}
string[] codeArray = codeStr.Split(spiltChar);
foreach (string str in codeArray)
{
LogUtil.info("加载到二维码类型:" + str.Trim());
codeTypeList.Add(str.Trim());
}
string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
hikNameList.AddRange(names);
names = CodeLibrary.BaslerCamera.Instance.CameraName;
balserNameList.AddRange(names);
CodeLibrary.HDCodeLearnHelper.LoadConfig(nameStr, codeStr);
}
catch (Exception ex)
{
LogUtil.error("解析摄像机配置出错:" + ex.ToString());
}
}
public static Bitmap GetCamerImage(string cameraName)
{
Bitmap bitm = null;
if (balserNameList.Contains(cameraName))
{
BaslerCamera.Instance.Open(cameraName);
BaslerCamera.Instance.GrabOne();
bitm = BaslerCamera.Instance.Image;
BaslerCamera.Instance.Close();
}
else if(hikNameList.Contains(cameraName))
{
HIKCamera.Instance.Open(cameraName);
HIKCamera.Instance.GrabOne();
bitm = HIKCamera.Instance.Image;
HIKCamera.Instance.Close();
}
else
{
LogUtil.info("未找到摄像机【"+cameraName+"】无法获取图片");
}
return bitm;
}
public static List<string> CameraScan( )
{
List<string> codeList = new List<string>();
List<CodeInfo> allCodeList = new List<CodeInfo>();
try
{
foreach (string cameraName in cameraNameList)
{
Bitmap bitmap = GetCamerImage(cameraName);
if (bitmap == null)
{
LogUtil.info(" 摄像机【" + cameraName + "】获取图片失败");
}
else
{
HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType);
}
allCodeList.AddRange(cc);
}
}
}
catch (Exception ex)
{
LogUtil.error("扫码出错:" + ex.ToString());
}
foreach(CodeInfo info in allCodeList)
{
codeList.Add(info.CodeStr);
}
return codeList;
}
public static string GetCodeParamFilePath(string codePath)
{
string appPath = Application.StartupPath;
string path = appPath + ConfigAppSettings.GetValue(Setting_Init.CodeParamPath);
string filePath = path + codePath + ".dcm";
if (File.Exists(filePath))
{
return filePath;
}
else
{
return "";
}
}
}
}
using HalconDotNet;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace OnlineStore.DeviceLibrary
{
public class HDevelopCodeLearn
{
public static HWindow hv_ExpDefaultWinHandle;
public static HTuple hv_AcqHandle = null;
public static void HDevelopStop()
{
//MessageBox.Show("Press button to continue", "Program stop");
}
public static void InitHalcon()
{
// Default settings used in HDevelop
HOperatorSet.SetSystem("width", 512);
HOperatorSet.SetSystem("height", 512);
}
public static void RunHalcon(HWindow Window, string camerName, string codeType, string paramPath, int codeCount)
{
InitHalcon();
hv_ExpDefaultWinHandle = Window;
action(camerName, codeType, paramPath, codeCount);
}
private static bool OpenCamera(string cameraName)
{
try
{ //[1] HD USB Camera
HOperatorSet.OpenFramegrabber("GigEVision", 0, 0, 0, 0, 0, 0, "default", -1,
"default", -1, "false", "default", cameraName, 0, -1, out hv_AcqHandle);
//HOperatorSet.OpenFramegrabber("DirectShow", 1, 1, 0, 0, 0, 0, "default", 8, "rgb",
// -1, "false", "default", "[1] HD USB Camera", 0, -1, out hv_AcqHandle);
return true;
}
catch (Exception ex)
{
LogUtil.error("打开摄像机失败:" + ex.ToString() + ",调用关闭摄像头");
CloseCamera(cameraName);
return false;
}
}
private static void CloseCamera(string cameraName)
{
try
{
HOperatorSet.CloseFramegrabber(hv_AcqHandle);
hv_AcqHandle = null;
}
catch (Exception ex)
{
LogUtil.error("关闭摄像机失败:" + ex.ToString());
}
}
public static bool IsRun = false;
// Main procedure
private static bool action(string cameraName, string codeType, string paramPath, int codeCount)
{
IsRun = true;
IsLearnEnd = false;
IsTestEnd = false;
try
{
HTuple hv_code_type = codeType;
HTuple hv_model_path = paramPath;
HObject ho_Image = null, ho_SymbolXLDs = null;
HTuple hv_train_first = null, /*hv_AcqHandle = null,*/ hv_DataCodeHandle = null;
HTuple hv_ResultHandles = new HTuple(), hv_DecodedDataStrings = new HTuple();
HTuple hv_GenParamNames = new HTuple(), hv_ModelBeforeTraining = new HTuple();
// Initialize local and output iconic variables
HOperatorSet.GenEmptyObj(out ho_Image);
HOperatorSet.GenEmptyObj(out ho_SymbolXLDs);
//Image Acquisition 04: Code generated by Image Acquisition 04
//Image Acquisition 01: Code generated by Image Acquisition 01
//hv_code_type = "Data Matrix ECC 200";
//hv_model_path = ("E:/BaiduNetdiskDownload/" + hv_code_type) + ".dcm";
hv_train_first = 1;
if (!OpenCamera(cameraName))
{
return false ;
}
//HOperatorSet.GrabImageStart(hv_AcqHandle, -1);
HOperatorSet.CreateDataCode2dModel(hv_code_type, new HTuple(), new HTuple(),
out hv_DataCodeHandle);
//set_data_code_2d_param (DataCodeHandle, 'strict_model', 'yes')
//set_data_code_2d_param (DataCodeHandle, 'persistence', 0)
//set_data_code_2d_param (DataCodeHandle, 'polarity', 'light_on_dark')
List<string> findCode = new List<string>();
if ((int)(hv_train_first) != 0)
{
while (findCode.Count < codeCount&&IsLearnEnd.Equals(false ))
{
ho_Image.Dispose();
HOperatorSet.GrabImageAsync(out ho_Image, hv_AcqHandle, -1);
//Image Acquisition 04: Do something
//write_image (Image, 'jpeg', 0, 'E:/BaiduNetdiskDownload/fuba2.jpg')
if (ho_Image != null)
{
ho_SymbolXLDs.Dispose();
HOperatorSet.FindDataCode2d(ho_Image, out ho_SymbolXLDs, hv_DataCodeHandle,
"train", "all", out hv_ResultHandles, out hv_DecodedDataStrings);
if ((int)(new HTuple((new HTuple(hv_DecodedDataStrings.TupleLength())).TupleNotEqual(
0))) != 0)
{
HOperatorSet.QueryDataCode2dParams(hv_DataCodeHandle, "get_model_params",
out hv_GenParamNames);
HOperatorSet.GetDataCode2dParam(hv_DataCodeHandle, hv_GenParamNames, out hv_ModelBeforeTraining);
HDevelopStop();
string[] resultList = hv_DecodedDataStrings.SArr;
foreach (string str in resultList)
{
if (!findCode.Contains(str))
{
LogUtil.info("["+cameraName + "][" + codeType + "]学习【" + str+"】");
findCode.Add(str);
}
}
}
ShowImage(ho_Image,ho_SymbolXLDs);
}
Thread.Sleep(500);
}
//*参数写入文件
LogUtil.info("["+cameraName + "][" + codeType + "]保存参数到文件【" + paramPath+"】");
HOperatorSet.WriteDataCode2dModel(hv_DataCodeHandle, hv_model_path);
HOperatorSet.ClearDataCode2dModel(hv_DataCodeHandle);
}
//Read the previously saved data code model
findCode = new List<string>();
HOperatorSet.ReadDataCode2dModel(hv_model_path, out hv_DataCodeHandle);
while (findCode.Count < codeCount&&IsTestEnd.Equals(false ))
{
ho_Image.Dispose();
HOperatorSet.GrabImageAsync(out ho_Image, hv_AcqHandle, -1);
//Image Acquisition 04: Do something
//write_image (Image, 'jpeg', 0, 'E:/BaiduNetdiskDownload/fuba2.jpg')
if (ho_Image != null)
{
ho_SymbolXLDs.Dispose();
HOperatorSet.FindDataCode2d(ho_Image, out ho_SymbolXLDs, hv_DataCodeHandle,
"stop_after_result_num", 5, out hv_ResultHandles, out hv_DecodedDataStrings);
ShowImage(ho_Image,ho_SymbolXLDs);
if ((int)(new HTuple((new HTuple(hv_DecodedDataStrings.TupleLength())).TupleNotEqual(
0))) != 0)
{
string[] resultList = hv_DecodedDataStrings.SArr;
foreach (string str in resultList)
{
if (!findCode.Contains(str))
{
findCode.Add(str);
LogUtil.info("[" + cameraName + "][" + codeType + "]检测到【" + str + "】");
}
}
}
}
Thread.Sleep(500);
}
HOperatorSet.ClearDataCode2dModel(hv_DataCodeHandle);
CloseCamera(cameraName);
ho_Image.Dispose();
ho_SymbolXLDs.Dispose();
IsRun = false;
return true;
}catch(Exception ex)
{
LogUtil.error("出错了:" + ex.ToString());
CloseCamera(cameraName);
IsRun = false;
return false;
}
}
public static bool IsTestEnd = false;
public static bool IsLearnEnd = false;
public static void StopLearn()
{
IsTestEnd = true;
IsLearnEnd = true;
}
private static int dWidth = 0;
private static int dHeight = 0;
private static void ShowImage(HObject ho_Image,HObject ho_SymbolXLDs)
{
if (dWidth <= 0)
{
HTuple width, height;
//int dWidth = 0; int dHeight = 0;
HOperatorSet.GetImageSize(ho_Image, out width, out height);
dWidth = (int)width.D;
dHeight = (int)height.D;
hv_ExpDefaultWinHandle.SetPart(0, 0, dHeight, dWidth);
}
HOperatorSet.DispObj(ho_Image, hv_ExpDefaultWinHandle);
HOperatorSet.DispObj(ho_SymbolXLDs, hv_ExpDefaultWinHandle);
}
}
}
......@@ -275,7 +275,7 @@ namespace OnlineStore.DeviceLibrary
{
msg = "";
string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue();
int axisNo = moveAxis.GetAxisValue();
//如果是进出轴,并且光栅被遮挡,直接返回false
......@@ -306,7 +306,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
if (StoreMove.CanWhileCount > 0)
{
LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
LogUtil.error(LOGGER, moveAxis.Explain + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + StoreMove.CanWhileCount + "]次");
//LogUtil.error(LOGGER, StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]重新开始运动");
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
......@@ -315,7 +315,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.Explain + "目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警";
LogUtil.error(LOGGER, msg);
return false;
......@@ -327,12 +327,12 @@ namespace OnlineStore.DeviceLibrary
return true;
}
}
else if (errorCount <= moveAxis.CanErrorCountMin)
{
LogUtil.info(LOGGER, " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + ",targetPosition=" + targetPosition + ",当前outCount=" + outCount +
",误差值小于最小误差【" + moveAxis.CanErrorCountMin + "】,默认轴已经停止运动");
return true;
}
//else if (errorCount <= moveAxis.CanErrorCountMin)
//{
// LogUtil.info(LOGGER, " storeMoveStep=" + StoreMove.MoveStep + moveAxis.Explain + ",目标位置[" + targetPosition + "],当前位置[" + outCount +
// "],误差值小于最小误差【" + moveAxis.CanErrorCountMin + "】,默认轴已经停止运动");
// return true;
//}
return false;
}
protected bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis,out string msg)
......@@ -348,14 +348,14 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
if (StoreMove.CanWhileCount > 0)
{
LogUtil.error(LOGGER, moveAxis.DisplayStr + "收到原点完成信号,当前位置["+outCount+ "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次");
LogUtil.error(LOGGER, moveAxis.Explain + "收到原点完成信号,当前位置["+outCount+ "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次");
//LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
StoreMove.CanWhileCount--;
}
else
{
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.Explain + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(LOGGER, msg);
return false;
}
......
......@@ -236,12 +236,12 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 旋转轴返回P1
/// </summary>
BOX_H_MiddleAxisToP1=016,
BOX_H_MiddleAxisToP1 = 016,
/// <summary>
/// 叉子先退回P1
/// </summary>
BOX_M_H_InOutToP1=018,
BOX_M_H_InOutToP1 =018,
/// <summary>
/// 旋转轴回原点
/// </summary>
......
......@@ -129,6 +129,18 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
public int PositionMax { get; set; }
public string GetNameStr()
{
return DeviceName + "_" + GetAxisValue();
}
public bool IsSameAxis(string portName, int slv)
{
if (DeviceName.Equals(portName) && slv.Equals(GetAxisValue()))
{
return true;
}
return false;
}
public bool PositionIsHasLimit(){
if (PositionMin.Equals(PositionMax))
{
......@@ -155,7 +167,7 @@ namespace OnlineStore.LoadCSVLibrary
/// 使用康泰克板卡表示轴编号,使用Ac伺服电机表示伺服地址
/// </summary>
/// <returns></returns>
public short GetAxisValue()
public int GetAxisValue()
{
if (ProVale.Equals("") || ProVale.Equals("-1"))
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!