Commit 5338ca7a 几米阳光

拿走料盘的过程中增加出库处理。

1 个父辈 35b5eb93
......@@ -10,22 +10,22 @@
<add key="Server_Log_Open" value="0" />
<add key="scanner_start_command" value="S" />
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="4" />
<add key="StartBlowValue" value="0.5" />
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<add key="StopBlowValue" value="4" />
<add key="StopBlowValue" value="1" />
<!--Server address-->
<add key="http.server" value="" />
<!--<add key="http.server" value="http://192.168.1.187/myproject/" /> -->
<!--<add key="http.server" value="" />-->
<add key="http.server" value="http://localhost/myproject/" />
<!--storeType-->
<add key="store_count" value="1" />
<!--start one store config-->
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv" />
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv" />
<add key="Store_Type" value="AUTO_SA_Config" />
<add key="Store_CID" value="nanrui1" />
<add key="Store_CID" value="auto1" />
<!--end one store config-->
<!--摄像机名称列表配置,用#分割-->
<add key="CameraName" value="GigE:MV-CE100-30GC (00C69898477)" />
<add key="CameraName" value="GigE:MV-CE100-30GC (00C81915560)#GigE:MV-CE100-30GC (00C81915565)" />
<!--二维码类型列表配置,用#分割-->
<add key="CodeType" value="QR Code" />
<!--<add key="CodeType" value="Data Matrix ECC 200#QR Code"/>-->
......@@ -36,11 +36,11 @@
<!--5000脉冲对应1mm-->
<add key="AxisChangeValue" value="5000" />
<!--压紧轴计量检测信号亮1次的脉冲值-->
<add key="ComAxisChangeValue" value="10000" />
<add key ="DebugPosId" value ="1#AC1_2_1_1"/>
<add key="ComAxisChangeValue" value="20000" />
<add key="DebugPosId" value="1#AC2_2_1_1" />
<!--是否有门禁屏蔽功能,=1表示有此功能-->
<add key ="HasDisableDoorControl" value ="0"/>
<add key ="ACBaudRate" value ="9600"/>
<add key="HasDisableDoorControl" value="1" />
<add key="ACBaudRate" value="9600" />
<add key="Default_Language" value="zh-CN" />
</appSettings>
<log4net>
......
......@@ -130,7 +130,8 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
2.从料仓下方接盘时,压紧轴和升降轴一起运动。
3.吸盘吸料后,等待入库的过程中增加超时报警。
20190314修改:
拿走料盘的过程中增加出库处理。
......
......@@ -190,7 +190,10 @@ namespace OnlineStore.DeviceLibrary
dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
}
public static void SuddenStop(ConfigMoveAxis axis)
{
SuddenStop(axis.DeviceName, axis.GetAxisValue());
}
public static void SuddenStop(string portName, int slvAddr)
{
// RunBlock(7);
......
......@@ -15,7 +15,8 @@ namespace OnlineStore.DeviceLibrary
private static bool IsStop = false;
private static System.Timers.Timer checkTimer = null;
public static bool StartCheck()
private static string TargetIoType = IO_Type.TrayCheck_LoadMaterial;
public static bool StartCheck(string targetIo)
{
if (checkTimer == null)
{
......@@ -24,12 +25,12 @@ namespace OnlineStore.DeviceLibrary
checkTimer.Interval += 50;
checkTimer.Elapsed += CheckTimer_Elapsed;
checkTimer.Enabled = false;
}
}
TargetIoType = targetIo;
checkTimer.Start();
return true;
}
public static bool StopCheck()
{
if (!(checkTimer == null))
......@@ -39,14 +40,14 @@ namespace OnlineStore.DeviceLibrary
return true;
}
private static bool IsInProcess = false;
private static void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
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("批量上料轴,检测到上料机构料盘信号,可以停止运动");
if (KND.IOValue(TargetIoType).Equals(IO_VALUE.HIGH))
{
LogUtil.info("批量上料轴,检测到【" + TargetIoType + "】信号,可以停止运动");
result = true;
}
//else if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
......@@ -61,7 +62,7 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.SuddenStop(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
StopCheck();
}
IsInProcess = false ;
IsInProcess = false;
}
}
}
......@@ -179,9 +179,7 @@ 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);
......@@ -403,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库:SI_06 压紧轴压紧,压紧轴到P2,升降轴稍微下降【" + Config.UpDownAxis_DownValue + "】,目标位置【" + targetPosition + "】 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_CompressWork);
ComMoveToPosition(moveP.ComPress_P2, true);
ACAxisMove(Config.UpDown_Axis, targetPosition, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, targetPosition, Config.UpDownAxis_P4_Speed);
}
else
{
......@@ -832,10 +830,15 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.TimeOutSeconds = 120;
//ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(Config.Batch_Axis, Config.BatchAxis_P1));
BatchAxisController.StartCheck();
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(Config.Batch_Axis, Config.BatchAxis_P1, IO_Type.TrayCheck_LoadMaterial));
BatchAxisController.StartCheck(IO_Type.TrayCheck_LoadMaterial);
Config.Batch_Axis.TargetPosition = Config.BatchAxis_P1;
ACServerManager.AbsMove(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue(), Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
int speed = Config.BatchAxis_P1_Speed;
if (AutomaticBaiting.BatchOutStoreHeight > 0)
{
speed = Config.BatchAxis_P1_Speed / 2;
}
ACServerManager.AbsMove(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue(), Config.BatchAxis_P1, speed);
OutStoreLog("出库:SO_02 批量上下料轴到P1点【"+Config.BatchAxis_P1+"】 ");
}
}
......
......@@ -15,14 +15,14 @@ namespace OnlineStore.DeviceLibrary
private static int StartMovePosition = 0;
private static int EndMovePosition = 0;
//public static int AutoAxisIsMove = 0;
private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, int targetSpeed)
private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, int targetSpeed,string targetSingle)
{
//AutoAxisIsMove = 1;
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
EndMovePosition = StartMovePosition;
LogUtil.debug("当前坐标:"+StartMovePosition+",批量上料轴开始匀速"+targetSpeed+"上升");
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis,0));
BatchAxisController.StartCheck();
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis,0, targetSingle));
BatchAxisController.StartCheck(targetSingle);
ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed);
}
......@@ -119,19 +119,7 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
wait.IsEnd = wait.IoValue.Equals(value);
}
//else if (wait.WaitType == (int)Wait_Type.WaitHeight_7)
//{
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{
wait.IsEnd = BatchAxisIsEnd(wait);
......@@ -239,9 +227,9 @@ namespace OnlineStore.DeviceLibrary
public static bool BatchAxisIsEnd(WaitResultInfo wait)
{
bool result = false;
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{
LogUtil.info(wait.ToStr() + " 检测到上料机构料盘信号,可以停止运动");
if (KND.IOValue(wait.IoType).Equals(IO_VALUE.HIGH))
{
LogUtil.info(wait.ToStr() + " 检测到【" + wait.IoType + "】信号,可以停止运动");
result = true;
}
else if (ACServerManager.GetLimitPositiveSingle(wait.AxisInfo).Equals(1))
......@@ -477,7 +465,7 @@ namespace OnlineStore.DeviceLibrary
map.Add(ParamDefine.closeLock, ParamDefine.disable);
map.Add(ParamDefine.takeOutReel, ParamDefine.disable);
map.Add(ParamDefine.confirmReelOut, ParamDefine.disable);
if (AutomaticBaiting.DoorStatus.Equals(2))
if ( DoorStatus.Equals(2))
{
map.Add(ParamDefine.doorStatus, ResourceControl.GetString(ResourceControl.doorClose, "Door lock close"));
}
......@@ -487,15 +475,15 @@ namespace OnlineStore.DeviceLibrary
}
if (AutomaticBaiting.IsWaitTragGo && (AutomaticBaiting.IsGetTrayGo.Equals(false)))
if ( IsWaitTragGo && ( IsGetTrayGo.Equals(false)))
{
map[ParamDefine.confirmReelOut] = ParamDefine.enable;
}
else if (AutomaticBaiting.CanOpenBatchDoor())
else if ( CanOpenBatchDoor())
{
if (AutomaticBaiting.DoorStatus.Equals(2))
if ( DoorStatus.Equals(2))
{
if (AutomaticBaiting.BatchOutStoreCount > 0)
if ( BatchOutStoreCount > 0)
{
map[ParamDefine.takeOutReel] = ParamDefine.enable;
}
......@@ -515,10 +503,10 @@ namespace OnlineStore.DeviceLibrary
public static string doOpenDoor()
{
if (AutomaticBaiting.CanOpenBatchDoor())
if ( CanOpenBatchDoor())
{
AutomaticBaiting.BatchDoorOpen(false);
AutomaticBaiting.IsNeedStartInout = false;
BatchDoorOpen(false);
IsNeedStartInout = false;
return "";
}
else
......@@ -528,28 +516,29 @@ namespace OnlineStore.DeviceLibrary
}
public static string doStartBatchIn()
{
if (!AutomaticBaiting.DoorIsClose())
if (! DoorIsClose())
{
return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device");
return ResourceControl.GetString(ResourceControl.batchInError, "Batch storing Error: Close feeding device");
}
if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
return ResourceControl.GetString(ResourceControl.batchInError2, "Batch storing Error: gripper full, check before restoring");
}
AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset(false,true);
}
StopOutProcess();
BatchDoorClose(false);
Reset(false,true);
return "";
}
public static string doTakeReel()
public static string doTakeReel()
{
if (AutomaticBaiting.CanOpenBatchDoor())
if (CanOpenBatchDoor())
{
if (AutomaticBaiting.BatchOutStoreCount > 0 && AutomaticBaiting.BatchOutStoreHeight > 0)
if (BatchOutStoreCount > 0 && BatchOutStoreHeight > 0)
{
AutomaticBaiting.BatchDoorOpen(false);
return "";
BatchDoorOpen(false);
return StartOut();
//return "";
}
else
{
......@@ -559,23 +548,27 @@ namespace OnlineStore.DeviceLibrary
else
{
return (ResourceControl.GetString(ResourceControl.GetError2, "Providing Error: BUSY, open doorlock failure"));
}
}
}
public static string doCloseDoor()
{
if (!AutomaticBaiting.DoorIsClose())
if (! DoorIsClose())
{
return (ResourceControl.GetString(ResourceControl.CloseError, "Door lock Error: Close feeding device"));
return (ResourceControl.GetString(ResourceControl.CloseError, "Door lock Error: Close feeding device"));
}
AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset(false,false);
StopOutProcess();
BatchDoorClose(false);
Reset(false,false);
return "";
}
public static bool doConfirmReelGo()
{
LogUtil.info(ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually"));
AutomaticBaiting.IsWaitTragGo = false;
AutomaticBaiting.IsGetTrayGo = true;
IsWaitTragGo = false;
IsGetTrayGo = true;
return true;
}
}
......
......@@ -488,30 +488,29 @@ namespace OnlineStore.DeviceLibrary
#endregion
//#region 自动上下料出料功能
///// <summary>
///// 吸盘吸走料盘,同时上料轴开始上升
///// </summary>
//AUTO_O01_SuckingDisc_Work,
///// <summary>
///// 等待1秒后吸盘下降
///// </summary>
//AUTO_O02_WaitTimeDown,
#region 自动上下料出料功能
AUTO_O00_Wait=1300,
/// <summary>
/// 等待门锁打开
/// </summary>
AUTO_O01_WaitDoorOpen =1301,
/// <summary>
/// 等待出料检测信号关闭
/// </summary>
AUTO_O02_WaitOutSingleLow=1302,
/// <summary>
/// 向上运动,等待DI12亮或者极限亮停止
/// </summary>
AUTO_O03_SpeedMove=1303,
/// <summary>
/// 极限亮,返回P2点
/// </summary>
AUTO_O05_BackToP2=1304,
#endregion
///// <summary>
///// 吸盘下降
///// </summary>
//AUTO_O03_SuckingDisc_Down,
///// <summary>
///// 放下料盘
///// </summary>
//AUTO_O04_PutTrayDown,
///// <summary>
///// 吸盘上升
///// </summary>
//AUTO_O05_SuckingDisc_Up,
//#endregion
}
public enum StoreAlarmType
......
......@@ -277,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
/// 10=等待批量上下料轴运动 停止
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis,int targetPosition)
public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis,int targetPosition,string targetIoType)
{
WaitResultInfo wait = new WaitResultInfo();
wait.TargetPosition = targetPosition;
......@@ -286,6 +286,7 @@ namespace OnlineStore.DeviceLibrary
wait.WaitType = (int)Wait_Type.BatchAxisMove_10;
wait.IsHomeMove = true;
wait.IsEnd = false;
wait.IoType = targetIoType;
return wait;
}
/// <summary>
......@@ -434,8 +435,7 @@ namespace OnlineStore.DeviceLibrary
/// 高度
/// </summary>
public int HeightValue { get; set; }
}
public enum Wait_Type
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!