Commit f5303269 几米阳光

增加批量轴待机点,批量原点返回后,回到待机点。

1 个父辈 015a89b0
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<!--是否有门禁屏蔽功能,=1表示有此功能--> <!--是否有门禁屏蔽功能,=1表示有此功能-->
<add key ="HasDisableDoorControl" value ="0"/> <add key ="HasDisableDoorControl" value ="0"/>
<add key ="ACBaudRate" value ="9600"/> <add key ="ACBaudRate" value ="9600"/>
<add key="Default_Language" value="zh-CN" />
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -214,6 +214,11 @@ namespace OnlineStore.AutoInOutStore ...@@ -214,6 +214,11 @@ namespace OnlineStore.AutoInOutStore
{ {
ResourceCulture.SetCurrentCulture(language); ResourceCulture.SetCurrentCulture(language);
} }
else
{
ResourceCulture.SetCurrentCulture(ResourceCulture.China);
ConfigAppSettings.SaveValue(Setting_Init.Default_Language, ResourceCulture.China);
}
GetVersion(); GetVersion();
LogUtil.logBox = this.richTextBox1; LogUtil.logBox = this.richTextBox1;
this.ShowInTaskbar = true; this.ShowInTaskbar = true;
...@@ -239,11 +244,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -239,11 +244,10 @@ namespace OnlineStore.AutoInOutStore
{ {
return; return;
} }
BatchInoutStatus();
lblTemp.Text = store.currTempStr; lblTemp.Text = store.currTempStr;
lblBatchMsg.Text = AutomaticBaiting.WarnMsg; lblBatchMsg.Text = AutomaticBaiting.WarnMsg;
lblWarnMsg.Text = store.WarnMsg; lblWarnMsg.Text = store.WarnMsg;
BatchInoutStatus();
//忙碌状态不读取状态 //忙碌状态不读取状态
if (!store.storeRunStatus.Equals(StoreRunStatus.Busy)) if (!store.storeRunStatus.Equals(StoreRunStatus.Busy))
{ {
......
...@@ -116,6 +116,11 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,, ...@@ -116,6 +116,11 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
3.批量上料轴上升过程中,新建一个线程用来验证是否需要停止。 3.批量上料轴上升过程中,新建一个线程用来验证是否需要停止。
20190226需要修改
批量上下料轴增加待机点,复位后移动到待机点
......
...@@ -230,8 +230,26 @@ namespace OnlineStore.Common ...@@ -230,8 +230,26 @@ namespace OnlineStore.Common
this.IpAddress = ""; this.IpAddress = "";
this.DeviceAddress = ""; this.DeviceAddress = "";
this.Password = ""; this.Password = "";
this.Temperate = wendu; //if (shidu > 5)
//{
// double nowShidu = shidu-7;
// if (nowShidu < 3)
// {
// int abs = (int)Math.Round(nowShidu, 0);
// if (abs < 0)
// {
// abs -= 1;
// }
// nowShidu = (4 - abs) + nowShidu;
// }
// this.Humidity = nowShidu;
//}
//else
//{
// this.Humidity = shidu;
//}
this.Humidity = shidu; this.Humidity = shidu;
this.Temperate = wendu;
this.UpdateTime = DateTime.Now; this.UpdateTime = DateTime.Now;
} }
/// <summary> /// <summary>
......
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,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,
DO,门禁功能屏蔽,DisableDoorControl,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,,Y21,DO-21,0,
,,,101,192.168.200.12,0,,Y22,DO-22,0,
,,,102,192.168.200.12,0,,Y23,DO-23,0,
,,,103,192.168.200.12,0,,Y24,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,352000,,,,,,,
PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,252030,,,,,,,
PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,209985,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,12#416000;16#412000;20#408000;24#404000;28#400000;32#396000;36#392000;40#388000;52#376000;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,219259,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,-10000,,,,,,,
PRO,压紧轴(轴4)P2压紧点集合,CompressAxis_P2_List,12#-100000;16#-90000;20#-85000;24#-80000;28#-70000;32#-65000;36#-60000;40#-50000;44#-30000;48#-20000;52#-10000;,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,,,,
PRO,设备是否调试状态(1=调试,0=正常),IsInDebug,1,,,,,,,
PRO,默认的料盘宽度(不可更改),Default_TrayWidth,13,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,, ,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,,
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,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM2,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,12000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)原点返回速度,CompressAxis_HomeSpeed,8000,,,,,,,
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,1800000,,,,,, ,
PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,20000,,,,,, ,
PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,300,,,,,,,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10,,,,,,,
PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,300,,,,,,,
PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,80000,,,,,,,
PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,340,,,,,,,
PRO,最后一盘料需要补充的高度,LastTrayAddHeight,12,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
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,,,,,,,
...@@ -194,66 +194,73 @@ namespace OnlineStore.DeviceLibrary ...@@ -194,66 +194,73 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public override bool StartRun() public override bool StartRun()
{ {
runTimeWatch.Restart(); try
LogUtil.info(LOGGER, StoreName + "开始启动,启动时间:" + DateTime.Now.ToLongTimeString());
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
if (IsHasCompress_Axis)
{ {
if (ShuoKeControls.isRun == false && (!StoreManager.OpenShuoKe(this))) runTimeWatch.Restart();
LogUtil.info(LOGGER, StoreName + "开始启动,启动时间:" + DateTime.Now.ToLongTimeString());
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
if (IsHasCompress_Axis)
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.PreConnectFail,"启动失败:压紧轴连接失败"); if (ShuoKeControls.isRun == false && (!StoreManager.OpenShuoKe(this)))
LogUtil.error(StoreName + "打开驱动器串口失败,启动失败!"); {
WarnMsg = ResourceControl.GetString(ResourceControl.PreConnectFail, "启动失败:压紧轴连接失败");
LogUtil.error(StoreName + "打开驱动器串口失败,启动失败!");
return false;
}
}
string canStart = AutomaticBaiting.CanStart();
if (!canStart.Equals(""))
{
WarnMsg = canStart;
LogUtil.info(StoreName + canStart);
return false; return false;
} }
} autoNext = false;
string canStart = AutomaticBaiting.CanStart(); mainTimer.Enabled = false;
if (!canStart.Equals("")) alarmType = StoreAlarmType.None;
{
WarnMsg = canStart;
LogUtil.info(StoreName + canStart);
return false;
}
autoNext = false;
mainTimer.Enabled = false;
alarmType = StoreAlarmType.None;
//急停按钮和气压检测需要一起判断 //急停按钮和气压检测需要一起判断
IO_VALUE suddenBtn = KND.IOValue(IO_Type.SuddenStop_BTN); IO_VALUE suddenBtn = KND.IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE airCheck = KND.IOValue(IO_Type.Airpressure_Check); IO_VALUE airCheck = KND.IOValue(IO_Type.Airpressure_Check);
//if (suddenBtn == IO_VALUE.HIGH) //if (suddenBtn == IO_VALUE.HIGH)
if (suddenBtn == IO_VALUE.HIGH && airCheck == IO_VALUE.HIGH) if (suddenBtn == IO_VALUE.HIGH && airCheck == IO_VALUE.HIGH)
{
//lastAirValue = airCheck;
lastAirCloseTime = DateTime.Now;
if (!RunAxis(true))
{ {
return false; //lastAirValue = airCheck;
} lastAirCloseTime = DateTime.Now;
AutomaticBaiting.Reset(false); if (!RunAxis(true))
{
//TODO 启动时先所有轴远点返回,测试暂时关闭 return false;
storeRunStatus = StoreRunStatus.HomeMoving; }
HumitureController.Init(Config.Humiture_Port); AutomaticBaiting.Reset(false);
ReturnHome();
mainTimer.Enabled = true; //TODO 启动时先所有轴远点返回,测试暂时关闭
ledCheckTimer.Enabled = true; storeRunStatus = StoreRunStatus.HomeMoving;
IoCheckTimer.Enabled = true; HumitureController.Init(Config.Humiture_Port);
serverConnectTimer.Enabled = true; ReturnHome();
return true; mainTimer.Enabled = true;
} ledCheckTimer.Enabled = true;
else IoCheckTimer.Enabled = true;
{ serverConnectTimer.Enabled = true;
if (suddenBtn.Equals(IO_VALUE.LOW)) return true;
{
WarnMsg = ResourceControl.GetString(ResourceControl.startFail, "Startup failure: emergency stop not opened");
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:急停没开 !启动失败!");
} }
else else
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.startFailAir, "Startup failure: no air pressure signal"); if (suddenBtn.Equals(IO_VALUE.LOW))
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:没有气压信号 !启动失败!"); {
WarnMsg = ResourceControl.GetString(ResourceControl.startFail, "Startup failure: emergency stop not opened");
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:急停没开 !启动失败!");
}
else
{
WarnMsg = ResourceControl.GetString(ResourceControl.startFailAir, "Startup failure: no air pressure signal");
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:没有气压信号 !启动失败!");
}
return false;
} }
}catch(Exception ex)
{
LogUtil.error("启动错误"+ex.StackTrace);
return false; return false;
} }
} }
......
...@@ -122,8 +122,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -122,8 +122,8 @@ namespace OnlineStore.DeviceLibrary
BatchDoorClose(false); BatchDoorClose(false);
} }
public static bool Reset(bool isNeedInout) public static bool Reset(bool isNeedInout)
{ {
string msg = CanStart(); string msg = CanStart();
if (!String.IsNullOrEmpty(msg)) if (!String.IsNullOrEmpty(msg))
{ {
...@@ -150,7 +150,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -150,7 +150,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "开始复位,是否需要入库【" + AutomaticBaiting.IsNeedStartInout + "】"); LogUtil.info(Name + "开始复位,是否需要入库【" + AutomaticBaiting.IsNeedStartInout + "】");
return true; return true;
} }
private static void ResetProcess() private static void ResetProcess()
{ {
...@@ -188,13 +188,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -188,13 +188,12 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.info(Name + "复位完成"); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2);
StoreMove.EndMove(); LogUtil.info(Name + "复位中:上料轴移动到p1点【" + StoreManager.Config.BatchAxis_P2 + "】");
AutoBaitingStatus = StoreRunStatus.Runing; ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
WarnMsg = "";
IsNeedStartInout = false;
} }
break; break;
case StoreMoveStep.AUTO_R03_AutoAxisHome: case StoreMoveStep.AUTO_R03_AutoAxisHome:
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW)) if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW))
...@@ -215,6 +214,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -215,6 +214,16 @@ namespace OnlineStore.DeviceLibrary
} }
break; break;
case StoreMoveStep.AUTO_R04_AutoBack: case StoreMoveStep.AUTO_R04_AutoBack:
//LogUtil.info(Name + "复位完成");
//StoreMove.EndMove();
//AutoBaitingStatus = StoreRunStatus.Runing;
//WarnMsg = "";
//IsNeedStartInout = false;
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2);
LogUtil.info(Name + "复位中:上料轴移动到p1点【" + StoreManager.Config.BatchAxis_P2 + "】");
ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
break;
case StoreMoveStep.AUTO_R05_ToP2:
LogUtil.info(Name + "复位完成"); LogUtil.info(Name + "复位完成");
StoreMove.EndMove(); StoreMove.EndMove();
AutoBaitingStatus = StoreRunStatus.Runing; AutoBaitingStatus = StoreRunStatus.Runing;
......
...@@ -35,8 +35,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -35,8 +35,8 @@ namespace OnlineStore.DeviceLibrary
{ {
moveAxis.TargetPosition = 0; moveAxis.TargetPosition = 0;
LogUtil.debug(Name + moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回"); LogUtil.debug(Name + moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
} }
private static bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis, out string msg) private static bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis, out string msg)
{ {
......
...@@ -6,6 +6,7 @@ using System.Collections.Generic; ...@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
...@@ -89,8 +90,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -89,8 +90,9 @@ namespace OnlineStore.DeviceLibrary
} }
return bitm; return bitm;
} }
public static List<string> CameraScan( ) [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan()
{ {
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
List<CodeInfo> allCodeList = new List<CodeInfo>(); List<CodeInfo> allCodeList = new List<CodeInfo>();
...@@ -99,14 +101,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,14 +101,18 @@ namespace OnlineStore.DeviceLibrary
{ {
foreach (string cameraName in cameraNameList) foreach (string cameraName in cameraNameList)
{ {
Bitmap bitmap = GetCamerImage(cameraName); using (Bitmap bitmap = GetCamerImage(cameraName))
if (bitmap == null)
{
LogUtil.info(" 摄像机【" + cameraName + "】获取图片失败");
}
else
{ {
if (bitmap == null)
{
LogUtil.info(" 摄像机【" + cameraName + "】获取图片失败");
continue;
}
LogUtil.debug(" 摄像机【" + cameraName + "】获取图片完成");
System.Threading.Thread.Sleep(1);
HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap); HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.debug(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>(); List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList) foreach (string codeType in codeTypeList)
{ {
...@@ -119,22 +125,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -119,22 +125,28 @@ namespace OnlineStore.DeviceLibrary
{ {
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType); cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType);
} }
//LogUtil.info(" 摄像机【" + cameraName + "】【"+ codeType + "】扫码完成");
} }
allCodeList.AddRange(cc); allCodeList.AddRange(cc);
} }
}
} }
catch (AccessViolationException e)
{
LogUtil.error("扫码出现AccessViolationException异常:" + e.ToString());
GC.Collect();
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("扫码出错:" + ex.ToString()); LogUtil.error("扫码出错:" + ex.ToString());
} }
foreach(CodeInfo info in allCodeList) foreach (CodeInfo info in allCodeList)
{ {
codeList.Add(info.CodeStr); codeList.Add(info.CodeStr);
} }
return codeList; return codeList;
} }
public static string GetCodeParamFilePath(string codePath) public static string GetCodeParamFilePath(string codePath)
{ {
......
...@@ -420,7 +420,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -420,7 +420,10 @@ namespace OnlineStore.DeviceLibrary
/// 上料轴返回0点 /// 上料轴返回0点
/// </summary> /// </summary>
AUTO_R04_AutoBack=1104, AUTO_R04_AutoBack=1104,
/// <summary>
/// 上料轴移动到待机点
/// </summary>
AUTO_R05_ToP2=1105,
#endregion #endregion
......
...@@ -604,8 +604,18 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -604,8 +604,18 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("LastTrayAddHeight")] [ConfigProAttribute("LastTrayAddHeight")]
public int LastTrayAddHeight { get; set; } public int LastTrayAddHeight { get; set; }
/// <summary>
/// PRO,(轴五) 上料轴P2点(待机点),BatchAxis_P2,20000
/// </summary>
[ConfigProAttribute("BatchAxis_P2")]
public int BatchAxis_P2 { get; set; }
/// <summary>
/// PRO,(轴五) 上料轴P2速度, BatchAxis_P2_Speed,300
/// </summary>
[ConfigProAttribute("BatchAxis_P2_Speed")]
public int BatchAxis_P2_Speed { get; set; }
private Dictionary<string, ushort> DILengthMap = null; private Dictionary<string, ushort> DILengthMap = null;
private Dictionary<string, ushort> DOLengthMap = null; private Dictionary<string, ushort> DOLengthMap = null;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!