Commit 7daf9d25 jimi

1

1 个父辈 598a720a
......@@ -30,7 +30,7 @@
<!--<add key="CodeType" value="Data Matrix ECC 200"/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" />
<add key ="InOutDefaultPosition" value ="3000"/>
<add key ="InOutDefaultPosition" value ="10000"/>
<add key ="Config_Pwd" value ="123456"/>
<!--5000脉冲对应1mm-->
<add key ="AxisChangeValue" value ="5000"/>
......
......@@ -1573,35 +1573,26 @@ namespace OnlineStore.AutoInOutStore
}
private void btnBatchInStore_Click(object sender, EventArgs e)
{
//if (AutomaticBaiting.DoorStatus.Equals(2))
//{
// MessageBox.Show("请先关闭批量上下料门");
// return;
//}
if (!AutomaticBaiting.DoorIsClose())
{
MessageBox.Show("请先关闭批量上下料门");
return;
}
AutomaticBaiting.IsNeedStartInout = true;
AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset();
AutomaticBaiting.Reset(true);
}
private void btnStartBatchInStore_Click(object sender, EventArgs e)
{
//if (AutomaticBaiting.DoorStatus.Equals(1))
//{
// MessageBox.Show("请先关闭批量上下料门");
// return;
//}
if (!AutomaticBaiting.DoorIsClose())
{
MessageBox.Show("请先关闭批量上下料门");
return;
}
AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset();
AutomaticBaiting.Reset(false );
}
private void btnGetOutTray_Click(object sender, EventArgs e)
......@@ -1625,11 +1616,7 @@ namespace OnlineStore.AutoInOutStore
private void btnBatchOutEnd_Click(object sender, EventArgs e)
{
if ( AutomaticBaiting.DoorStatus.Equals(1))
{
MessageBox.Show("请先关闭批量上下料门");
return;
}
if (!AutomaticBaiting.DoorIsClose())
{
MessageBox.Show("请先关闭批量上下料门");
......@@ -1637,7 +1624,7 @@ namespace OnlineStore.AutoInOutStore
}
AutomaticBaiting.BatchDoorClose(false);
bool result = AutomaticBaiting.Reset();
bool result = AutomaticBaiting.Reset(false );
}
private void btnTempInit_Click(object sender, EventArgs e)
......
......@@ -31,6 +31,22 @@
20181210
光栅:光栅不用实时获取,开关门之前判断光栅就可以
批量上料开始按钮没有锁门
批量上料模块报警,出入库不影响
轴在原点的时候再次原点返回需要反向走相对量。
上料过程中报警了,复位后又开始自动上料
压紧轴原点返回之前,先相对走-2000;
......
......@@ -358,9 +358,8 @@ namespace OnlineStore.Common
if (_serialPort.IsOpen)
{
if (Monitor.TryEnter(lockObj, 10))
if (Monitor.TryEnter(lockObj, 5))
{
//Monitor.Enter(lockObj);
try
{
_serialPort.DiscardInBuffer(); //清空接收缓冲区
......@@ -373,7 +372,7 @@ namespace OnlineStore.Common
}
while (num++ < Overtime)
{
if (_serialPort.BytesToRead >= ReceiveData.Length)
if (_serialPort.BytesToRead >= ReceiveLength)
break;
System.Threading.Thread.Sleep(1);
}
......@@ -381,10 +380,10 @@ namespace OnlineStore.Common
{
LogUtil.error(PortName + " 发送数据" + ByteToString(SendData) + "等待接受数据超时");
}
if (_serialPort.BytesToRead >= ReceiveData.Length)
if (_serialPort.BytesToRead >= ReceiveLength)
{
ret = _serialPort.Read(ReceiveData, 0, ReceiveData.Length);
ret = _serialPort.Read(ReceiveData, 0, ReceiveLength);
}
else
{
......
......@@ -40,7 +40,7 @@
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>C:\Program Files\MVTec\HALCON-12.0\bin\dotnet35\halcondotnet.dll</HintPath>
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......
......@@ -294,25 +294,42 @@ namespace OnlineStore.DeviceLibrary
public static void HomeMove(string portName, int slvAddr, int speed)
{
//byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_HomeMove1, 2);
//SendData(portName, data);
//旋转轴回正方向,其他轴回负方向
//if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName))
//{
// UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
// LogUtil.info("旋转轴原点返回方向:正方向");
//}
//else if (portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
//{
// UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
// LogUtil.info("进出轴原点返回方向:正方向");
//}
//else
//{
try
{
//先判断是否在原点,如果已经在原点,先向正方向走2000
int homeSingle = GetHomeSingle(portName, slvAddr);
if (homeSingle.Equals(1))
{
int value = 2000;
if (portName.Equals(StoreManager.Config.Batch_Axis.DeviceName))
{
value = 8000;
}
LogUtil.info("轴【" + portName + "】原点返回时发现原点已亮,需要先相对走" + value);
RelMove(portName, slvAddr, value);
bool isStop = false;
for (int i = 0; i <= 10; i++)
{
Thread.Sleep(200);
if (GetBusyStatus(portName, slvAddr).Equals(0))
{
isStop = true;
LogUtil.info("轴【" + portName + "】 相对走" + value + "已结束");
break;
}
}
if (!isStop)
{
LogUtil.info("轴【" + portName + "】 相对走" + value + "已等待2分钟,直接停止");
SuddenStop(portName, slvAddr);
}
}
}catch(Exception ex)
{
LogUtil.error("轴【" + portName + "】原点返回前验证是否在原点出错:" + ex.StackTrace);
}
//默认负方向原点返回
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove1);
//}
Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
......
......@@ -480,7 +480,7 @@ namespace OnlineStore.DeviceLibrary
PreReadCoilAddr = ACCMDManager.BUSYStatus;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.BUSYStatus, "0000", 1);
//SendData(portName,dataArray);
byte[] reviceData = SendCommand(portName, dataArray, 100, 6);
byte[] reviceData = SendCommand(portName, dataArray, 80, 6);
return GetCoilData(portName, reviceData, ACCMDManager.BUSYStatus);
}
......@@ -489,7 +489,7 @@ namespace OnlineStore.DeviceLibrary
PreReadCoilAddr = ACCMDManager.HOME_CMP_Status;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.HOME_CMP_Status, "0000", 1);
//SendData(portName,dataArray);
byte[] reviceData = SendCommand(portName, dataArray, 100, 6);
byte[] reviceData = SendCommand(portName, dataArray, 80, 6);
return GetCoilData(portName, reviceData, ACCMDManager.HOME_CMP_Status);
}
......@@ -497,7 +497,7 @@ namespace OnlineStore.DeviceLibrary
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Home_Single, "0000", 1);
byte[] reviceData = SendCommand(portName, dataArray, 100, 6);
byte[] reviceData = SendCommand(portName, dataArray, 50, 6);
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
/// <summary>
......@@ -507,7 +507,7 @@ namespace OnlineStore.DeviceLibrary
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Limit_Negative_Single, "0000", 1);
byte[] reviceData = SendCommand(portName, dataArray, 100, 6);
byte[] reviceData = SendCommand(portName, dataArray, 50, 6);
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
/// <summary>
......@@ -531,7 +531,7 @@ namespace OnlineStore.DeviceLibrary
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Limit_Positive_Single, "0000", 1);
byte[] reviceData = SendCommand(portName, dataArray, 100, 6);
byte[] reviceData = SendCommand(portName, dataArray, 50, 6);
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
}
......
......@@ -45,17 +45,17 @@ AXIS,(轴三)进出轴,InOut_Axis,1,COM5,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM6,0,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,355007,,,,,,,
PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,355000,,,,,,,
PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,355002,,,,,,,
PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,350008,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#355001;12#350001;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,260000,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#403400;12#350000;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,263200,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,-40000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,-10000,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
PRO,设备是否调试状态(1=调试,0=正常),IsInDebug,0,,,,,,,
PRO,设备是否调试状态(1=调试,0=正常),IsInDebug,1,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
......@@ -78,7 +78,7 @@ PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,30,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,20,,,,,,,
,,,,,,,,,,
PRO,升降轴(轴二)到仓门速度,UpDownAxis_Door_Speed,50,,,,,,,
PRO,升降轴(轴二)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴二)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴二)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
......@@ -112,33 +112,34 @@ PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,, ,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,默认的料盘宽度(不可更改),Default_TrayWidth,7,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM2,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,50000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,30000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)原点返回速度,CompressAxis_HomeSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,10000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)原点返回速度,CompressAxis_HomeSpeed,6000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,, ,
,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,200,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,300,,,,,,,
PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,300,,,,,,,
PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,300,,,,,,,
PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,1730000,,,,,, ,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,1500000,,,,,, ,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10,,,,,,,
PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,200,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,300,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,IO模块对应的DI数量,IO_DILength,192.168.200.11#16;192.168.200.12#4,,,,,, ,
PRO,模块对应的DO数量,IO_DOLength,192.168.200.11#16;192.168.200.12#4,,,,,,,
PRO,IO模块对应的DI数量,IO_DILength,192.168.202.11#16;192.168.200.12#4,,,,,, ,
PRO,模块对应的DO数量,IO_DOLength,192.168.202.11#16;192.168.200.12#4,,,,,,,
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
DI,急停,SuddenStop_BTN,200,192.168.200.11,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,201,192.168.200.11,0,复位,X02,DI-02,0,
DI,自动启动,AutoRun_Single,202,192.168.200.11,0,自动启动,X03,DI-03,0,
DI,安全光栅,SafetyLightCurtains,203,192.168.200.11,0,安全光栅,X04,DI-04,0,
DI,进料口门上升端,Door_Up,204,192.168.200.11,0,进料口门上升端,X05,DI-05,0,
DI,进料口门下降端,Door_Down,205,192.168.200.11,0,进料口门下降端,X06,DI-06,0,
DI,吸盘气缸上升端,SuckingDisc_Up,206,192.168.200.11,0,吸盘气缸上升端,X07,DI-07,0,
DI,吸盘气缸下降端,SuckingDisc_Down,207,192.168.200.11,0,吸盘气缸下降端,X08,DI-08,0,
DI,料盘宽度检测1,WidthCheck1,208,192.168.200.11,0,料盘宽度检测1,X09,DI-09,0,
DI,料盘宽度检测2,WidthCheck2,209,192.168.200.11,0,料盘宽度检测2,X10,DI-10,0,
DI,料盘检测1(上料机构),TrayCheck_LoadMaterial,210,192.168.200.11,0,料盘检测1(上料机构),X11,DI-11,0,
DI,上料机构出料检测,OutCheck,211,192.168.200.11,0,上料机构出料检测,X12,DI-12,0,
DI,门锁气缸打开端,BatchDoor_Open,212,192.168.200.11,0,门锁气缸打开端,X13,DI-13,0,
DI,门锁气缸关闭端,BatchDoor_Close,213,192.168.200.11,0,门锁气缸关闭端,X14,DI-14,0,
DI,料盘检测2(料叉机构),TrayCheck_Fixture,214,192.168.200.11,0,料盘检测2(料叉机构),X15,DI-15,0,
DI,压紧机构计量检测,CompressAxis_Check,215,192.168.200.11,0,压紧机构计量检测,X16,DI-16,0,
DO,自动指示灯,AutoRun_HddLed,100,192.168.200.11,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,101,192.168.200.11,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,102,192.168.200.11,0,待机指示灯,Y03,DO-03,0,
DO,吹气SOL ON,StartOrStopBlow,103,192.168.200.11,0,吹气SOL ON,Y04,DO-04,0,
DO,料仓运转ON,Run_Sign,104,192.168.200.11,0,料仓运转ON,Y05,DO-05,0,
DO,轴2刹车电源ON,Axis_Brake,105,192.168.200.11,0,轴2刹车电源ON,Y06,DO-06,0,
DO,相机照明开,CameraLight_Power,106,192.168.200.11,0,相机照明开,Y07,DO-07,0,
DO,吸盘吸料SOL,SuckingDisc_Work,107,192.168.200.11,0,吸盘吸料SOL,Y08,DO-08,0,
DO,进料口门上升SOL,Door_Up,108,192.168.200.11,0,进料口门上升SOL,Y09,DO-09,0,
DO,进料口门下降SOL,Door_Down,109,192.168.200.11,0,进料口门下降SOL,Y10,DO-10,0,
DO,吸盘气缸上升SOL,SuckingDisc_Up,110,192.168.200.11,0,吸盘气缸上升SOL,Y11,DO-11,0,
DO,吸盘气缸下降SOL,SuckingDisc_Down,111,192.168.200.11,0,吸盘气缸下降SOL,Y12,DO-12,0,
DO,门锁气缸打开SOL,BatchDoor_Open,112,192.168.200.11,0,门锁气缸打开SOL,Y13,DO-13,0,
DO,门锁气缸关闭SOL,BatchDoor_Close,113,192.168.200.11,0,门锁气缸关闭SOL,Y14,DO-14,0,
,,,114,192.168.200.11,0,,Y15,DO-15,0,
,,,115,192.168.200.11,0,,Y16,DO-16,0,
DI,上料机构门关闭,DoorClose_LoadMaterial,200,192.168.200.12,0,上料机构门关闭,X21,DI-21,0,
DI,气压检测,Airpressure_Check,201,192.168.200.12,0,气压检测,X22,DI-22,0,
DI,吸盘压力确认信号,SuckingDisc_Air,202,192.168.200.12,0,吸盘压力确认信号,X23,DI-23,0,
DI,左侧门关闭,DoorColse_Single,203,192.168.200.12,0,左侧门关闭,X24,DI-24,0,
,,,100,192.168.200.12,0,,Y17,DO-21,0,
,,,101,192.168.200.12,0,,Y18,DO-22,0,
,,,102,192.168.200.12,0,,Y19,DO-23,0,
,,,103,192.168.200.12,0,,Y20,DO-24,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM3,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM4,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM5,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM6,0,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,355000,,,,,,,
PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,355002,,,,,,,
PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,350008,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#403400;12#350000;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,263200,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,-10000,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
PRO,设备是否调试状态(1=调试,0=正常),IsInDebug,1,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,100,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,80,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,80,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,50,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,150,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,40,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,40,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,10,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,20,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,20,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,100,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,30,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,30,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,20,,,,,,,
PRO,升降轴(轴二)到仓门速度,UpDownAxis_Door_Speed,50,,,,,,,
PRO,升降轴(轴二)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴二)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴二)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
PRO,升降轴(轴二)P4速度,UpDownAxis_P4_Speed,150,,,,,,,
PRO,升降轴(轴二)P5速度,UpDownAxis_P5_Speed,250,,,,,,,
PRO,升降轴(轴二)P6速度,UpDownAxis_P6_Speed,100,,,,,,,
PRO,升降轴(轴二)到仓门P7速度,UpDownAxis_P7_Speed,100,,,,,,,
PRO,升降轴(轴二)P8速度,UpDownAxis_P8_Speed,100,,,,,,,
PRO,旋转轴(轴一)P1速度,MiddleAxis_P1_Speed,120,,,,,,,
PRO,旋转轴(轴一)P2速度,MiddleAxis_P2_Speed,120,,,,,,,
PRO,进出轴(轴三)P1速度,InOutAxis_P1_Speed,100,,,,,,,
PRO,进出轴(轴三)P2速度,InOutAxis_P2_Speed,100,,,,,,,
PRO,进出轴(轴三)P3速度,InOutAxis_P3_Speed,100,,,,,,,
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,,,,,,,
PRO,默认的料盘宽度(不可更改),Default_TrayWidth,7,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM2,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,10000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)原点返回速度,CompressAxis_HomeSpeed,6000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,, ,
,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,300,,,,,,,
PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,300,,,,,,,
PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,300,,,,,,,
PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,1500000,,,,,, ,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10,,,,,,,
PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,300,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,IO模块对应的DI数量,IO_DILength,192.168.202.11#16;192.168.200.12#4,,,,,, ,
PRO,模块对应的DO数量,IO_DOLength,192.168.202.11#16;192.168.200.12#4,,,,,,,
位置,优先级,高度,宽度,料仓ID,中轴位置P2,升降轴库位出料前点P5,升降轴库位出料缓冲点P6,升降轴库位入料前点P3,升降轴库位入料缓冲点P4,进出轴库位点取料点P3,压紧轴压紧点P2,压紧轴压紧前点P3,进出轴仓门取料点P2,进出轴吸盘取料点P2
1#AC1_1_1_4,774,8,7,1,211783,51884,55245,55245,51884,68000,-110000,-75000,5000,5000
1#AC1_1_1_5,773,12,7,1,211783,67807,71168,71168,67807,68000,-110000,-75000,5000,5000
1#AC1_1_1_4,774,8,7,1,80750,407400,415100,415100,407400,73000,-22000,-10000,83600,5000
1#AC1_1_1_5,773,12,7,s,211783,67807,71168,71168,67807,5000,-110000,-75000,5000,5000
1#AC1_1_1_6,772,8,7,,211783,83730,87091,87091,83730,68000,-110000,-75000,81000,81000
1#AC1_1_1_7,771,8,7,,211783,99653,103014,103014,99653,68000,-110000,-75000,81000,81000
1#AC1_1_1_8,770,8,7,,211783,115576,118937,118937,115576,68000,-110000,-75000,81000,81000
......
using HalconDotNet;

using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
......@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
else
{
//光栅处理
SafetyLightProcess();
//SafetyLightProcess();
}
}
}
......@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
}
if (UseBatchInout)
{
AutomaticBaiting.Reset();
AutomaticBaiting.Reset(false );
}
//TODO 启动时先所有轴远点返回,测试暂时关闭
storeRunStatus = StoreRunStatus.HomeMoving;
......@@ -231,10 +231,10 @@ namespace OnlineStore.DeviceLibrary
//压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1
StoreMove.NewMove(StoreMoveType.StoreReset);
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_InOutToP1);
LogUtil.info(LOGGER, StoreName + "到待机状态,进出轴到P1,判断叉子没有料盘");
LogUtil.info(LOGGER, StoreName + "到待机状态,进出轴到P1,压紧轴先相对走-2000");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
ComBeforeHomeMove();
ResetCloseDoor();
}
public override void Reset()
{
......@@ -285,7 +285,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_LocationCylinderBack);
LocationDownAndWait();
}
AutomaticBaiting.Reset();
AutomaticBaiting.Reset(false );
isInPro = false;
}
private void InoutStartReset()
......@@ -300,6 +300,7 @@ namespace OnlineStore.DeviceLibrary
int currPos = ACServerManager.GetActualtPosition(portName, slvAddr);
int targetPos = currPos - 5000;
ACAxisMove(Config.InOut_Axis, targetPos, Config.InoutAxis_HomeLowSpeed);
ResetCloseDoor();
}
else
{
......@@ -307,6 +308,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "复位中,进出轴开始原点返回");
ACAxisHomeMove(Config.InOut_Axis);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
ResetCloseDoor();
}
}
/// <summary>
......@@ -332,16 +334,15 @@ namespace OnlineStore.DeviceLibrary
ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info(LOGGER, StoreName + "复位中:进出轴开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "复位中:进出轴到待机点P1,关闭舱门");
LogUtil.info(LOGGER, StoreName + "复位中:进出轴到待机点P1,压紧轴先相对走-2000");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoorAndWait();
ComBeforeHomeMove();
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_InOutToP1:
//如果此时轴三还在报警,需要提示错误并等待
......@@ -359,6 +360,7 @@ namespace OnlineStore.DeviceLibrary
}
ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis);
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_OtherAxisBack:
......@@ -367,6 +369,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "复位完成");
......@@ -387,8 +390,6 @@ namespace OnlineStore.DeviceLibrary
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, 1, true));
ShuoKeControls.HomeMove(Config.CompressAxis_Slv, 1);
}
//关闭舱门
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_M_H_TOP1_CompressHome:
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1);
......@@ -411,7 +412,17 @@ namespace OnlineStore.DeviceLibrary
default: break;
}
}
private void ComBeforeHomeMove()
{
if (IsHasCompress_Axis)
{
int relValue = -2000;
LogUtil.debug("压紧轴相对位置:" + relValue);
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, relValue, false));
ShuoKeControls.RelativeMove(Config.CompressAxis_Slv, relValue);
Thread.Sleep(100);
}
}
private void ComMoveToPosition(int targetPosition)
{
if (IsHasCompress_Axis)
......@@ -453,6 +464,21 @@ namespace OnlineStore.DeviceLibrary
KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
private void ResetCloseDoor()
{
if (KND.IOValue(IO_Type.Door_Down).Equals(IO_VALUE.HIGH) && KND.IOValue(IO_Type.Door_Up).Equals(IO_VALUE.LOW))
{
return;
}
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Up, IO_VALUE.LOW));
KND.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
}
/// <summary>
/// 原点返回处理
/// </summary>
......@@ -474,16 +500,15 @@ namespace OnlineStore.DeviceLibrary
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴退回P1点,关闭仓门,检测叉子没有料盘");
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴退回P1点,关闭仓门,压紧轴先相对走-2000");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoorAndWait();
ComBeforeHomeMove();
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_InOutToP1:
......@@ -503,6 +528,7 @@ namespace OnlineStore.DeviceLibrary
}
ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis);
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_OtherAxisBack:
......@@ -511,6 +537,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "回原点完成");
......@@ -705,16 +732,14 @@ namespace OnlineStore.DeviceLibrary
}
}
private bool InProcess = false;
//private DateTime preProcessTime = DateTime.Now;
private bool IsChongfu = false;
private Stopwatch stopwatch = new Stopwatch();
//private object TimerLock = "";
protected override void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (InProcess)
{
if (stopwatch.Elapsed.TotalMinutes < 1)
if (stopwatch.Elapsed.TotalMinutes < 2.5)
{
return;
}
......@@ -894,7 +919,6 @@ namespace OnlineStore.DeviceLibrary
else
{
LogUtil.info(LOGGER, "收到复位信号但是已经在" + StoreMove.MoveType + "处理中,且无报警,不处理");
//WarnMsg = "收到复位信号但是已经在" + StoreMove.MoveType + "处理中,且无报警,不处理";
}
}
else
......@@ -914,73 +938,9 @@ namespace OnlineStore.DeviceLibrary
}
}
}
//ShowTimeLog("复位和启动按钮");
////检查运动轴报警
//if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown) )
//{
// ShowTimeLog("开始检测轴报警");
// CheckAxisAlarm();
// ShowTimeLog("轴报警检测完成");
//}
}
private object safetyInProcess = "";
/// <summary>
/// 光栅处理
/// </summary>
private void SafetyLightProcess()
{
if (Monitor.TryEnter(safetyInProcess))
{
try
{
//遮挡光栅信号
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
{
//if (NeedCheckSafetyLight.Equals(1))
//{
// if (StoreMove.MoveType.Equals(StoreMoveType.OutStore) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor))
// {
// NeedCheckSafetyLight = 2;
// LOGGER.Info("出库SO_10_DeviceToDoor运动中,光栅被遮挡,停止进出轴运动");
// ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
// }
// else if (StoreMove.MoveType.Equals(StoreMoveType.InStore) && StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
// {
// NeedCheckSafetyLight = 2;
// LOGGER.Info("入库SI_05_DeviceToDoor运动中,光栅被遮挡,停止进出轴运动");
// ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
// }
//}
}
else
{
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveType.Equals(StoreMoveType.OutStore) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor))
// {
// LOGGER.Info("出库SO_10_DeviceToDoor运动中,光栅已恢复,继续进出轴运动");
// SO_10_DeviceToDoorPro();
// }
// else if (StoreMove.MoveType.Equals(StoreMoveType.InStore) && StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
// {
// LOGGER.Info("入库SI_05_DeviceToDoor运动中,光栅已恢复,继续进出轴运动");
// SI_05_DeviceToDoor();
// }
//}
}
}
catch (Exception ex)
{
LogUtil.error("光栅处理出错:" + ex.ToString());
}
finally
{
Monitor.Exit(safetyInProcess);
}
}
}
private void TimerProcess()
{
try
......@@ -993,53 +953,6 @@ namespace OnlineStore.DeviceLibrary
}
else if (storeRunStatus.Equals(StoreRunStatus.Runing))
{
////判断是否需要出入库
//if (StoreMove.MoveType.Equals(StoreMoveType.None)&&alarmType.Equals(StoreAlarmType.None))
//{
// IO_VALUE checkIO = KND.IOValue(IO_Type.TrayCheck_Door);
// //判断料门口是否有料
// if ((checkIO.Equals(IO_VALUE.HIGH))&& GetHeight()>0)
// {
// if (IsScanCode)
// {
// return;
// }
// //检测到料盘,等待1.5秒后扫码
// if (isWaitScan)
// {
// TimeSpan span = DateTime.Now - StartWaitScanTime;
// if (span.TotalSeconds > 1)
// {
// isWaitScan = false;
// IsScanCode = true;
// //BeginScannering();
// //判断料盘尺寸
// if (GetSize()<=7)
// {
// LogUtil.info(StoreName + "检测到寸料盘,开始扫码");
// GetCameraCode();
// }
// else
// {
// LogUtil.info(StoreName + "检测到大于7寸的料盘,请放入正确的料盘");
// IsScanCode = false ;
// }
// }
// }
// else
// {
// isWaitScan = true;
// StartWaitScanTime = DateTime.Now;
// }
// }
// else
// {
// isWaitScan = false;
// }
//}
//ShowTimeLog("判断是否需要出入库");
AutoResetProcess();
ShowTimeLog("AutoResetProcess");
......@@ -1081,11 +994,19 @@ namespace OnlineStore.DeviceLibrary
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if (StoreMove.IsInWait == false)
if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut)&&StoreMove.IsInWait == false)
{
LogUtil.info(StoreName + "之前有IO超时异常【" + alarmInfo.alarmDetail + "】,但是当前已经没有在等待中,清理信号超时异常!");
LogUtil.info(StoreName + "当前空闲中,清理信号超时异常【" + alarmInfo.alarmDetail + "】");
alarmType = StoreAlarmType.None;
WarnMsg = "";
}else if (alarmType.Equals(StoreAlarmType.BatchAlarm) || alarmType.Equals(StoreAlarmType.BatchIoTimeOut))
{
if (AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing) && AutomaticBaiting.StoreMove.IsInWait.Equals(false))
{
LogUtil.info(StoreName + "当前批量上下料模块空闲中,清理报警【" + alarmInfo.alarmDetail + "】");
alarmType = StoreAlarmType.None;
AutomaticBaiting.WarnMsg = "";
}
}
}
}
......@@ -1273,110 +1194,6 @@ namespace OnlineStore.DeviceLibrary
}
#region datalogic扫码枪代码
//private bool IsNotScanCode = false;
//private bool IsScanCode = false;
///// <summary>
///// 发送二维码到服务器获取PosID
///// </summary>
//public void GetInStorePosId(string message)
//{
// try
// {
// message = ScanCodeManager.ReplaceCode(message);
// if (message.Equals("") || string.IsNullOrEmpty(message))
// {
// IsNotScanCode = true;
// IsScanCode = false;
// CodeMsg = "没有收到二维码信息,请重新放入料盘";
// LogUtil.info(LOGGER, StoreName + "没有收到二维码信息,请重新放入料盘");
// return;
// }
// IsNotScanCode = false;
// if (storeRunStatus.Equals(StoreRunStatus.Wait))
// {
// LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器");
// IsScanCode = false;
// return;
// }
// // CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
// LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
// //发送扫码内容到服务器进行入库操作
// Operation operation = getLineBoxStatus();
// operation.op = 1;
// operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", StoreID.ToString() } };
// string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
// Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
// if (resultOperation == null)
// {
// // CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
// LogUtil.info(LOGGER, StoreName + "二维码【" + message + "】没有收到服务器反馈!");
// IsScanCode = false;
// return;
// }
// else if (!string.IsNullOrEmpty(resultOperation.msg))
// {
// //如果有提示消息,直接显示提示
// LogUtil.info(LOGGER, StoreName + "服务器反馈 二维码【" + message + "】 :" + resultOperation.msg);
// IsScanCode = false;
// return;
// }
// IsScanCode = false;
// Dictionary<string, string> data = resultOperation.data;
// if (data != null && data.ContainsKey(ParamDefine.posId) && data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
// {
// //服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
// //postId格式BoxId#位置
// string posId = data[ParamDefine.posId];
// string plateW = data[ParamDefine.plateW];
// string plateH = data[ParamDefine.plateH];
// string[] posArray = posId.Split('#');
// if (!(posArray.Length == 2))
// {
// WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
// LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
// LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
// return;
// }
// int storeId = int.Parse(posArray[0]);
// //根据发送的posId获取位置列表
// AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
// if (position == null)
// { //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
// WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
// LogUtil.error(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
// LogUtil.info(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
// return;
// }
// //TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
// if (CanStarInOut())
// {
// IsScanCode = false;
// InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
// StartInStoreMove(param, true);
// //如果当前正在出入库中,需要记录下来,等待空闲时执行
// LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
// }
// else
// {
// LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
// IsScanCode = false;
// }
// }
// }
// catch (Exception ex)
// {
// IsScanCode = false;
// LOGGER.Error(StoreName + ex.StackTrace);
// }
//}
#endregion
#region 温湿度处理
/// <summary>
/// 湿度标准,超过后需要报警
......@@ -1521,8 +1338,8 @@ namespace OnlineStore.DeviceLibrary
}
}
//温湿度暂时注释
//HumitureController.QueryData();
//HumidityProcess();
HumitureController.QueryData();
HumidityProcess();
LedProcess();
isInProcess = false;
}
......
......@@ -84,7 +84,7 @@ namespace OnlineStore.DeviceLibrary
//出库时批量上下料轴需要下降的高度
p.BatchAxis_DownValue = AutomaticBaiting.AxisChangeValue * position.BagHeight;
LogUtil.info("【" + position.PositionNum + "】高度【" + position.BagHeight + "】批量上下料轴需要下降【" + p.BatchAxis_DownValue + "】");
LogUtil.debug("【" + position.PositionNum + "】高度【" + position.BagHeight + "】批量上下料轴需要下降【" + p.BatchAxis_DownValue + "】");
param.MoveP = p;
return true;
}
......@@ -94,12 +94,12 @@ namespace OnlineStore.DeviceLibrary
if (position != null)
{
param.MoveP.BatchAxis_DownValue = AutomaticBaiting.AxisChangeValue * position.BagHeight;
LogUtil.info("【" + position.PositionNum + "】高度【" + position.BagHeight + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】");
LogUtil.debug("【" + position.PositionNum + "】高度【" + position.BagHeight + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】");
}
else
{
param.MoveP.BatchAxis_DownValue = AutomaticBaiting.AxisChangeValue * 8;
LogUtil.info("【" + position.PositionNum + "】高度【" + 8 + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】");
LogUtil.debug("【" + position.PositionNum + "】高度【" + 8 + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】");
}
}
return true;
......@@ -147,7 +147,7 @@ namespace OnlineStore.DeviceLibrary
continue;
}
NotOkMsg = wait.ToStr();
if (wait.WaitType == 1)
if (wait.WaitType == (int)Wait_Type.AxisMove_1)
{
string msg = "";
if (wait.IsHomeMove)
......@@ -172,7 +172,7 @@ namespace OnlineStore.DeviceLibrary
break;
}
}
else if (wait.WaitType == 2)
else if (wait.WaitType == (int)Wait_Type.IOMove_2)
{
wait.IsEnd = KND.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = Config.IOSingle_TimerOut;
......@@ -190,19 +190,19 @@ namespace OnlineStore.DeviceLibrary
break;
}
}
else if (wait.WaitType == 3)
else if (wait.WaitType == (int)Wait_Type.Time_3)
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
else if (wait.WaitType == 7)
else if (wait.WaitType == (int)Wait_Type.WaitHeight_7)
{
//wait.IsEnd = (wait.HeightValue.Equals(GetHeight()));
}
else if (wait.WaitType == 12)
else if (wait.WaitType == (int)Wait_Type.TakeTrayGo_12)
{
wait.IsEnd = AutomaticBaiting.IsGetTrayGo;
}
else if (wait.WaitType == 5)
else if (wait.WaitType == (int)Wait_Type.ShuoKe_5)
{
ShuoKeInfo info = null;
if (wait.IsHomeMove)
......@@ -333,15 +333,14 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_02_ 进出轴(叉子)动作至P1,打开舱门");
StoreMove.NextMoveStep(StoreMoveStep.SI_02_InOutAxisHome);
OpenDoorAndWait();
InOutBackToP1(moveP.InOut_P1);
}
private void SI_05_DeviceToDoor()
private void SI_04_DeviceToDoor()
{
InStoreLog("入库:SI_05 叉子进入入料口,进出轴至P2(进料口取料点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_05_DeviceToDoor);
InStoreLog("入库:SI_04 叉子进入入料口,进出轴至P2(进料口取料点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_04_DeviceToDoor);
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P2, Config.InOutAxis_P2_Speed);
// NeedCheckSafetyLight = 1;
}
protected override void InStoreProcess()
{
......@@ -369,50 +368,32 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_03_ReturnHome)
{
if (IsHasCompress_Axis)
{
InStoreLog("入库:SI_04_CompressWare 压紧物品(有压紧轴的才需要此步骤),压紧轴至P3(压紧前点) 开始");
StoreMove.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
ComMoveToPosition(moveP.ComPress_P3);
SI_04_DeviceToDoor();
}
else
{
SI_05_DeviceToDoor();
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_04_CompressWare)
{
SI_05_DeviceToDoor();
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_05_DeviceToDoor)
{
//如果是自动,等待吸盘释放盘之后就可以退出
if (StoreMove.IsBatchInOutStore)
else if (StoreMove.MoveStep == StoreMoveStep.SI_04_DeviceToDoor)
{
InStoreLog("入库:SI_06 拿物品,批量入库, 等待吸盘放下物品");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_DoorWarToDevice);
InStoreLog("入库:SI_05 拿物品,批量入库, 等待吸盘放下物品");
StoreMove.NextMoveStep(StoreMoveStep.SI_05_DoorWarToDevice);
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Air, IO_VALUE.LOW));
}
else
{
NeedCheckSafetyLight = 0;
InStoreLog("入库:SI_06 拿物品,压紧轴至P2(压紧点)) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_DoorWarToDevice);
ComMoveToPosition(moveP.ComPress_P2);
//ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P7, Config.UpDownAxis_P7_Speed);
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_06_DoorWarToDevice)
else if (StoreMove.MoveStep == StoreMoveStep.SI_05_DoorWarToDevice)
{
if (StoreMove.IsBatchInOutStore && (!StoreMove.IsNeedInStore))
{
InStoreLog("入库:SI_21不需要入库,把料盘放在门口等待操作人员拿走料盘 ");
InStoreLog("入库:SI_21不需要入库,需要操作人员拿走料盘,叉子到门口位置P7 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_21_DeviceToDoor);
OpenDoorAndWait();
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_Door_P7, Config.UpDownAxis_P7_Speed);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SafetyLightCurtains, IO_VALUE.HIGH));
}
else
{
if (IsHasCompress_Axis)
{
InStoreLog("入库:SI_06 压紧轴压紧,到压紧点 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_CompressWork);
ComMoveToPosition(moveP.ComPress_P2);
}
else
{
......@@ -421,6 +402,13 @@ namespace OnlineStore.DeviceLibrary
InOutBackToP1(moveP.InOut_P1);
}
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_06_CompressWork)
{
InStoreLog("入库:SI_07 叉子 从入料口抽出,进出轴至P1(待机点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor);
InOutBackToP1(moveP.InOut_P1);
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_07_DeviceBackFromDoor)
{
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
......@@ -429,9 +417,6 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门
//KND.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
else
{
......@@ -446,9 +431,6 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门
//KND.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_09_MoveToBag)
{
......@@ -501,7 +483,6 @@ namespace OnlineStore.DeviceLibrary
ComMoveToPosition(moveP.ComPress_P1);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoorAndWait();
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_14_GoBack)
{
......@@ -515,25 +496,38 @@ namespace OnlineStore.DeviceLibrary
InOutEndProcess(StoreMoveType.InStore);
}
#region 送出料盘处理
else if (StoreMove.MoveStep == StoreMoveStep.SI_21_DeviceToDoor)
{
InStoreLog("入库:SI_21不需要入库,等待操作人员拿走料盘 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_22_WaitTrayGo);
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
InStoreLog("入库:SI_21不需要入库,打开仓门 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_22_OpenDoor);
OpenDoorAndWait();
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SI_22_OpenDoor))
{
InStoreLog("入库:SI_23不需要入库,等待操作人员拿走料盘 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_23_WaitTrayGo);
AutomaticBaiting.IsGetTrayGo = false;
AutomaticBaiting.IsWaitTragGo = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_22_WaitTrayGo)
else if (StoreMove.MoveStep == StoreMoveStep.SI_23_WaitTrayGo)
{
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
InStoreLog("入库:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) ");
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = posId;
lastPosId = "";
lastPosIdStatus = StoreStatus.InStoreEnd;
storeStatus = StoreStatus.InStoreEnd;
StoreMove.NextMoveStep(StoreMoveStep.SI_13_InoutBack);
InOutBackToP1(moveP.InOut_P1);
CloseDoorAndWait();
}
}
#endregion
......@@ -578,7 +572,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
//判断批量上下料机构是否已经满
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)&& IsBatchWork)
{
int currBatchValue = ACServerManager.GetActualtPosition(Config.Batch_Axis.DeviceName, Config.Batch_Axis.GetAxisValue());
if (currBatchValue - param.MoveP.BatchAxis_DownValue < 1000)
......@@ -666,7 +660,7 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
LogUtil.error("出库【"+posId+"】过程中叉子已从库位退出,未检测到叉子料盘信号 ");
LogUtil.error("出库【" + posId + "】过程中叉子已从库位退出,未检测到叉子料盘信号 ");
}
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
......@@ -712,12 +706,16 @@ namespace OnlineStore.DeviceLibrary
}
else
{
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.SO_21_OpenDoor);
OutStoreLog("出库:SO_21打开仓门 ,定位气缸下降");
OutStoreLog("出库:SO_21打开仓门,压紧轴放松,,定位气缸下降");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3);
OpenDoorAndWait();
LocationDownAndWait();
}
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_21_OpenDoor)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_22_WaitTrayGo);
......@@ -728,7 +726,11 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_22_WaitTrayGo))
{
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
SO_13_InoutBack();
CloseDoorAndWait();
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_11_PutTray)
{
......@@ -760,7 +762,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.TimeOutSeconds = 120;
ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
OutStoreLog("出库:SO_02 批量上下料轴走到P1点 ");
OutStoreLog("出库:SO_02 批量上下料轴走到P1点【"+Config.BatchAxis_P1+"】 ");
}
}
}
......@@ -797,7 +799,6 @@ namespace OnlineStore.DeviceLibrary
{
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P1);
}
CloseDoorAndWait();
}
/// <summary>
/// 出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点)
......
......@@ -106,8 +106,9 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false);
BatchDoorClose(false);
}
public static bool Reset()
public static bool Reset(bool isNeedInout)
{
AutomaticBaiting.IsNeedStartInout = isNeedInout;
if (!StoreMove.MoveType.Equals(StoreMoveType.None))
{
StopMove();
......@@ -122,12 +123,7 @@ namespace OnlineStore.DeviceLibrary
DoorStatus = 2;
AutoBaitingStatus = StoreRunStatus.Reset;
StoreMove.NewMove(StoreMoveType.StoreReset);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R01_CloseDoor);
//关闭门,轴回原点,检测
BatchDoorClose(true);
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down,true);
LogUtil.info(Name + "复位中:关闭门锁");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R00_Start);
return true;
}
......@@ -145,6 +141,14 @@ namespace OnlineStore.DeviceLibrary
}
switch (StoreMove.MoveStep)
{
case StoreMoveStep.AUTO_R00_Start:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R01_CloseDoor);
//关闭门,轴回原点,检测
BatchDoorClose(true);
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
LogUtil.info(Name + "复位中:关闭门锁");
break;
case StoreMoveStep.AUTO_R01_CloseDoor:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome);
LogUtil.info(Name + "复位中:批量上下料轴原点返回");
......@@ -259,8 +263,17 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.SuckingDisc_Air).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I04_SuckingDisc_Up);
LogUtil.info(Name + "入料: 吸盘上升");
LogUtil.info(Name + "入料: 吸盘上升,等待宽度到达"+StoreManager.Config.Default_TrayWidth);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
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.WidthCheck2, IO_VALUE.LOW));
}else if (StoreManager.Config.Default_TrayWidth.Equals(13))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck1, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck2, IO_VALUE.HIGH));
}
}
else if (SuckingDisc_WorkCount < 3)
{
......@@ -270,6 +283,7 @@ namespace OnlineStore.DeviceLibrary
{
//TODO 报警
WarnMsg = "吸盘已经尝试三次,仍然吸不到物料!";
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, "吸盘吸料失败", WarnMsg, StoreMoveType.InStore);
}
}else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I04_SuckingDisc_Up))
{
......@@ -294,7 +308,8 @@ namespace OnlineStore.DeviceLibrary
//计算高度
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
LastHeight = Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue;
LastSize = GetSize();
LogUtil.info(Name + "入料: 计算高度:上升前位置【" + StartMovePosition + "】实时位置【" + EndMovePosition + "】,计算后高度【" + LastHeight + "】");
LastSize = StoreManager.Config.Default_TrayWidth;
LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastSize + "*" + LastHeight + "】二维码【" + LastCode + "】");
GetInStorePosId(ProcessMsg());
......@@ -334,22 +349,6 @@ namespace OnlineStore.DeviceLibrary
IsNeedScanCode();
}
}
//else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I011_WaitTakeTray))
//{
// StoreMove.NextMoveStep(StoreMoveStep.AUTO_I09_TrayLeaveWaitTime);
// LogUtil.info(Name + "入料: 未扫到二维码,料盘已拿走,等待1秒后关门");
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
//}
//else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I09_TrayLeaveWaitTime))
//{
// StoreMove.NextMoveStep(StoreMoveStep.AUTO_I10_CloseDoor);
// LogUtil.info(Name + "入料: 未扫到二维码,料盘已拿走,关闭仓门");
// CylinderMove(IO_Type.Door_Down, IO_Type.Door_Up, true);
//}
//else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I10_CloseDoor))
//{
// IsNeedScanCode();
//}
else
{
LogUtil.error(Name + "未找到步骤:" + StoreMove.MoveType);
......@@ -393,105 +392,6 @@ namespace OnlineStore.DeviceLibrary
}
//public static bool StartOutStore(string PosId)
//{
// AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(PosId);
// if (position == null)
// {
// LogUtil.error(Name + " 启动出料失败,PosId【" + PosId + "】未找到库位信息" );
// return false;
// }
// if (AutoBaitingStatus == StoreRunStatus.Runing && StoreMove.MoveType.Equals(StoreMoveType.None))
// {
// AutoBaitingStatus = StoreRunStatus.Busy;
// StoreMove.NewMove(StoreMoveType.InStore);
// StoreMove.PosId = PosId;
// StoreMove.NextMoveStep(StoreMoveStep.AUTO_O01_SuckingDisc_Work);
// if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
// {
// LogUtil.info(Name + " 启动出料 ,已检测到料盘,轴不需要上升");
// }
// else
// {
// LogUtil.info(Name + " 启动出料 ,轴上升到检测到料盘");
// ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
// }
// return true;
// }
// else
// {
// LogUtil.error(Name + " 启动出料失败,AutoBaitingStatus=" + AutoBaitingStatus + ",MoveType=" + StoreMove.MoveType);
// return false;
// }
//}
//private static void OutStoreProcess()
//{
// if (StoreMove.IsInWait)
// {
// CheckWait();
// }
// if (StoreMove.IsInWait)
// {
// return;
// }
// if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O01_SuckingDisc_Work))
// {
// StoreMove.NextMoveStep(StoreMoveStep.AUTO_O02_WaitTimeDown);
// LogUtil.info(Name + " 出料:等待叉子后退后,吸盘下降");
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
// }
// else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O02_WaitTimeDown))
// {
// StoreMove.NextMoveStep(StoreMoveStep.AUTO_O03_SuckingDisc_Down);
// LogUtil.info(Name + " 出料:吸盘下降,上料轴向下运动");
// CylinderMove(IO_Type.SuckingDisc_Down, IO_Type.SuckingDisc_Up, true);
// //上料轴需要向下走
// AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(StoreMove.PosId);
// int axisValue = AxisChangeValue * position.BagHeight;
// int currPosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
// int targetValue = currPosition - axisValue;
// //判断盘满后,需要报警?
// if (targetValue < 0)
// {
// WarnMsg = "库已满,请先拿走!";
// LogUtil.error(Name + WarnMsg);
// }
// else
// {
// ACAxisRelMove(StoreManager.Config.InOut_Axis, StoreManager.Config.InOut_Axis.TargetSpeed, targetValue);
// }
// }
// else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O03_SuckingDisc_Down))
// {
// StoreMove.NextMoveStep(StoreMoveStep.AUTO_O04_PutTrayDown);
// LogUtil.info(Name + " 出料:放下物料");
// KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_LoadMaterial, IO_VALUE.HIGH));
// }
// else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O04_PutTrayDown))
// {
// StoreMove.NextMoveStep(StoreMoveStep.AUTO_O05_SuckingDisc_Up);
// LogUtil.info(Name + " 出料:吸盘上升");
// CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
// }
// else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_O05_SuckingDisc_Up))
// {
// LogUtil.info(Name + "出料:出料结束");
// StoreMove.EndMove();
// AutoBaitingStatus = StoreRunStatus.Runing;
// }
// else
// {
// LogUtil.error(Name + "未找到步骤:" + StoreMove.MoveType);
// }
//}
public static bool DoorIsClose()
{
if (KND.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
......
......@@ -13,10 +13,10 @@ namespace OnlineStore.DeviceLibrary
private static int StartMovePosition = 0;
private static int EndMovePosition = 0;
public static int AutoAxisIsMove = 0;
//public static int AutoAxisIsMove = 0;
private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, int targetSpeed)
{
AutoAxisIsMove = 1;
//AutoAxisIsMove = 1;
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
EndMovePosition = StartMovePosition;
StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis));
......@@ -84,11 +84,11 @@ namespace OnlineStore.DeviceLibrary
continue;
}
NotOkMsg = wait.ToStr();
if (wait.WaitType == 1)
if (wait.WaitType == (int)Wait_Type.AxisMove_1)
{
wait.IsEnd = AxisMoveISEnd(wait);
}
else if (wait.WaitType == 2)
else if (wait.WaitType == (int)Wait_Type.IOMove_2)
{
wait.IsEnd = KND.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
......@@ -97,42 +97,42 @@ namespace OnlineStore.DeviceLibrary
{
ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType);
WarnMsg = Name + " 等待信号" + io.DisplayStr + "=" + wait.IoValue + "超时!";
StoreManager.Store.Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
LogUtil.error(WarnMsg);
isOk = false;
break;
}
}
else if (wait.WaitType == 3)
else if (wait.WaitType == (int)Wait_Type.Time_3)
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
else if (wait.WaitType == 5)
else if (wait.WaitType == (int)Wait_Type.ShuoKe_5)
{
}
else if (wait.WaitType == 6)
else if (wait.WaitType == (int)Wait_Type.AxisHomeSingle_6)
{
IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
wait.IsEnd = wait.IoValue.Equals(value);
}
else if (wait.WaitType == 7)
{
}
else if (wait.WaitType == 8)
{
IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
wait.IsEnd = wait.IoValue.Equals(value);
}
else if (wait.WaitType == 9)
{
IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
wait.IsEnd = wait.IoValue.Equals(value);
}
else if (wait.WaitType == 10)
//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);
}
else if (wait.WaitType == 11)
else if (wait.WaitType == (int)Wait_Type.ScanCode_11)
{
wait.IsEnd = !String.IsNullOrEmpty(LastCode);
}
......@@ -159,22 +159,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (span.TotalSeconds > StoreMove.TimeOutSeconds)
{
if (NotOkMsg.Equals(""))
{
WarnMsg = Name + "等待超时【" + StoreMove.MoveType + "】【" + StoreMove.MoveStep + "】已等待【" + Math.Round(span.TotalSeconds) + "】秒";
foreach (WaitResultInfo wait in list)
{
WarnMsg = WarnMsg + "\r\n" + wait.ToStr();
}
LogUtil.error(WarnMsg);
}
else
{
WarnMsg = Name + "【" + StoreMove.MoveType + "】【" + StoreMove.MoveStep + "】等待超时 [" + NotOkMsg
+ "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg);
}
StoreManager.Store.Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, StoreMove.MoveType);
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType);
}
}
catch (Exception ex)
......@@ -224,20 +212,12 @@ namespace OnlineStore.DeviceLibrary
{
wait.IsEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
}
//if (!wait.IsEnd)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
// if (value.Equals(IO_VALUE.HIGH))
// {
// ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
// LogUtil.error(Name + wait.ToStr() + "原点返回过程中到达 负限位,直接停止运动");
// StoreManager.Store.Alarm(StoreAlarmType.AxisMoveError, StoreManager.Store.GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
// }
//}
if (!msg.Equals(""))
{
WarnMsg = msg;
StoreManager.Store.Alarm(StoreAlarmType.AxisMoveError, StoreManager.Store.GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, StoreManager.Store.GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
}
return wait.IsEnd;
}
......@@ -256,8 +236,8 @@ namespace OnlineStore.DeviceLibrary
}
else
{
IO_VALUE LimitN = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
if (LimitN.Equals(IO_VALUE.HIGH))
int limitP=ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
if (limitP.Equals(1))
{
LogUtil.info(wait.ToStr() + "检测到正极限信号,可以停止运动");
result = true;
......@@ -265,28 +245,28 @@ namespace OnlineStore.DeviceLibrary
}
if (result)
{
AutoAxisIsMove = 0;
//AutoAxisIsMove = 0;
LogUtil.info(wait.ToStr() + " 停止运动");
ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
}
return result;
}
public static int GetSize()
{
if (KND.IOValue(IO_Type.WidthCheck1).Equals(IO_VALUE.HIGH))
{
if (KND.IOValue(IO_Type.WidthCheck2).Equals(IO_VALUE.HIGH))
{
return 13;
}
else
{
return 7;
}
}
return 0;
}
//public static int GetWidth()
//{
// if (KND.IOValue(IO_Type.WidthCheck1).Equals(IO_VALUE.HIGH))
// {
// if (KND.IOValue(IO_Type.WidthCheck2).Equals(IO_VALUE.HIGH))
// {
// return 13;
// }
// else
// {
// return 7;
// }
// }
// return 0;
//}
#region Halcon扫码枪代码
public bool IsTestCamera = false;
......@@ -352,11 +332,6 @@ namespace OnlineStore.DeviceLibrary
}
return msg;
}
private static bool IsNotScanCode = false;
private static bool IsScanCode = false;
/// <summary>
/// 发送二维码到服务器获取PosID
/// </summary>
private static void GetInStorePosId(string message)
{
try
......@@ -364,18 +339,14 @@ namespace OnlineStore.DeviceLibrary
message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message))
{
IsNotScanCode = true;
IsScanCode = false;
CodeMsg = "没有收到二维码信息,请重新放入料盘";
LogUtil.info(Name + "没有收到二维码信息,请重新放入料盘");
return;
}
IsNotScanCode = false;
if (StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(Name + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器");
IsScanCode = false;
return;
}
......@@ -388,9 +359,8 @@ namespace OnlineStore.DeviceLibrary
if (StoreManager.Store.CanStarInOut())
{
LastPosId = posId;
IsScanCode = false;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
StoreManager.Store.StartInStoreMove(param, true);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(Name + " 入库调试模拟:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
......@@ -398,7 +368,6 @@ namespace OnlineStore.DeviceLibrary
else
{
LogUtil.info(Name + " 入库调试模拟:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
IsScanCode = false;
}
return;
}
......@@ -415,17 +384,14 @@ namespace OnlineStore.DeviceLibrary
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(Name + "二维码【" + message + "】没有收到服务器反馈!");
IsScanCode = false;
return;
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(Name + "服务器反馈 二维码【" + message + "】 :" + resultOperation.msg);
IsScanCode = false;
return;
}
IsScanCode = false;
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.posId) && data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
{
......@@ -456,7 +422,6 @@ namespace OnlineStore.DeviceLibrary
if (StoreManager.Store.CanStarInOut())
{
LastPosId = posId;
IsScanCode = false;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
StoreManager.Store.StartInStoreMove(param, true);
......@@ -466,13 +431,11 @@ namespace OnlineStore.DeviceLibrary
else
{
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
IsScanCode = false;
}
}
}
catch (Exception ex)
{
IsScanCode = false;
LogUtil.error(Name + ex.StackTrace);
}
}
......
......@@ -34,7 +34,6 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public bool isNoAirCheck = false;
protected int NeedCheckSafetyLight = 0;
/// <summary>
/// 是否再报警中
/// </summary>
......@@ -95,7 +94,7 @@ namespace OnlineStore.DeviceLibrary
serverConnectTimer.Enabled = false;
//serverConnectTimer.Elapsed += server_connect_timer_Tick;
IoCheckTimer = new System.Timers.Timer();
IoCheckTimer.Interval = 200;
IoCheckTimer.Interval = 300;
IoCheckTimer.AutoReset = true;
IoCheckTimer.Enabled = false;
//IoCheckTimer.Elapsed += IoCheckTimer_Elapsed;
......@@ -299,10 +298,10 @@ namespace OnlineStore.DeviceLibrary
case StoreAlarmType.IoSingleTimeOut:
aType = 3;
break;
case StoreAlarmType.StellAlarm:
aType = 2;
alarmDetial = "5";
break;
//case StoreAlarmType.StellAlarm:
// aType = 2;
// alarmDetial = "5";
//break;
default: break;
}
alarmInfo = new AlarmInfo(StoreID, aType, alarmDetial, alarmMsg, inoutStatus);
......@@ -370,15 +369,15 @@ namespace OnlineStore.DeviceLibrary
string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue();
//如果是进出轴,并且光栅被遮挡,直接返回false
if (NeedCheckSafetyLight.Equals(2))
{
if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
{
return false;
}
}
////如果是进出轴,并且光栅被遮挡,直接返回false
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
// StoreMove.MoveStep.Equals(StoreMoveStep.SI_04_DeviceToDoor))
// {
// return false;
// }
//}
bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition);
......@@ -386,14 +385,14 @@ namespace OnlineStore.DeviceLibrary
{
if (errorCount > moveAxis.CanErrorCountMax)
{
if (NeedCheckSafetyLight.Equals(2))
{
if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
{
return false;
}
}
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
// StoreMove.MoveStep.Equals(StoreMoveStep.SI_04_DeviceToDoor))
// {
// return false;
// }
//}
//判断是否需要重新运动
if (StoreMove.CanWhileCount > 0)
{
......
......@@ -300,19 +300,23 @@ namespace OnlineStore.DeviceLibrary
/// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
/// </summary>
SI_03_ReturnHome = 203,
/// <summary>
/// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
/// </summary>
SI_04_CompressWare = 204,
///// <summary>
///// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
///// </summary>
//SI_04_CompressWare = 204,
/// <summary>
/// 入库。。叉子进入入料口,轴3( 叉子) 至P2( 进料口取料点)
/// </summary>
SI_05_DeviceToDoor = 205,
SI_04_DeviceToDoor = 204,
/// <summary>
/// 入库。。把物品放入叉子上,轴2( 上下) 至P7( 进料口取料缓冲点),压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P2(压紧点)
/// 批量入库:此步骤表示吸盘放物品
/// </summary>
SI_06_DoorWarToDevice = 206,
SI_05_DoorWarToDevice = 205,
/// <summary>
/// 压紧轴压紧
/// </summary>
SI_06_CompressWork = 206,
/// <summary>
/// 入库。。叉子 从入料口抽出,轴3( 叉子) 至P1( 待机点)
......@@ -354,9 +358,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
SI_21_DeviceToDoor= 221,
/// <summary>
///入库未取到PosID,, 打开仓门
/// </summary>
SI_22_OpenDoor = 222,
/// <summary>
/// 入库未取到PosID,,等待料盘拿走
/// </summary>
SI_22_WaitTrayGo = 222,
SI_23_WaitTrayGo = 223,
///// <summary>
///// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
......@@ -373,6 +381,10 @@ namespace OnlineStore.DeviceLibrary
#region 自动上下料机构复位
/// <summary>
/// 开始复位
/// </summary>
AUTO_R00_Start=1100,
/// <summary>
/// 关闭门锁
/// </summary>
AUTO_R01_CloseDoor = 1101,
......@@ -399,44 +411,44 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 先上升到料盘检测1(上料机构)信号亮
/// </summary>
AUTO_I00_MoveToUp,
AUTO_I00_MoveToUp=1200,
/// <summary>
/// 扫码
/// </summary>
AUTO_I01_ScanCode,
AUTO_I01_ScanCode=1201,
/// <summary>
/// 吸盘下降
/// </summary>
AUTO_I02_SuckingDisc_Down,
AUTO_I02_SuckingDisc_Down=1202,
/// <summary>
/// 吸盘吸料盘
/// </summary>
AUTO_I03_SuckingDisc_Work,
AUTO_I03_SuckingDisc_Work=1203,
/// <summary>
/// 吸盘上升 ,
/// </summary>
AUTO_I04_SuckingDisc_Up,
AUTO_I04_SuckingDisc_Up=1204,
/// <summary>
/// 批量上下料料轴上升
/// </summary>
AUTO_I05_BatchAxisUp,
AUTO_I05_BatchAxisUp=1205,
/// <summary>
/// 从服务器获取PosID
/// </summary>
AUTO_I06_GetPosId,
AUTO_I06_GetPosId=1206,
/// <summary>
/// 等待料盘被叉子拿走
/// </summary>
AUTO_I07_WaitTrayLeave,
AUTO_I07_WaitTrayLeave=1207,
/// <summary>
/// 未扫到码:等待操作人员拿走料盘
/// </summary>
AUTO_I10_WaitTrayGo,
AUTO_I10_WaitTrayGo=1210,
///// <summary>
/////未扫到码: 把料盘放到叉子上
///// </summary>
......@@ -517,9 +529,14 @@ namespace OnlineStore.DeviceLibrary
/// io信号超时未收到
/// </summary>
IoSingleTimeOut = 30,
/// <summary>
/// io信号超时未收到
/// </summary>
BatchIoTimeOut = 100,
/// <summary>
/// 电钢报警
/// 批量上下料模块报警
/// </summary>
StellAlarm=50,
BatchAlarm =110,
}
}
......@@ -146,7 +146,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 2;
wait.WaitType =(int) Wait_Type.IOMove_2;
wait.IoType = ioType;
wait.IoValue = ioValue;
wait.IsEnd = false;
......@@ -156,7 +156,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 1;
wait.WaitType = (int)Wait_Type.AxisMove_1;
wait.AxisInfo = axis;
wait.IsHomeMove = false;
wait.TargetPosition = targetPosition;
......@@ -168,7 +168,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 1;
wait.WaitType = (int)Wait_Type.AxisMove_1;
wait.AxisInfo = axis;
wait.IsHomeMove = true;
wait.IsEnd = false;
......@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount =10;
wait.WaitType = 4;
wait.WaitType = (int)Wait_Type.StellMove_4;
wait.SlvAddr = slvAddr;
wait.IsHomeMove = false;
wait.TargetPosition = targetPosition;
......@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 10;
wait.WaitType = 4;
wait.WaitType = (int)Wait_Type.StellMove_4;
wait.SlvAddr = slvAddr;
wait.IsHomeMove = true;
wait.TargetPosition = 0;
......@@ -202,7 +202,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 5;
wait.WaitType = (int)Wait_Type.ShuoKe_5 ;
wait.SlvAddr =(byte) slvAddr;
wait.TargetPosition = targetPosition;
wait.IsHomeMove = isHome;
......@@ -212,7 +212,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 3;
wait.WaitType = (int)Wait_Type.Time_3;
wait.TimeMSeconds = MScends;
wait.IsEnd = false;
return wait;
......@@ -227,7 +227,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 6;
wait.WaitType = (int)Wait_Type.AxisHomeSingle_6;
wait.AxisInfo = axis;
wait.IsHomeMove = true;
wait.IoValue = value;
......@@ -257,20 +257,20 @@ namespace OnlineStore.DeviceLibrary
// wait.IsEnd = false;
// return wait;
//}
/// <summary>
///9= 等待轴的正限位为指定值
/// </summary>
public static WaitResultInfo WaitAxistPositiveLimit(ConfigMoveAxis moveAxis, IO_VALUE ioValue)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 9;
wait.AxisInfo = moveAxis;
wait.IsHomeMove = true;
wait.IoValue = ioValue;
wait.IsEnd = false;
return wait;
}
///// <summary>
/////9= 等待轴的正限位为指定值
///// </summary>
//public static WaitResultInfo WaitAxistPositiveLimit(ConfigMoveAxis moveAxis, IO_VALUE ioValue)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount = 0;
// wait.WaitType = 9;
// wait.AxisInfo = moveAxis;
// wait.IsHomeMove = true;
// wait.IoValue = ioValue;
// wait.IsEnd = false;
// return wait;
//}
/// <summary>
......@@ -282,7 +282,7 @@ namespace OnlineStore.DeviceLibrary
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.AxisInfo = moveAxis;
wait.WaitType = 10;
wait.WaitType = (int)Wait_Type.BatchAxisMove_10;
wait.IsHomeMove = true;
wait.IsEnd = false;
return wait;
......@@ -294,7 +294,7 @@ namespace OnlineStore.DeviceLibrary
public static WaitResultInfo WaitCodeOK()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 11;
wait.WaitType = (int)Wait_Type.ScanCode_11;
return wait;
}
/// <summary>
......@@ -304,12 +304,12 @@ namespace OnlineStore.DeviceLibrary
public static WaitResultInfo WaitTakeTray()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 12;
wait.WaitType = (int)Wait_Type.TakeTrayGo_12;
return wait;
}
public string ToStr()
{
if (WaitType == 1)
if (WaitType == (int)Wait_Type.AxisMove_1)
{
if (IsHomeMove)
{
......@@ -320,44 +320,47 @@ namespace OnlineStore.DeviceLibrary
return "轴【" + AxisInfo.DisplayStr + "】绝对运动,目标位置【" + TargetPosition + "】";
}
}
else if (WaitType == 2)
else if (WaitType == (int)Wait_Type.IOMove_2)
{
return "IO信号等待,IO类型【" + IoType + "】,等待值【" + IoValue + "】";
}
else if (WaitType == 3)
else if (WaitType == (int)Wait_Type.Time_3)
{
return "时间等待:【" + TimeMSeconds + "】毫秒";
}
else if (WaitType == 4)
else if (WaitType == (int)Wait_Type.StellMove_4)
{
return "电钢目标位置:【" + TargetPosition + "】 ";
}
else if (WaitType == 5)
else if (WaitType == (int)Wait_Type.ShuoKe_5)
{
return "硕科电机目标位置:【" + TargetPosition + "】 ";
}
else if (WaitType == 6)
else if (WaitType == (int)Wait_Type.AxisHomeSingle_6)
{
return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 ";
}
else if (WaitType == 7)
else if (WaitType == (int)Wait_Type.WaitHeight_7)
{
return "料盘高度【" + HeightValue + "】 ";
}
else if (WaitType == 8)
else if (WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
{
return "轴【" + AxisInfo.DisplayStr + "】负限位:【" + IoValue + "】 ";
}
else if (WaitType == 9)
else if (WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
{
return "轴【" + AxisInfo.DisplayStr + "】正限位:【" + IoValue + "】 ";
}
else if (WaitType == 10)
else if (WaitType == (int)Wait_Type.BatchAxisMove_10)
{
return "上料轴运动停止 ";
}else if (WaitType == 11)
}else if (WaitType == (int)Wait_Type.ScanCode_11)
{
return "等待扫码结束";
}else if(WaitType == (int)Wait_Type.TakeTrayGo_12)
{
return "等待操作人员拿走料盘";
}
else
{
......@@ -419,6 +422,60 @@ namespace OnlineStore.DeviceLibrary
}
public enum Wait_Type
{
None_0=0,
/// <summary>
/// 1=轴运动,
/// </summary>
AxisMove_1 = 1,
/// <summary>
/// 2=IO运动,
/// </summary>
IOMove_2 = 2,
/// <summary>
/// 3=时间
/// </summary>
Time_3 = 3,
/// <summary>
/// ,4=电钢,
/// </summary>
StellMove_4 = 4,
/// <summary>
/// 5=硕科电机
/// </summary>
ShuoKe_5 = 5,
/// <summary>
/// ,6=等待轴原点信号
/// </summary>
AxisHomeSingle_6 = 6,
/// <summary>
/// 7=等待高度为0,
/// </summary>
WaitHeight_7 = 7,
/// <summary>
/// 8=等待轴的负限位,
/// </summary>
AxisLimitNegativeSingle_8 = 8,
/// <summary>
/// 9=等待轴的正限位。
/// </summary>
AxisLimitPositiveSingle_9 = 9,
/// <summary>
/// 10=上料轴运动停止
/// </summary>
BatchAxisMove_10 = 10,
/// <summary>
/// 11=扫码结束。
/// </summary>
ScanCode_11 = 11,
/// <summary>
/// 12=操作人员拿走料盘,并点击确定。
/// </summary>
TakeTrayGo_12 = 12,
}
public enum StoreMoveType
{
/// <summary>
......
......@@ -155,13 +155,19 @@ namespace OnlineStore.LoadCSVLibrary
/// 使用康泰克板卡表示轴编号,使用Ac伺服电机表示伺服地址
/// </summary>
/// <returns></returns>
///
private short axisValue = -1;
public short GetAxisValue()
{
if (ProVale.Equals("") || ProVale.Equals("-1"))
{
return -1;
}
return (short)Convert.ToInt32(ProVale);
if (axisValue.Equals(-1))
{
axisValue= (short)Convert.ToInt32(ProVale);
}
return axisValue;
}
public override string ToString()
......
......@@ -566,6 +566,11 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// PRO,默认的料盘宽度(不可更改),Default_TrayWidth,7
/// </summary>
[ConfigProAttribute("Default_TrayWidth")]
public int Default_TrayWidth { get; set; }
/// <summary>
/// PRO IO模块对应的DI数量 IO_DILength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DILength")]
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!