Commit 7daf9d25 jimi

1

1 个父辈 598a720a
......@@ -29,9 +29,9 @@
<add key="CodeType" value="Data Matrix ECC 200" />
<!--<add key="CodeType" value="Data Matrix ECC 200"/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" />
<add key ="InOutDefaultPosition" value ="3000"/>
<add key ="Config_Pwd" value ="123456"/>
<add key="CodeParamPath" value="\CodeParam\" />
<add key ="InOutDefaultPosition" value ="10000"/>
<add key ="Config_Pwd" value ="123456"/>
<!--5000脉冲对应1mm-->
<add key ="AxisChangeValue" value ="5000"/>
</appSettings>
......
......@@ -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);
//}
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
......
......@@ -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 + "入料: 吸盘上升");
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
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());
......@@ -333,23 +348,7 @@ 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);
......@@ -391,106 +390,7 @@ namespace OnlineStore.DeviceLibrary
AutoBaitingStatus = StoreRunStatus.Runing;
}
}
//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()
{
......
......@@ -33,8 +33,7 @@ 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()
......
......@@ -563,8 +563,13 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("BatchAxis_P1_Speed", true)]
public int BatchAxis_P1_Speed { get; set; }
/// <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>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!