Commit f2affbe0 几米阳光

批量上料轴增加单独处理。增加版本号。

1 个父辈 f21554bd
......@@ -13,6 +13,33 @@ namespace OnlineStore.AutoInOutStore
{
public partial class FrmBase : Form
{
public static string GetVersion()
{
string str = "";
string version = "";
DateTime newData = DateTime.Parse("2000-01-01");
try
{
version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
string[] strArray = version.Split('.');
if (strArray.Length.Equals(4))
{
int days = Convert.ToInt32(strArray[2]);
int seconds = Convert.ToInt32(strArray[3]);
DateTime d1 = DateTime.Parse("2000-01-01");
newData = d1.AddDays(days);
newData = newData.AddSeconds(seconds * 2);
str = newData.ToString("yyyy-MM-dd HH:mm:ss");
}
}
catch (Exception ex)
{
str = version;
LogUtil.error("解析版本号【" + str + "】出错:" + ex.ToString());
}
LogUtil.info("版本号[" + version + "][" + str + "]");
return str;
}
public FrmBase()
{
InitializeComponent();
......
......@@ -147,7 +147,7 @@ namespace OnlineStore.AutoInOutStore
private bool LoadOk = false;
private void FrmTest_Load(object sender, EventArgs e)
{
GetVersion();
LogUtil.logBox = this.richTextBox1;
this.ShowInTaskbar = true;
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
......
......@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
......@@ -109,6 +109,12 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
20190111修改
1.波特率改为可配置模式。
2.松下伺服通信改为兼容模式。
3.批量上料轴上升过程中,新建一个线程用来验证是否需要停止。
......
......@@ -67,6 +67,7 @@
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="PanasonicServo\BatchAxisController.cs" />
<Compile Include="ShuoKe\MeteringSignalBean.cs" />
<Compile Include="ShuoKe\ShuoKeController.cs" />
<Compile Include="store\LineMoveP.cs" />
......
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 批量上下料 轴,检测料盘检测信号处理
/// </summary>
public class BatchAxisController
{
private static bool IsStop = false;
private static System.Timers.Timer checkTimer = null;
public static bool StartCheck()
{
if (checkTimer == null)
{
checkTimer = new System.Timers.Timer();
checkTimer.AutoReset = true;
checkTimer.Interval += 50;
checkTimer.Elapsed += CheckTimer_Elapsed;
}
checkTimer.Start();
return true;
}
public static bool StopCheck()
{
if (!(checkTimer == null))
{
checkTimer.Stop();
}
return true;
}
private static bool IsInProcess = false;
private static void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (IsInProcess) { return; }
IsInProcess = true;
bool result = false;
if (KND.IOValue(LoadCSVLibrary.IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{
LogUtil.info("批量上料轴,检测到上料机构料盘信号,可以停止运动");
result = true;
}
else if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
{
LogUtil.info("批量上料轴,检测到正极限信号,可以停止运动");
result = true;
}
if (result)
{
//AutoAxisIsMove = 0;
LogUtil.debug("批量上料轴, 停止运动");
ACServerManager.SuddenStop(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
StopCheck();
}
IsInProcess = true;
}
}
}
......@@ -1216,6 +1216,7 @@ namespace OnlineStore.DeviceLibrary
}
public override void StopMove(bool IsCloseAxis)
{
BatchAxisController.StopCheck();
AxisSuddenStop();
if (IsHasCompress_Axis)
{
......@@ -1237,11 +1238,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "StopMove");
KND.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
AutomaticBaiting.StopMove();
MeteringSignal.StopCheck();
isInPro = false;
AutomaticBaiting.StopMove();
MeteringSignal.StopCheck();
isInPro = false;
}
......
......@@ -139,11 +139,6 @@ namespace OnlineStore.DeviceLibrary
{
wait.IsEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
}
if (!wait.IsEnd && (Config.Batch_Axis.IsSameAxis(wait.AxisInfo.DeviceName,wait.AxisInfo.GetAxisValue())) && wait.TargetPosition.Equals(Config.BatchAxis_P1))
{
wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait);
}
if (!msg.Equals(""))
{
isOk = false;
......@@ -183,6 +178,29 @@ namespace OnlineStore.DeviceLibrary
{
wait.IsEnd = AutomaticBaiting.IsGetTrayGo;
}
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{
//if ((Config.Batch_Axis.IsSameAxis(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue())) && wait.TargetPosition.Equals(Config.BatchAxis_P1))
//{
if (!wait.IsEnd)
{
wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait);
}
if (!wait.IsEnd)
{
bool MoveEnd = ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0);
int outCount = ACServerManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
int errorCount = Math.Abs(outCount - wait.TargetPosition);
if (MoveEnd && errorCount < wait.AxisInfo.CanErrorCountMax)
{
wait.IsEnd = true;
}
}
if (wait.IsEnd)
{
BatchAxisController.StopCheck();
}
}
else if (wait.WaitType == (int)Wait_Type.ShuoKe_5)
{
string msg = "";
......@@ -211,9 +229,9 @@ namespace OnlineStore.DeviceLibrary
StoreMove.EndStepWait();
}
else if (span.TotalSeconds > StoreMove.TimeOutSeconds)
{
{
WarnMsg = "[" + StoreMove.MoveStep + "]等待[" + NotOkMsg + "]超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 15);
LogUtil.error(WarnMsg, 15);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, StoreMove.MoveType);
}
}
......@@ -803,7 +821,11 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW))
{
StoreMove.TimeOutSeconds = 120;
ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
//ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(Config.Batch_Axis, Config.BatchAxis_P1));
BatchAxisController.StartCheck();
Config.Batch_Axis.TargetPosition = Config.BatchAxis_P1;
ACServerManager.AbsMove(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue(), Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
OutStoreLog("出库:SO_02 批量上下料轴到P1点【"+Config.BatchAxis_P1+"】 ");
}
}
......
......@@ -113,7 +113,8 @@ namespace OnlineStore.DeviceLibrary
ClearOutStoreInfo();
}
public static void StopMove()
{
{
BatchAxisController.StopCheck();
StoreMove.EndMove();
ClearInStoreInfo();
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
......
......@@ -19,8 +19,9 @@ namespace OnlineStore.DeviceLibrary
//AutoAxisIsMove = 1;
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
EndMovePosition = StartMovePosition;
LogUtil.info("当前坐标:"+StartMovePosition+",批量上料轴开始匀速"+targetSpeed+"上升");
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis));
LogUtil.info("当前坐标:"+StartMovePosition+",批量上料轴开始匀速"+targetSpeed+"上升");
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis,0));
BatchAxisController.StartCheck();
ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed);
}
......@@ -133,6 +134,10 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{
wait.IsEnd = BatchAxisIsEnd(wait);
if (wait.IsEnd)
{
BatchAxisController.StopCheck();
}
}
else if (wait.WaitType == (int)Wait_Type.ScanCode_11)
{
......@@ -235,17 +240,13 @@ namespace OnlineStore.DeviceLibrary
bool result = false;
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{
LogUtil.info(wait.ToStr()+"检测到上料机构料盘信号,可以停止运动");
LogUtil.info(wait.ToStr() + "检测到上料机构料盘信号,可以停止运动");
result = true;
}
else
else if (ACServerManager.GetLimitPositiveSingle(wait.AxisInfo).Equals(1))
{
int limitP=ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
if (limitP.Equals(1))
{
LogUtil.info(wait.ToStr() + "检测到正极限信号,可以停止运动");
result = true;
}
LogUtil.info(wait.ToStr() + "检测到正极限信号,可以停止运动");
result = true;
}
if (result)
{
......
......@@ -277,9 +277,10 @@ namespace OnlineStore.DeviceLibrary
/// 10=等待批量上下料轴运动 停止
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis)
public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis,int targetPosition)
{
WaitResultInfo wait = new WaitResultInfo();
wait.TargetPosition = targetPosition;
wait.CanWhileMoveCount = 0;
wait.AxisInfo = moveAxis;
wait.WaitType = (int)Wait_Type.BatchAxisMove_10;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!