Commit aa170659 刘韬

优化批量轴逻辑,发货前版本

1 个父辈 9ecc8e31
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<conversionPattern value="[%date][%t] %m%n" /> <conversionPattern value="[%date][%t] %m%n" />
</layout> </layout>
</appender> </appender>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender1">
<level value="ALL" /> <level value="ALL" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
</logger> </logger>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<level value="ALL" /> <level value="ALL" />
<appender-ref ref="AIOBOX" /> <appender-ref ref="AIOBOX" />
</logger> </logger>
<logger name="HCBOARD"> <logger name="HCBOARD" additivity="false">
<level value="ALL" /> <level value="ALL" />
<appender-ref ref="HCBOARD" /> <appender-ref ref="HCBOARD" />
</logger> </logger>
......
...@@ -38,8 +38,9 @@ ...@@ -38,8 +38,9 @@
<ApplicationIcon>box.ico</ApplicationIcon> <ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary, Version=1.0.7635.28877, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="halcondotnet"> <Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath> <HintPath>..\..\dll\halcondotnet.dll</HintPath>
...@@ -48,8 +49,9 @@ ...@@ -48,8 +49,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath> <HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\dll\log4net.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -135,5 +135,17 @@ namespace OnlineStore.AutoInOutStore ...@@ -135,5 +135,17 @@ namespace OnlineStore.AutoInOutStore
LanguageProcess(); LanguageProcess();
} }
} }
protected override void OnPaint(PaintEventArgs e)
{
try
{
base.OnPaint(e);
}
catch
{
Invalidate();
}
}
} }
} }
...@@ -19,7 +19,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -19,7 +19,7 @@ namespace OnlineStore.AutoInOutStore
{ {
public class ResourceCulture public class ResourceCulture
{ {
public static bool ShowLog = true ; public static bool ShowLog = false ;
public static string China = "zh-CN"; public static string China = "zh-CN";
public static string English = "en-US"; public static string English = "en-US";
public static string German = "ge-DE"; public static string German = "ge-DE";
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace> <RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName> <AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath> <HintPath>..\..\..\增广夹爪\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
......
...@@ -75,7 +75,7 @@ namespace OnlineStore.Common ...@@ -75,7 +75,7 @@ namespace OnlineStore.Common
/// <summary> /// <summary>
/// 是否是代码运行,不需要连接设备 /// 是否是代码运行,不需要连接设备
/// </summary> /// </summary>
public static string CodeRun = "CodeRun"; //public static string CodeRun = "CodeRun";
public static string ComAxisChangeValue = "ComAxisChangeValue"; public static string ComAxisChangeValue = "ComAxisChangeValue";
...@@ -96,7 +96,7 @@ namespace OnlineStore.Common ...@@ -96,7 +96,7 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public static string SinglePosId = "SinglePosId"; public static string SinglePosId = "SinglePosId";
public static string DeCodeType = "DeCodeType"; //public static string DeCodeType = "DeCodeType";
public static string LibNameType = "LibNameType"; public static string LibNameType = "LibNameType";
public static string DefaultPWD = "DefaultPWD"; public static string DefaultPWD = "DefaultPWD";
......
...@@ -5,20 +5,22 @@ using System.Text; ...@@ -5,20 +5,22 @@ using System.Text;
using log4net; using log4net;
using System.Reflection; using System.Reflection;
using System.Drawing; using System.Drawing;
using System.Threading;
namespace OnlineStore.Common namespace OnlineStore.Common
{ {
public class LogUtil public class LogUtil
{ {
private static LogUtil instance = new LogUtil(); private static LogUtil instance = new LogUtil();
public delegate void ShowLog(string msg, Color color); public delegate void ShowLog(string msg, Color color);
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog AIOLog = LogManager.GetLogger("AIOBOX"); // public static readonly ILog AIOLog = LogManager.GetLogger("AIOBOX");
public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>(); public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null; public static System.Windows.Forms.RichTextBox logBox = null;
public static event ShowLog showLogEvent;
public static int showCount = 100; public static int showCount = 100;
public static bool debug_opened = false; public static bool debug_opened = false;
...@@ -30,7 +32,8 @@ namespace OnlineStore.Common ...@@ -30,7 +32,8 @@ namespace OnlineStore.Common
return; return;
} }
log.Info( " - " + msg); log.Info( " - " + msg);
showLogEvent?.Invoke(msg,Color.Black);
if (logBox == null) if (logBox == null)
{ {
return; return;
...@@ -112,14 +115,17 @@ namespace OnlineStore.Common ...@@ -112,14 +115,17 @@ namespace OnlineStore.Common
} }
private static void AddToBox(string msg, Color color) private static void AddToBox(string msg, Color color)
{ {
try try
{ {
ShowLogPro(msg);
} ShowLogPro(msg);
catch (Exception ex)
{ }
LOGGER.Error("出错:" + ex.StackTrace); catch (Exception ex)
} {
LOGGER.Error("出错:" + ex.StackTrace);
}
} }
private static int count = 0; private static int count = 0;
private static void ShowLogPro(string msg ) private static void ShowLogPro(string msg )
...@@ -165,7 +171,10 @@ namespace OnlineStore.Common ...@@ -165,7 +171,10 @@ namespace OnlineStore.Common
public static void info(string msg) public static void info(string msg)
{ {
info(LOGGER,msg ); info(LOGGER,msg );
} }
public static void info_noshow(string msg)
{
LOGGER.Info(" - " + msg);
}
} }
} }
...@@ -40,8 +40,9 @@ ...@@ -40,8 +40,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath> <HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference> </Reference>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary, Version=1.0.7635.28877, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="halcondotnet"> <Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath> <HintPath>..\..\dll\halcondotnet.dll</HintPath>
...@@ -49,9 +50,9 @@ ...@@ -49,9 +50,9 @@
<Reference Include="HuichuanLibrary"> <Reference Include="HuichuanLibrary">
<HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath> <HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath> <HintPath>..\..\..\增广夹爪\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -11,12 +11,13 @@ using System.Windows.Forms; ...@@ -11,12 +11,13 @@ using System.Windows.Forms;
using CodeLibrary; using CodeLibrary;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
public class CodeManager public class CodeManager
{ {
public static int DeCodeType = ConfigAppSettings.GetIntValue(Setting_Init.DeCodeType); //public static int DeCodeType = ConfigAppSettings.GetIntValue(Setting_Init.DeCodeType);
private static int QRCodeCount = ConfigAppSettings.GetIntValue(Setting_Init.QRCodeCount); private static int QRCodeCount = ConfigAppSettings.GetIntValue(Setting_Init.QRCodeCount);
public static List<string> cameraNameList = new List<string>(); public static List<string> cameraNameList = new List<string>();
...@@ -141,74 +142,111 @@ namespace OnlineStore.DeviceLibrary ...@@ -141,74 +142,111 @@ namespace OnlineStore.DeviceLibrary
{ {
return codeList; return codeList;
} }
try try
{ {
foreach (string cameraName in cameraNameList) //Task[] cameraTask = new Task[cameraNameList.Count()];
for(int i= 0;i < cameraNameList.Count();i++)
{ {
if (cameraName.Trim().Equals(""))
{ var cameraName = cameraNameList[i];
continue; //cameraTask[i] = Task.Run(() =>
} //{
DateTime startTime = DateTime.Now; if (cameraName.Trim().Equals(""))
LogUtil.info( " 【" + cameraName + "】开始取图片");
HalconDotNet.HObject ho_Image = null;
try
{
ho_Image = Camera._cam.CaptureOnImage(cameraName);
if (ho_Image == null)
{ {
LogUtil.error( " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName);
continue; continue;
} }
LogUtil.info( " 【" + cameraName + "】取图片完成,开始扫码"); DateTime startTime = DateTime.Now;
List<CodeInfo> cc = new List<CodeInfo>(); LogUtil.info(" 【" + cameraName + "】开始取图片");
string r = ""; HalconDotNet.HObject ho_Image = null;
foreach (string codeType in codeTypeList) Bitmap bmp = null;
try
{ {
//判断是否是一维码 bool nohalcon = true;
if (codeType.ToLower().Equals("barcode")) ho_Image = Camera._cam.CaptureOnImage(cameraName, out bmp, nohalcon);
if (ho_Image == null && !nohalcon)
{ {
cc = HDCodeHelper.DecodeBarCode(ho_Image); LogUtil.error(" 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName);
continue;
} }
else LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码");
string r = "";
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp);
foreach (CodeInfo code in tlci)
{ {
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000); LogUtil.info(" 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
string str = CodeManager.ReplaceCode(code.CodeStr);
lock (codeList)
{
if (!codeList.Contains(str))
{
codeList.Add(str);
r = r + "##" + str;
}
}
} }
foreach (CodeInfo c in cc)
/*
* List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{ {
string str = CodeManager.ReplaceCode(c.CodeStr); //判断是否是一维码
if (!codeList.Contains(str)) if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000);
}
foreach (CodeInfo c in cc)
{ {
codeList.Add(str); string str = CodeManager.ReplaceCode(c.CodeStr);
r = r + "##" + str; lock (codeList)
{
if (!codeList.Contains(str))
{
codeList.Add(str);
r = r + "##" + str;
}
}
} }
} }
*/
if (codeList.Count()==0)
{
SaveImageToFile("mimo", cameraName, bmp);
}
LogUtil.info(" 【" + cameraName + "】" + " 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r);
} }
if (String.IsNullOrEmpty(r)) catch (AccessViolationException e)
{ {
// SaveImageToFile(deviceName, cameraName, bit); LogUtil.error(" 扫码出现AccessViolationException异常,关闭相机【" + cameraName + "】:" + e.ToString());
Camera._cam.Close(cameraName);
// GC.Collect();
} }
LogUtil.info(" 【" + cameraName + "】" + " 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r); catch (Exception ex)
}
catch (AccessViolationException e)
{
LogUtil.error( " 扫码出现AccessViolationException异常,关闭相机【" + cameraName + "】:" + e.ToString());
Camera._cam.Close(cameraName);
// GC.Collect();
}
catch (Exception ex)
{
LogUtil.error( " 扫码出错:" + ex.ToString());
}
finally
{
if (ho_Image != null)
{ {
ho_Image.Dispose(); LogUtil.error(" 扫码出错:" + ex.ToString());
} }
} finally
{
if (ho_Image != null)
{
ho_Image.Dispose();
}
if (bmp != null)
bmp.Dispose();
}
// });
//cameraTask[i].Wait();
} }
//Task.WaitAll(cameraTask);
} }
catch (AccessViolationException e) catch (AccessViolationException e)
{ {
...@@ -234,6 +272,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -234,6 +272,7 @@ namespace OnlineStore.DeviceLibrary
Directory.CreateDirectory(dire); Directory.CreateDirectory(dire);
} }
bit.Save(dire + iamgeName, ImageFormat.Bmp); bit.Save(dire + iamgeName, ImageFormat.Bmp);
bit.Dispose();
LogUtil.info(deviceName + " 【" + cameraName + "】扫码失败,保存图片到【" + dire + iamgeName + "】成功"); LogUtil.info(deviceName + " 【" + cameraName + "】扫码失败,保存图片到【" + dire + iamgeName + "】成功");
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -52,9 +52,9 @@ AXIS,(轴五)批量上下料轴,Batch_Axis,4,HC,0,,,,, ...@@ -52,9 +52,9 @@ AXIS,(轴五)批量上下料轴,Batch_Axis,4,HC,0,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,3473,,,,,,, PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,3473,,,,,,,
PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,2276,,,,,,, PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,2276,,,,,,,
PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,2113,,,,,,, PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,2073,,,,,,,
PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,100,,,,,,, PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,100,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#3926;12#3884;16#3840;20#3800;24#3759;,,,,,,, PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#3926;12#3884;16#3840;20#3800;24#3789;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,3060,,,,,,, PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,3060,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,100,,,,,,, PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,100,,,,,,,
PRO,压紧轴(轴四)P1待机原位点,CompressAxis_P1_Position,7000,,,,,,, PRO,压紧轴(轴四)P1待机原位点,CompressAxis_P1_Position,7000,,,,,,,
...@@ -68,15 +68,15 @@ PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,180,,,,,,, ...@@ -68,15 +68,15 @@ PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,180,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,, PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,, PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,100,,,,,,, PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,800,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,400,,,,,,, PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,2400,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,400,,,,,,, PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,2400,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,90,,,,,,, PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,100,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,100,,,,,,, PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,100,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,500,,,,,,, PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,500,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,400,,,,,,, PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,2000,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,1200,,,,,,, PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,6000,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,1200,,,,,,, PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,6000,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,20,,,,,,, PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,250,,,,,,, PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,250,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,3000,,,,,,, PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,3000,,,,,,,
...@@ -96,9 +96,9 @@ PRO,升降轴(轴二)到仓门P7速度,UpDownAxis_P7_Speed,2000,,,,,,, ...@@ -96,9 +96,9 @@ PRO,升降轴(轴二)到仓门P7速度,UpDownAxis_P7_Speed,2000,,,,,,,
PRO,升降轴(轴二)P8速度,UpDownAxis_P8_Speed,100,,,,,,, PRO,升降轴(轴二)P8速度,UpDownAxis_P8_Speed,100,,,,,,,
PRO,旋转轴(轴一)P1速度,MiddleAxis_P1_Speed,800,,,,,,, PRO,旋转轴(轴一)P1速度,MiddleAxis_P1_Speed,800,,,,,,,
PRO,旋转轴(轴一)P2速度,MiddleAxis_P2_Speed,800,,,,,,, PRO,旋转轴(轴一)P2速度,MiddleAxis_P2_Speed,800,,,,,,,
PRO,进出轴(轴三)P1速度,InOutAxis_P1_Speed,1200,,,,,,, PRO,进出轴(轴三)P1速度,InOutAxis_P1_Speed,1600,,,,,,,
PRO,进出轴(轴三)P2速度,InOutAxis_P2_Speed,1600,,,,,,, PRO,进出轴(轴三)P2速度,InOutAxis_P2_Speed,1800,,,,,,,
PRO,进出轴(轴三)P3速度,InOutAxis_P3_Speed,1600,,,,,, , PRO,进出轴(轴三)P3速度,InOutAxis_P3_Speed,1800,,,,,, ,
PRO,(轴一)旋转轴最小误差脉冲值,MiddleAxis_ErrorCountMin,5,,,,,,, PRO,(轴一)旋转轴最小误差脉冲值,MiddleAxis_ErrorCountMin,5,,,,,,,
PRO,(轴二)升降轴轴最小误差脉冲值,UpdownAxis_ErrorCountMin,5,,,,,,, PRO,(轴二)升降轴轴最小误差脉冲值,UpdownAxis_ErrorCountMin,5,,,,,,,
PRO,(轴三)进出轴最小误差脉冲值,InoutAxis_ErrorCountMin,5,,,,,,, PRO,(轴三)进出轴最小误差脉冲值,InoutAxis_ErrorCountMin,5,,,,,,,
...@@ -106,7 +106,7 @@ PRO,(轴一)旋转轴最大误差脉冲值,MiddleAxis_ErrorCountMax,20,,,,,,, ...@@ -106,7 +106,7 @@ PRO,(轴一)旋转轴最大误差脉冲值,MiddleAxis_ErrorCountMax,20,,,,,,,
PRO,(轴二)升降轴轴最大误差脉冲值,UpdownAxis_ErrorCountMax,20,,,,,,, PRO,(轴二)升降轴轴最大误差脉冲值,UpdownAxis_ErrorCountMax,20,,,,,,,
PRO,(轴三)进出轴最大误差脉冲值,InoutAxis_ErrorCountMax,20,,,,,,, PRO,(轴三)进出轴最大误差脉冲值,InoutAxis_ErrorCountMax,20,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,, PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,, , PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,500,,,,,, ,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,, PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,1,,,,,,, PRO,是否使用料盘检测信号,IsUse_Tray_Check,1,,,,,,,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,, PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
...@@ -123,8 +123,8 @@ PRO,温湿度端口号,Humiture_Port,COM5,,,,,,, ...@@ -123,8 +123,8 @@ PRO,温湿度端口号,Humiture_Port,COM5,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,20000,,,,,,, PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,13000,,,,,,,
PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,10000,,,,,,, PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,8000,,,,,,,
PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,60000,,,,,,, PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,60000,,,,,,,
PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,60000,,,,,,, PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,60000,,,,,,,
PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20000,,,,,,, PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20000,,,,,,,
...@@ -132,17 +132,17 @@ PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,30000,,,,,,, ...@@ -132,17 +132,17 @@ PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,30000,,,,,,,
PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,90000,,,,,, , PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,90000,,,,,, ,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,290669,,,,,, , PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,290669,,,,,, ,
PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,3000,,,,,,, PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,3000,,,,,,,
PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,15000,,,,,,, PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,20000,,,,,,,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,100,,,,,,, PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,100,,,,,,,
PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,, PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,, PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,, PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,10,,,,,,, PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,40,,,,,,,
PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,3000,,,,,,, PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,3000,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,20000,,,,,,, PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,22000,,,,,,,
PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,, PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,,
PRO,最后一盘料需要补充的高度,LastTrayAddHeight,7,,,,,,, PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,
PRO,(轴五)上料轴P3点(上料目标位置),BatchAxis_P3,362062,,,,,,, PRO,(轴五)上料轴P3点(上料目标位置),BatchAxis_P3,362262,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,(轴二)升降轴单盘入库抬升料盘的高度,UpdownAxis_UpPosition,100,,,,,,, PRO,(轴二)升降轴单盘入库抬升料盘的高度,UpdownAxis_UpPosition,100,,,,,,,
PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,100,,,,,,, PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,100,,,,,,,
...@@ -153,7 +153,7 @@ PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,25000,,,,,,, ...@@ -153,7 +153,7 @@ PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,25000,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,3000,,,,,,, PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,3000,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,5000,,,,,,, PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,5000,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,10000,,,,,,, PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,10000,,,,,,,
PRO,(轴四)压紧轴P1速度,CompAxis_P1_Speed,3000,,,,,,, PRO,(轴四)压紧轴P1速度,CompAxis_P1_Speed,5000,,,,,,,
PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,7500,,,,,,, PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,8500,,,,,,,
PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,7500,,,,,,, PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,8500,,,,,,,
PRO,特殊二维码尺寸配置,CodeSizeConfig,T;PartNum;1=330x81,,,,,,, PRO,特殊二维码尺寸配置,CodeSizeConfig,T;PartNum;1=330x81,,,,,,,
...@@ -76,8 +76,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -76,8 +76,8 @@ namespace OnlineStore.DeviceLibrary
AutomaticBaiting.Init(); AutomaticBaiting.Init();
IOManager.Init(); IOManager.Init();
//初始化 //连接设备 //初始化 //连接设备
if (ConfigAppSettings.GetIntValue(Setting_Init.CodeRun).Equals(1)) { } //if (ConfigAppSettings.GetIntValue(Setting_Init.CodeRun).Equals(1)) { }
else //else
{ {
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
......
...@@ -890,22 +890,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -890,22 +890,26 @@ namespace OnlineStore.DeviceLibrary
int outDownPosition = StoreMove.MoveParam.MoveP.BatchAxis_DownValue; int outDownPosition = StoreMove.MoveParam.MoveP.BatchAxis_DownValue;
if (StoreMove.IsBatchInOutStore) if (StoreMove.IsBatchInOutStore)
{ //如果料盘检测信号不亮,不需要下降这么多 {
//如果料盘检测信号不亮,不需要下降这么多
//判断是否在P1点 //判断是否在P1点
int acPosition = ACServerManager.GetActualtPosition(Config.Batch_Axis); int acPosition = ACServerManager.GetActualtPosition(Config.Batch_Axis);
bool isIn = Math.Abs(acPosition - Config.BatchAxis_P1) < Config.Batch_Axis.CanErrorCountMax; bool isIn = Math.Abs(acPosition - Config.BatchAxis_P1) < Config.Batch_Axis.CanErrorCountMax;
if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW) && outDownPosition > Config.BatchAxis_OutDownPosition && isIn) if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW) && outDownPosition > Config.BatchAxis_OutDownPosition && isIn)
{ {
outDownPosition = outDownPosition - Config.BatchAxis_OutDownPosition; //outDownPosition = outDownPosition - Config.BatchAxis_OutDownPosition;
LogUtil.info_noshow($"判断是否在P1点:outDownPosition:{outDownPosition}");
} }
//如果检测信号亮,需要多下降 //如果检测信号亮,需要多下降
if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
outDownPosition = outDownPosition + Config.BatchAxis_DownPosition2; outDownPosition = outDownPosition + Config.BatchAxis_DownPosition2;
LogUtil.info_noshow($"如果检测信号亮,需要多下降:outDownPosition:{outDownPosition}");
} }
//上下料机构下降的距离=料盘最低高度+默认的高度 //上下料机构下降的距离=料盘最低高度+默认的高度
targetValue = GetBatchTargetValue(outDownPosition); targetValue = GetBatchTargetValue(outDownPosition);
if (targetValue >= 1000) if (targetValue >= Config.BatchAxis_P2)
{ {
BatchNeedMove = true; BatchNeedMove = true;
} }
...@@ -1097,7 +1101,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1097,7 +1101,7 @@ namespace OnlineStore.DeviceLibrary
//如果可以直接下降,则不需要匀速上升 //如果可以直接下降,则不需要匀速上升
int targetValue = GetBatchTargetValue(StoreMove.MoveParam.MoveP.BatchAxis_DownValue); int targetValue = GetBatchTargetValue(StoreMove.MoveParam.MoveP.BatchAxis_DownValue);
if (targetValue >= 300000) if (targetValue >= 290600)
{ {
OutStoreLog("出库:SO_02 批量上下料轴直接下降后目标位置【" + targetValue + "】不需要匀速上升 "); OutStoreLog("出库:SO_02 批量上下料轴直接下降后目标位置【" + targetValue + "】不需要匀速上升 ");
} }
...@@ -1125,7 +1129,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1125,7 +1129,6 @@ namespace OnlineStore.DeviceLibrary
//第二盘以后的料,若信号亮,先下降到信号不亮 //第二盘以后的料,若信号亮,先下降到信号不亮
//信号不亮,批量轴下降指定的位置 //信号不亮,批量轴下降指定的位置
} }
} }
private int GetBatchTargetValue(int downValue) private int GetBatchTargetValue(int downValue)
......
...@@ -408,6 +408,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -408,6 +408,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog(" 批量轴匀速上升【" + StoreManager.Config.BatchAxis_SlowSpeed + "】"); InStoreLog(" 批量轴匀速上升【" + StoreManager.Config.BatchAxis_SlowSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial);
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true); CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
if (StoreManager.Config.Default_TrayWidth.Equals(7)) if (StoreManager.Config.Default_TrayWidth.Equals(7))
{ {
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck1, IO_VALUE.HIGH)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck1, IO_VALUE.HIGH));
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace> <RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName> <AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath> <HintPath>..\..\..\增广夹爪\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!