Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c0a0de6a
由
LN
编写于
2019-10-17 14:10:18 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
ed18caa3
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
841 行增加
和
463 行删除
doc/RC1250佳世达IO配置10-10.xlsx
source/AssemblyLineClient/FrmFeedingEquip.cs
source/DeviceLibrary/LineConfig/Config_FeedingEquip_1.csv
source/DeviceLibrary/LineConfig/Config_FeedingEquip_2.csv
source/DeviceLibrary/LineConfig/Config_FeedingEquip_3.csv
source/DeviceLibrary/LineConfig/Config_FeedingEquip_4.csv
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_1.csv
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_2.csv
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_3.csv
source/DeviceLibrary/LineConfig/MoveEquip/Config_MoveEquip_17.csv
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblyLine/TrayManager.cs
source/DeviceLibrary/deviceLibrary/IO/IOManager.cs
source/DeviceLibrary/model/StoreStep.cs
source/DeviceLibrary/model/TrayInfo.cs
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
source/LoadCVSLibrary/storeConfig/config/FeedingEquip_Config.cs
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
doc/RC1250佳世达IO配置10-10.xlsx
0 → 100644
查看文件 @
c0a0de6
此文件类型无法预览
source/AssemblyLineClient/FrmFeedingEquip.cs
查看文件 @
c0a0de6
...
...
@@ -230,6 +230,19 @@ namespace OnlineStore.AssemblyLine
lblStoreStatus
.
Text
=
KTK_Store
.
GetRunStr
(
equipBean
.
lineStatus
,
equipBean
.
runStatus
);
lblThisSta
.
Text
=
equipBean
.
WarnMsg
;
txtP1
.
Text
=
equipBean
.
Config
.
BatchAxisP1
.
ToString
();
if
(
equipBean
.
Config
.
SidesWayNum
>
0
)
{
btnSwLocationCylinder
.
Visible
=
true
;
btnSWTop
.
Visible
=
true
;
btnFL_TopCylinder
.
Visible
=
false
;
}
else
{
btnSwLocationCylinder
.
Visible
=
false
;
btnSWTop
.
Visible
=
false
;
btnFL_TopCylinder
.
Visible
=
true
;
}
IsLoad
=
true
;
}
...
...
source/DeviceLibrary/LineConfig/Config_FeedingEquip_1.csv
查看文件 @
c0a0de6
...
...
@@ -3,6 +3,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,1,,,,,
PRO,0,是否是用来出料,IsCanOut,0,,,,,
,,,,,,,,,
AXIS,0,批量上料轴,Batch_Axis,2,COM1,0,,,
PRO,0,批量上料轴待机点 P1,BatchAxisP1,2000,,,,,
...
...
@@ -24,7 +25,7 @@ PRO,0,移栽上下轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,
PRO,0,移栽上下轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,
PRO,0,移栽上下轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,
PRO,0,移栽上下轴下降速度,UpdownAxis_DownSpeed,500,,,,,
PRO,0,移栽上下轴走到待机点速度,UpdownAxis_P1Speed,400,,,,,
PRO,0,移栽上下轴走到待机点速度,UpdownAxis_P1Speed,400,,,,,
,,,,,,,,,
,,,,,,,,,
,,,,,,,,,
...
...
source/DeviceLibrary/LineConfig/Config_FeedingEquip_2.csv
查看文件 @
c0a0de6
...
...
@@ -3,6 +3,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,0,,,,,
PRO,0,是否是用来出料,IsCanOut,0,,,,,
,,,,,,,,,
AXIS,0,批量上料轴,Batch_Axis,2,COM1,0,,,
PRO,0,批量上料轴待机点 P1,BatchAxisP1,2000,,,,,
...
...
@@ -81,8 +82,8 @@ DO,0,SL2上料气缸放松SOL,SL_FeedCylinder_Slack,0,192.168.200.24,0,SL2上料气缸放松
DO,0,SL2上料气缸夹紧SOL,SL_FeedCylinder_Tighten,1,192.168.200.24,0,SL2上料气缸夹紧SOL,Y162,Y162
DO,0,SL2托盘定位气缸1前进SOL,SL_TrayLocationCylinder_Before,2,192.168.200.24,0,SL2托盘定位气缸1前进SOL,Y163,Y163
DO,0,SL2托盘定位气缸1后退SOL,SL_TrayLocationCylinder_After,3,192.168.200.24,0,SL2托盘定位气缸1后退SOL,Y164,Y164
DO,0,FL1阻挡1下降SOL,FL_Stop
1Down
,4,192.168.200.24,0,FL1阻挡1下降SOL,Y165,Y165
DO,0,FL1阻挡2下降SOL,FL_Stop
2Down
,5,192.168.200.24,0,FL1阻挡2下降SOL,Y166,Y166
DO,0,FL1阻挡1下降SOL,FL_Stop
Cylinder_Down1
,4,192.168.200.24,0,FL1阻挡1下降SOL,Y165,Y165
DO,0,FL1阻挡2下降SOL,FL_Stop
Cylinder_Down2
,5,192.168.200.24,0,FL1阻挡2下降SOL,Y166,Y166
DO,0,FL1顶升上升SOL,FL_TopCylinder_Up,6,192.168.200.24,0,FL1顶升上升SOL,Y167,Y167
DO,0,FL1顶升下降SOL,FL_TopCylinder_Down,7,192.168.200.24,0,FL1顶升下降SOL,Y168,Y168
DO,0,SL2提升伺服刹车ON,SL_UpAxis_BreakOn,8,192.168.200.24,0,SL2提升伺服刹车ON,Y169,Y169
...
...
source/DeviceLibrary/LineConfig/Config_FeedingEquip_3.csv
查看文件 @
c0a0de6
...
...
@@ -3,6 +3,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,2,,,,,
PRO,0,是否是用来出料,IsCanOut,0,,,,,
,,,,,,,,,
AXIS,0,批量上料轴,Batch_Axis,2,COM1,0,,,
PRO,0,批量上料轴待机点 P1,BatchAxisP1,2000,,,,,
...
...
source/DeviceLibrary/LineConfig/Config_FeedingEquip_4.csv
查看文件 @
c0a0de6
...
...
@@ -3,6 +3,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,3,,,,,
PRO,0,是否是用来出料,IsCanOut,1,,,,,
,,,,,,,,,
AXIS,0,批量上料轴,Batch_Axis,2,COM1,0,,,
PRO,0,批量上料轴待机点 P1,BatchAxisP1,2000,,,,,
...
...
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_1.csv
查看文件 @
c0a0de6
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,0,,,,,
\ No newline at end of file
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_2.csv
查看文件 @
c0a0de6
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,0,,,,,
\ No newline at end of file
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_3.csv
查看文件 @
c0a0de6
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,0,,,,,
\ No newline at end of file
source/DeviceLibrary/LineConfig/MoveEquip/Config_MoveEquip_17.csv
查看文件 @
c0a0de6
...
...
@@ -36,10 +36,10 @@ DI,18,进仓18夹料放松端,ClampCylinder_Tighten,1,192.168.200.46,0,进仓18夹料放松端
DI,18,进仓18升降上升端,UpDownCylinder_Up,2,192.168.200.46,0,进仓18升降上升端,X553,X553
DI,18,进仓18升降下降端,UpDownCylinder_Down,3,192.168.200.46,0,进仓18升降下降端,X554,X554
DI,204,出料4阻挡1托盘检测,StopCylinder_Check1,4,192.168.200.46,0,出料4阻挡1托盘检测,X555,X555
DI,
1000,环形线横移4托盘检测,SW4_SideWay_TrayCheck,5,192.168.200.46,0,环形线横移4
托盘检测,X556,X556
DI,
1000,环形线横移4料盘检测1,SW4_SideWay_ReelCheck,6,192.168.200.46,0,环形线横移4料盘检测1
,X557,X557
DI,
1000,环形线横移4顶升上升端,SW4_TopCylinder_Up,7,192.168.200.46,0,环形线横移
4顶升上升端,X558,X558
DI,
1000,环形线横移4顶升下降端,SW4_TopCylinder_Down,8,192.168.200.46,0,环形线横移
4顶升下降端,X559,X559
DI,
204,出料4阻挡2托盘检测,StopCylinder_Check2,5,192.168.200.46,0,出料4阻挡2
托盘检测,X556,X556
DI,
204,出料4料盘检测,TrayCheck,6,192.168.200.46,0,出料4料盘检测
,X557,X557
DI,
204,出料4顶升上升端,TopCylinder_UP,7,192.168.200.46,0,出料
4顶升上升端,X558,X558
DI,
204,出料4顶升下降端,TopCylinder_Down,8,192.168.200.46,0,出料
4顶升下降端,X559,X559
DI,204,出料4前后气缸前进端,BeforeAfterCylinder_Before,9,192.168.200.46,0,出料4前后气缸前进端,X560,X560
DI,204,出料4前后气缸后退端,BeforeAfterCylinder_After,10,192.168.200.46,0,出料4前后气缸后退端,X561,X561
DI,204,出料4夹料气缸夹紧端,ClampCylinder_Slack,11,192.168.200.46,0,出料4夹料气缸夹紧端,X562,X562
...
...
@@ -70,8 +70,8 @@ DO,18,进仓18升降上升SOL,UpDownCylinder_Up,2,192.168.200.46,0,进仓18升降上升SOL,Y
DO,18,进仓18升降下降SOL,UpDownCylinder_Down,3,192.168.200.46,0,进仓18升降下降SOL,Y554,Y554
DO,204,出料4阻挡1下降SOL,StopCylinder_Down1,4,192.168.200.46,0,出料4阻挡1下降SOL,Y555,Y555
DO,204,出料4阻挡2下降SOL,StopCylinder_Down2,5,192.168.200.46,0,出料4阻挡2下降SOL,Y556,Y556
DO,
1000,环形线横移4顶升上升SOL,SW4_TopCylinder_Up,6,192.168.200.46,0,环形线横移
4顶升上升SOL,Y557,Y557
DO,
1000,环形线横移4顶升下降SOL,SW4_TopCylinder_Down,7,192.168.200.46,0,环形线横移
4顶升下降SOL,Y558,Y558
DO,
204,出料4顶升上升SOL,TopCylinder_UP,6,192.168.200.46,0,出料
4顶升上升SOL,Y557,Y557
DO,
204,出料4顶升下降SOL,TopCylinder_Down,7,192.168.200.46,0,出料
4顶升下降SOL,Y558,Y558
DO,204,出料4前后气缸前进SOL,BeforeAfterCylinder_Before,8,192.168.200.46,,出料4前后气缸前进SOL,Y559,Y559
DO,204,出料4前后气缸后退SOL,BeforeAfterCylinder_After,9,192.168.200.46,,出料4前后气缸后退SOL,Y560,Y560
DO,204,出料4夹料气缸夹紧SOL,ClampCylinder_Slack,10,192.168.200.46,,出料4夹料气缸夹紧SOL,Y561,Y561
...
...
@@ -79,5 +79,11 @@ DO,204,出料4夹料气缸放松SOL,ClampCylinder_Tighten,11,192.168.200.46,,出料4夹料气
DO,204,出料4上下气缸上升SOL,UpDownCylinder_Up,12,192.168.200.46,,出料4上下气缸上升SOL,Y563,Y563
DO,204,出料4上下气缸下降SOL,UpDownCylinder_Down,13,192.168.200.46,,出料4上下气缸下降SOL,Y564,Y564
,,,,14,192.168.200.46,,,Y565,Y565
,,,,15,192.168.200.46,,,Y566,Y566
,,,,,,,,,
\ No newline at end of file
,,,,,,,,,
DI,1000,环形线横移4托盘检测,SW4_SideWay_TrayCheck,5,192.168.200.46,0,环形线横移4托盘检测,X556,X556
DI,1000,环形线横移4料盘检测1,SW4_SideWay_ReelCheck,6,192.168.200.46,0,环形线横移4料盘检测1,X557,X557
DI,1000,环形线横移4顶升上升端,SW4_TopCylinder_Up,7,192.168.200.46,0,环形线横移4顶升上升端,X558,X558
DI,1000,环形线横移4顶升下降端,SW4_TopCylinder_Down,8,192.168.200.46,0,环形线横移4顶升下降端,X559,X559
,,,,,,,,,
DO,1000,环形线横移4顶升上升SOL,SW4_TopCylinder_Up,6,192.168.200.46,0,环形线横移4顶升上升SOL,Y557,Y557
DO,1000,环形线横移4顶升下降SOL,SW4_TopCylinder_Down,7,192.168.200.46,0,环形线横移4顶升下降SOL,Y558,Y558
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
c0a0de6
...
...
@@ -194,7 +194,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 下降所有阻挡气缸
/// </summary>
internal
void
OpenStopCylinder
()
internal
v
irtual
v
oid
OpenStopCylinder
()
{
if
(
baseConfig
.
DType
.
Equals
(
DeviceType
.
MoveEquip
)
||
baseConfig
.
DType
.
Equals
(
DeviceType
.
ProvidingEquip
))
{
...
...
@@ -212,7 +212,7 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
TopCylinder_Down
,
IO_VALUE
.
HIGH
);
}
}
internal
void
CloseCylinderStop
()
internal
v
irtual
v
oid
CloseCylinderStop
()
{
if
(
baseConfig
.
DType
.
Equals
(
DeviceType
.
MoveEquip
)
||
baseConfig
.
DType
.
Equals
(
DeviceType
.
ProvidingEquip
))
{
...
...
@@ -238,7 +238,7 @@ namespace OnlineStore.DeviceLibrary
}
string
portName
=
axis
.
DeviceName
;
int
slvAddr
=
axis
.
GetAxisValue
();
IOMove
(
IO_Type
.
BatchAxis_ServoOn
,
IO_VALUE
.
HIGH
);
IOMove
(
axis
.
ServerOnDO
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
1000
);
//打开所有轴
ACServerManager
.
OpenPort
(
portName
);
...
...
@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
}
}
IsIntSlvBlock
=
true
;
IOMove
(
IO_Type
.
BatchAxis_BreakOn
,
IO_VALUE
.
HIGH
);
IOMove
(
axis
.
BreakOnDO
,
IO_VALUE
.
HIGH
);
return
true
;
}
...
...
@@ -314,14 +314,14 @@ namespace OnlineStore.DeviceLibrary
string
portName
=
axis
.
DeviceName
;
int
slvAddr
=
axis
.
GetAxisValue
();
LogUtil
.
info
(
Name
+
"关闭刹车,关闭伺服"
);
IOMove
(
IO_Type
.
BatchAxis_BreakOn
,
IO_VALUE
.
LOW
);
IOMove
(
axis
.
BreakOnDO
,
IO_VALUE
.
LOW
);
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
//关闭串口,等下次重新打开
ACServerManager
.
ColsePort
(
portName
);
Thread
.
Sleep
(
100
);
IOMove
(
IO_Type
.
BatchAxis_ServoOn
,
IO_VALUE
.
LOW
);
IOMove
(
axis
.
ServerOnDO
,
IO_VALUE
.
LOW
);
}
...
...
@@ -524,10 +524,10 @@ namespace OnlineStore.DeviceLibrary
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
}
else
if
(
wait
.
WaitType
.
Equals
(
10
))
{
wait
.
IsEnd
=
LineManager
.
Line
.
SideWay34HasTray
().
Equals
(
false
);
}
//
else if (wait.WaitType.Equals(10))
//
{
//
wait.IsEnd = LineManager.Line.SideWay34HasTray().Equals(false);
//
}
if
(
wait
.
IsEnd
&&
moveInfo
.
OneWaitCanEndStep
)
{
isOk
=
true
;
...
...
@@ -554,5 +554,20 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
protected
void
CheckLog
(
string
msg
)
{
LogUtil
.
debug
(
Name
+
msg
);
}
protected
void
InStoreLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
LogUtil
.
info
(
Name
+
"【"
+
posId
+
"】"
+
msg
);
}
protected
void
OutStoreLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
LogUtil
.
info
(
Name
+
"【"
+
posId
+
"】"
+
msg
);
}
}
}
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
c0a0de6
...
...
@@ -389,8 +389,58 @@ namespace OnlineStore.DeviceLibrary
{
}
protected
override
void
CheckFixtureProcess
()
{
/// <summary>
/// 是否需要拦截当前托盘进行处理
/// </summary>
/// <returns></returns>
internal
bool
NeedCurrTray
()
{
int
num
=
TrayManager
.
GetNum
(
Config
.
Id
);
bool
isFull
=
TrayManager
.
IsFixTureFull
(
num
);
if
(
Config
.
IsCanOut
.
Equals
(
1
))
{
if
(
isFull
&&
runStatus
.
Equals
(
LineRunStatus
.
Runing
)
&&
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
return
true
;
}
}
else
{
if
(!
isFull
&&
runStatus
.
Equals
(
LineRunStatus
.
Runing
)
&&
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
))
{
return
true
;
}
}
return
false
;
}
/// <summary>
/// 下降所有阻挡气缸
/// </summary>
internal
override
void
OpenStopCylinder
()
{
if
(
Config
.
SidesWayNum
<=
0
)
{
LogInfo
(
"下降阻挡气缸,下降顶升气缸 "
);
IOMove
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
FL_StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
//顶升气缸下降
IOMove
(
IO_Type
.
FL_TopCylinder_Up
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
FL_TopCylinder_Down
,
IO_VALUE
.
HIGH
);
}
}
internal
override
void
CloseCylinderStop
()
{
if
(
Config
.
SidesWayNum
<=
0
)
{
LogInfo
(
"上升阻挡气缸,关闭 顶升气缸IO"
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
);
//顶升气缸下降
IOMove
(
IO_Type
.
FL_TopCylinder_Up
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
FL_TopCylinder_Down
,
IO_VALUE
.
LOW
);
}
}
}
}
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
查看文件 @
c0a0de6
...
...
@@ -10,6 +10,223 @@ namespace OnlineStore.DeviceLibrary
{
partial
class
FeedingEquip
{
#
region
托盘检测
private
void
StartCheckFixture
()
{
int
num
=
TrayManager
.
GetNum
(
DeviceID
);
if
(
IOValue
(
IO_Type
.
StopCylinder_Check2
).
Equals
(
IO_VALUE
.
HIGH
))
{
//托盘在两个阻挡内
if
(
num
>
0
)
{
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
2
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
));
}
else
{
LogUtil
.
error
(
Name
+
"检测到check4亮,但是为获取到托盘号,StartCheckFixture失败~"
);
}
}
else
if
(
IOValue
(
IO_Type
.
StopCylinder_Check1
).
Equals
(
IO_VALUE
.
HIGH
))
{
//托盘在第一个阻挡处
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopCylinder1Down
);
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
2
);
CheckLog
(
" 托盘检测:料盘检测 SecondStoreMove(MIO_01_StopCylinder1Down阻挡气缸1-1下降 ,最多等待1秒)"
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1500
));
}
}
protected
override
void
CheckFixtureProcess
()
{
if
(!
LineManager
.
Line
.
LineCanRun
())
{
return
;
}
if
(
SecondMoveInfo
.
IsInWait
)
{
CheckWait
(
SecondMoveInfo
);
}
if
(
SecondMoveInfo
.
IsInWait
)
{
return
;
}
#
region
托盘检测
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_01_StopCylinder1Down
))
{
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_02_FixtureCheck 阻挡气缸1-1上升,等待 阻挡2托盘检测=1)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Check2
,
IO_VALUE
.
HIGH
));
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_02_FixtureCheck
))
{
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
));
// SecondMoveInfo.EndStepWait();
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_03_StopCylinder2Down
))
{
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_04_Wait ,等待编码信号稳定)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_04_Wait
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_04_Wait
))
{
try
{
//判断是否需要顶升
// bool isNeed = false;
//此处先对托盘号进行验证
currMoveTrayNum
=
TrayManager
.
GetNum
(
DeviceID
);
bool
isFull
=
TrayManager
.
IsFixTureFull
(
currMoveTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currMoveTrayNum
,
preTrayNum
,
false
))
{
//出料中,需要拦盘
if
(
NeedCurrTray
())
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currMoveTrayNum
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_05_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
return
;
}
}
else
{
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currMoveTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
LogUtil
.
error
(
msg
);
return
;
}
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
currMoveTrayNum
+
"】没有出入料任务,放盘通过~"
);
// preTrayNum = currMoveTrayNum;
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
{
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"判断托盘是否需要顶升出错:"
+
ex
.
ToString
());
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_05_WaitTime
))
{
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_06_TopCylinderUp 顶升气缸上 升 )"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_06_TopCylinderUp
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_UP
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_06_TopCylinderUp
))
{
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_07_TopCylinderUpWait ,顶升气缸上升时等待1秒钟,再下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_07_TopCylinderUpWait
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_07_TopCylinderUpWait
))
{
CheckLog
(
"托盘检测(流水线阻挡)*************** 托盘号【"
+
currMoveTrayNum
+
"】"
);
//托盘号正确
//preTrayNum = num;
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
if
(
CheckIsNeedOutStore
())
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currMoveTrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currMoveTrayNum
+
"】可以放出料托盘,正在出料中,移栽料盘"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_05_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
}
else
{
//preTrayNum = num;
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
{
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
CheckLog
(
"托盘检测 SecondStoreMove:(MO_09_TopCylinder_Down ,托盘号【"
+
currMoveTrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_06_TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_08_WaitInStore
)
&&
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
CheckLog
(
"托盘放行 SecondStoreMove:(MIO_09_WaitLetFixtureGo ,等待移栽完成后放开阻挡)"
);
StartOutStoreMove
(
SecondMoveInfo
.
MoveParam
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_09_WaitLetFixtureGo
);
}
#
endregion
#
region
不需要出出料,直接放行
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_06_TopCylinder_Down
))
{
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
//更新横移托盘已处理完成
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
1
);
//if (DeviceID.Equals(2))
//{
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
// SecondMoveInfo.OneWaitCanEndStep = true;
//}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_07_WaitCanGo
))
{
CheckLog
(
"托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_10_StopCylinder2_Down
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
HIGH
));
// SecondMoveInfo.EndStepWait();
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_10_StopCylinder2_Down
))
{
CheckLog
(
"托盘放行 SecondStoreMove:(MO_11_Tray_Check , 阻挡2托盘检测=0), 延时2秒)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_Tray_Check
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Check2
,
IO_VALUE
.
LOW
));
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_11_Tray_Check
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_12_StopCylinder_Back
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_12_StopCylinder_Back , 阻挡气缸1-2上升 )"
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_12_StopCylinder_Back
))
{
preTrayNum
=
currMoveTrayNum
;
CheckLog
(
"托盘放行 SecondStoreMove:(托盘放行结束) "
);
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo
.
EndMove
();
}
#
endregion
}
private
bool
CheckIsNeedOutStore
()
{
throw
new
NotImplementedException
();
}
#
endregion
public
override
void
StartInStoreMove
(
InOutParam
param
)
{
throw
new
NotImplementedException
();
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
c0a0de6
...
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
partial
class
LineBean
:
KTK_Store
{
/// <summary>
/// 是否没有扫到码
/// </summary>
...
...
@@ -64,8 +64,8 @@ namespace OnlineStore.DeviceLibrary
baseConfig
=
lineConfig
;
this
.
Config
=
lineConfig
;
this
.
DeviceID
=
lineConfig
.
Id
;
SW
12_MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"横移轨道-12
"
);
SW
34_MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"横移轨道-34
"
);
SW
41_MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"横移轨道-41
"
);
SW
23_MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"横移轨道-23
"
);
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"流水线-Move "
);
Name
=
(
" 流水线_"
+
Config
.
CID
+
" "
).
ToUpper
();
...
...
@@ -217,7 +217,7 @@ namespace OnlineStore.DeviceLibrary
}
private
void
RHomeOp
()
{
TrayManager
.
SidesWayStateMap
=
new
Dictionary
<
int
,
int
>();
alarmType
=
LineAlarmType
.
None
;
mainTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
...
...
@@ -226,8 +226,7 @@ namespace OnlineStore.DeviceLibrary
isNoAirCheck
=
false
;
alarmType
=
LineAlarmType
.
None
;
TrayManager
.
TrayErrorMsg
=
""
;
WarnMsg
=
""
;
preTrayNum
=
0
;
WarnMsg
=
""
;
PreIsHasProcess
=
true
;
if
(
TrayManager
.
ErrorStoreId
>
0
)
...
...
@@ -244,8 +243,8 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
null
,
IO_Type
.
NGCylinder_Before
,
IO_Type
.
NGCylinder_After
);
////阻挡都上升
//IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
//IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
//IOMove(IO_Type.
FL_
StopCylinder_Down1, IO_VALUE.LOW);
//IOMove(IO_Type.
FL_
StopCylinder_Down2, IO_VALUE.LOW);
//横移轨道下降
SideWayReset
();
}
...
...
@@ -375,11 +374,11 @@ namespace OnlineStore.DeviceLibrary
{
return
true
;
}
if
(
SW
12
_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
if
(
SW
41
_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
return
true
;
}
if
(
SW
34
_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
if
(
SW
23
_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
return
true
;
}
...
...
@@ -888,7 +887,7 @@ namespace OnlineStore.DeviceLibrary
string
wareNum
=
serverResult
.
barcode
;
int
trayCode
=
TrayManager
.
GetNum
(
0
);
LogUtil
.
info
(
"更新盘空满信息,托盘号【"
+
trayCode
+
"】,是否有料盘【"
+
true
+
"】,出库入库【"
+
1
+
"】"
);
TrayManager
.
UpdateFixtureValue
(
trayCode
,
true
,
1
);
TrayManager
.
UpdateFixtureValue
(
trayCode
,
true
,
1
,
wareNum
,
posId
,
plateH
,
plateW
);
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if
(
LineServer
.
BoxCanInStore
(
moveEquip
.
DeviceID
))
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
c0a0de6
...
...
@@ -9,18 +9,14 @@ using System.Threading.Tasks;
namespace
OnlineStore.DeviceLibrary
{
partial
class
LineBean
{
/// <summary>
/// 上一个盘号
/// </summary>
private
int
preTrayNum
=
0
;
{
#
region
定时处理方法
private
DateTime
NextScanTime
=
DateTime
.
Now
;
private
DateTime
NextEmptyGo
=
DateTime
.
Now
;
private
bool
IsWaitToScan
=
false
;
private
bool
IsWaitEmptyGo
=
false
;
private
bool
isWaitOutGo
=
false
;
private
DateTime
WaitOutGoTime
=
DateTime
.
Now
;
//
private DateTime NextScanTime = DateTime.Now;
//
private DateTime NextEmptyGo = DateTime.Now;
//
private bool IsWaitToScan = false;
//
private bool IsWaitEmptyGo = false;
//
private bool isWaitOutGo = false;
//
private DateTime WaitOutGoTime = DateTime.Now;
public
bool
LineCanRun
()
...
...
@@ -38,7 +34,7 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
IOValue
(
IO_Type
.
DriveMotor_Run1
,
0
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
DriveMotor_Run2
,
0
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
DriveMotor_Run3
,
0
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
DriveMotor_Run4
,
0
).
Equals
(
IO_VALUE
.
HIGH
)
)
IOManager
.
IOValue
(
IO_Type
.
DriveMotor_Run4
,
0
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
isCheckSleep
)
{
...
...
@@ -69,12 +65,12 @@ namespace OnlineStore.DeviceLibrary
isInprocess
=
true
;
lastProTime
=
DateTime
.
Now
;
//出入料口条件: 各料仓无报警( 伺服), 各移栽装置处 于原位待机, 检测夹具IO,驱动电机运转
if
(!
CanProcessLine
(
false
))
{
isWaitOutGo
=
false
;
isInprocess
=
false
;
return
;
}
//
if (!CanProcessLine(false))
//
{
//
isWaitOutGo = false;
//
isInprocess = false;
//
return;
//
}
//if (IOValue(IO_Type.Fixture_Check_4).Equals(IO_VALUE.LOW))
//{
...
...
@@ -248,7 +244,7 @@ namespace OnlineStore.DeviceLibrary
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if
(
MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
SW
12_MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
SW34
_MoveInfo
.
IsInWait
.
Equals
(
false
))
if
(
MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
SW
41_MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
SW23
_MoveInfo
.
IsInWait
.
Equals
(
false
))
{
LogUtil
.
info
(
Name
+
"清理信号超时报警【"
+
WarnMsg
+
"】 "
);
alarmType
=
LineAlarmType
.
None
;
...
...
@@ -538,85 +534,56 @@ namespace OnlineStore.DeviceLibrary
#
region
横移处理
private
static
LineMoveInfo
SW
12
_MoveInfo
=
null
;
private
static
LineMoveInfo
SW
34
_MoveInfo
=
null
;
private
static
LineMoveInfo
SW
41
_MoveInfo
=
null
;
private
static
LineMoveInfo
SW
23
_MoveInfo
=
null
;
private
bool
SideWayReset
()
{
SideWayStop
();
CylinderMove
(
null
,
IO_Type
.
SW1_TopCylinder_Up
,
IO_Type
.
SW1_TopCylinder_Down
);
CylinderMove
(
null
,
IO_Type
.
SW1_TopCylinder_Up
,
IO_Type
.
SW1_TopCylinder_Down
);
CylinderMove
(
null
,
IO_Type
.
SW4_TopCylinder_Up
,
IO_Type
.
SW4_TopCylinder_Down
);
SideWay12TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
null
);
SideWay34TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
null
);
CylinderMove
(
null
,
IO_Type
.
SW1_LocationCylinder_Up
,
IO_Type
.
SW1_LocationCylinder_Down
);
CylinderMove
(
null
,
IO_Type
.
SW4_LocationCylinder_Up
,
IO_Type
.
SW4_LocationCylinder_Down
);
return
true
;
}
private
void
SideWayStop
()
{
SideWay
12
IsWait
=
false
;
SideWay
34
IsWait
=
false
;
SideWay
41
IsWait
=
false
;
SideWay
23
IsWait
=
false
;
SW
12
_MoveInfo
.
EndMove
();
SW
34
_MoveInfo
.
EndMove
();
SW
41
_MoveInfo
.
EndMove
();
SW
23
_MoveInfo
.
EndMove
();
//IOMove(IO_Type.SidesWay12_DriveMotor, IO_VALUE.LOW);
//IOMove(IO_Type.SidesWay34_DriveMotor, IO_VALUE.LOW);
////阻挡气缸先上升
//IOMove(IO_Type.SidesWay1_StopCylinderDown, IO_VALUE.LOW);
//IOMove(IO_Type.SidesWay3_StopCylinderDown, IO_VALUE.LOW);
}
public
void
SideWay12TopCylinderMove
(
IO_VALUE
downValue
,
IO_VALUE
upValue
,
LineMoveInfo
moveInfo
=
null
)
{
//IOMove(IO_Type.SidesWay12_TopCylinder_Down, downValue);
//IOMove(IO_Type.SidesWay12_TopCylinder_Up, upValue);
//if (moveInfo != null)
//{
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay1_TopCylinder_Down, downValue));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay1_TopCylinder_Up, upValue));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay2_TopCylinder_Down, downValue));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay2_TopCylinder_Up, upValue));
// moveInfo.WriteIoList.Add(WriteIOInfo.NInfo(IO_Type.SidesWay12_TopCylinder_Down, downValue));
// moveInfo.WriteIoList.Add(WriteIOInfo.NInfo(IO_Type.SidesWay12_TopCylinder_Up, upValue));
//}
}
public
void
SideWay34TopCylinderMove
(
IO_VALUE
downValue
,
IO_VALUE
upValue
,
LineMoveInfo
moveInfo
=
null
)
{
//IOMove(IO_Type.SidesWay34_TopCylinder_Down, downValue);
//IOMove(IO_Type.SidesWay34_TopCylinder_Up, upValue);
//if (moveInfo != null)
//{
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay3_TopCylinder_Down, downValue));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay3_TopCylinder_Up, upValue));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay4_TopCylinder_Down, downValue));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay4_TopCylinder_Up, upValue));
// moveInfo.WriteIoList.Add(WriteIOInfo.NInfo(IO_Type.SidesWay34_TopCylinder_Down, downValue));
// moveInfo.WriteIoList.Add(WriteIOInfo.NInfo(IO_Type.SidesWay34_TopCylinder_Up, upValue));
//}
}
/// <summary>
/// 判断横移轨道34是否有托盘
/// </summary>
/// <returns></returns>
public
bool
SideWay34HasTray
()
{
////正在横移中,且托盘顶升气缸未下降
//if (SW34_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false) && SW34_MoveInfo.MoveStep <= LineMoveStep.SW07_TopCylinderDown)
//{
// return true;
//}
//if (IOValue(IO_Type.SidesWay3_FixtureCheck).Equals(IO_VALUE.HIGH))
//{
// return true;
//}
return
false
;
}
private
DateTime
SideWay12Ntime
=
DateTime
.
Now
;
private
bool
SideWay12IsWait
=
false
;
private
DateTime
SideWay34Ntime
=
DateTime
.
Now
;
private
bool
SideWay34IsWait
=
false
;
IOMove
(
IO_Type
.
SW1_MotorRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW2_MotorRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW3_MotorRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW4_MotorRun
,
IO_VALUE
.
LOW
);
}
///// <summary>
///// 判断横移轨道23是否有托盘
///// </summary>
///// <returns></returns>
//public bool SideWay23HasTray()
//{
// //正在横移中,且托盘顶升气缸未下降
// if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false) && SW23_MoveInfo.MoveStep <= LineMoveStep.SW07_TopCylinderDown)
// {
// return true;
// }
// if (IOValue(IO_Type.SW2_TrayCheck).Equals(IO_VALUE.HIGH)&&IOValue(IO_Type.SW3_TrayCheck).Equals(IO_VALUE.LOW))
// {
// return true;
// }
// return false;
//}
private
DateTime
SideWay41Ntime
=
DateTime
.
Now
;
private
bool
SideWay41IsWait
=
false
;
private
DateTime
SideWay23Ntime
=
DateTime
.
Now
;
private
bool
SideWay23IsWait
=
false
;
private
bool
sdIsInprocess
=
false
;
...
...
@@ -631,93 +598,93 @@ namespace OnlineStore.DeviceLibrary
try
{
sdIsInprocess
=
true
;
sdlastProTime
=
DateTime
.
Now
;
////流水线转动中,并且在忙碌或出入库处理中,需要处理移栽
//if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH) && runStatus >= LineRunStatus.Runing)
//{
// if (SW12_MoveInfo.MoveType.Equals(LineMoveType.None) && IOValue(IO_Type.SidesWay2_FixtureCheck).Equals(IO_VALUE.LOW))
// {
// TimeSpan span12 = DateTime.Now - SideWay12Ntime;
// //检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
// //顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡2下降,盘通过
// if (IOValue(IO_Type.SidesWay1_StopFixtureCheck).Equals(IO_VALUE.HIGH))
// {
// if (SideWay12IsWait && span12.TotalSeconds > 1)
// {
// SWLog("横移轨道阻挡1检测到托盘,开始移动托盘,下降横移气缸12");
// SW12_MoveInfo.NewMove(LineMoveType.InStore);
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW00_Wait);
// SideWay12TopCylinderMove(IO_VALUE.HIGH, IO_VALUE.LOW, SW12_MoveInfo);
// }
// else if (!SideWay12IsWait)
// {
// SideWay12IsWait = true;
// SideWay12Ntime = DateTime.Now;
// }
// }
// else if (IOValue(IO_Type.SidesWay1_FixtureCheck).Equals(IO_VALUE.HIGH))
// {
// if (SideWay12IsWait && span12.TotalSeconds > 1)
// {
// SWLog("横移轨道1检测到托盘,阻挡1上升,等待横移1夹具检测信号");
// SW12_MoveInfo.NewMove(LineMoveType.InStore);
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
// IOMove(IO_Type.SidesWay1_StopCylinderDown, IO_VALUE.LOW);
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay1_FixtureCheck, IO_VALUE.HIGH));
// }
// else if (!SideWay12IsWait)
// {
// SideWay12IsWait = true;
// SideWay12Ntime = DateTime.Now;
// }
// }
// else
// {
// SideWay12IsWait = false;
// }
// }
// else
// {
// SideWay12IsWait = false;
// SideWay12BusyProcess();
// }
//流水线转动中,并且在忙碌或出入库处理中,需要处理移栽
if
(!
CanProcessLine
())
{
SideWay23IsWait
=
false
;
SideWay41IsWait
=
false
;
sdIsInprocess
=
false
;
return
;
}
if
(
SW41_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
if
(
IOValue
(
IO_Type
.
SW4_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
SW1_TrayCheck
).
Equals
(
IO_VALUE
.
LOW
)&&
TrayManager
.
CanMoveSidesWay
(
4
)&&
TrayManager
.
CanMoveSidesWay
(
1
))
{
TimeSpan
span12
=
DateTime
.
Now
-
SideWay41Ntime
;
if
(
SideWay41IsWait
&&
span12
.
TotalSeconds
>
1
)
{
SWLog
(
"横移轨道4检测到托盘,定位气缸下降"
);
SW41_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_LocationCylinderDown
);
//IOMove(IO_Type.SW1_StopCylinderDown, IO_VALUE.LOW);
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
//CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
//CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW1_LocationCylinder_Up
,
IO_Type
.
SW1_LocationCylinder_Down
);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW4_LocationCylinder_Up
,
IO_Type
.
SW4_LocationCylinder_Down
);
}
else
if
(!
SideWay41IsWait
)
{
SideWay41IsWait
=
true
;
SideWay41Ntime
=
DateTime
.
Now
;
}
}
else
{
SideWay41IsWait
=
false
;
}
}
else
{
SideWay41IsWait
=
false
;
SideWay41BusyProcess
();
}
if
(
SW23_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
//检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
//顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡4下降,盘通过
if
(
IOValue
(
IO_Type
.
SW2_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
SW3_TrayCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
TrayManager
.
CanMoveSidesWay
(
2
)
&&
TrayManager
.
CanMoveSidesWay
(
3
))
{
TimeSpan
span34
=
DateTime
.
Now
-
SideWay23Ntime
;
if
(
SideWay23IsWait
&&
span34
.
TotalSeconds
>
1
)
{
SWLog
(
"横移轨道2检测到托盘,定位气缸下降"
);
SW23_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_LocationCylinderDown
);
//IOMove(IO_Type.SW3_StopCylinderDown, IO_VALUE.HIGH);
//SideWay23TopCylinderMove(IO_VALUE.HIGH, IO_VALUE.LOW, SW23_MoveInfo);
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
//CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
//CylinderMove(SW23_MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_LocationCylinder_Up
,
IO_Type
.
SW2_LocationCylinder_Down
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW3_LocationCylinder_Up
,
IO_Type
.
SW3_LocationCylinder_Down
);
}
else
if
(!
SideWay23IsWait
)
{
SideWay23IsWait
=
true
;
SideWay23Ntime
=
DateTime
.
Now
;
}
}
else
{
SideWay23IsWait
=
false
;
}
}
else
{
SideWay23IsWait
=
false
;
SideWay23BusyProcess
();
}
// if (SW34_MoveInfo.MoveType.Equals(LineMoveType.None) && IOValue(IO_Type.SidesWay4_FixtureCheck).Equals(IO_VALUE.LOW))
// {
// TimeSpan span34 = DateTime.Now - SideWay34Ntime;
// //检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
// //顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡4下降,盘通过
// if (IOValue(IO_Type.SidesWay3_FixtureCheck).Equals(IO_VALUE.HIGH))
// {
// if (SideWay34IsWait && span34.TotalSeconds > 1)
// {
// SWLog("横移轨道3检测到托盘,开始移动托盘");
// SW34_MoveInfo.NewMove(LineMoveType.InStore);
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopCylinderDown);
// IOMove(IO_Type.SidesWay3_StopCylinderDown, IO_VALUE.HIGH);
// SideWay34TopCylinderMove(IO_VALUE.HIGH, IO_VALUE.LOW, SW34_MoveInfo);
// }
// else if (!SideWay34IsWait)
// {
// SideWay34IsWait = true;
// SideWay34Ntime = DateTime.Now;
// }
// }
// else
// {
// SideWay34IsWait = false;
// }
// }
// else
// {
// SideWay34IsWait = false;
// SideWay34BusyProcess();
// }
//}
//else
//{
// SideWay34IsWait = false;
// SideWay12IsWait = false;
//}
}
catch
(
Exception
ex
)
{
...
...
@@ -726,167 +693,210 @@ namespace OnlineStore.DeviceLibrary
sdIsInprocess
=
false
;
}
private
void
SideWay
12
BusyProcess
()
private
void
SideWay
41
BusyProcess
()
{
if
(
SW
12
_MoveInfo
.
IsInWait
)
if
(
SW
41
_MoveInfo
.
IsInWait
)
{
CheckWait
(
SW
12
_MoveInfo
);
CheckWait
(
SW
41
_MoveInfo
);
}
if
(
SW
12
_MoveInfo
.
IsInWait
)
if
(
SW
41
_MoveInfo
.
IsInWait
)
{
return
;
}
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_LocationCylinderDown
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SWLog
(
"横移轨道41: 等待横移4托盘检测信号 "
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW4_TrayCheck
,
IO_VALUE
.
HIGH
));
}
//if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopCylinderDown);
// SWLog("横移轨道12:阻挡1下降,最多下降1000 ");
// IOMove(IO_Type.SidesWay1_StopCylinderDown, IO_VALUE.HIGH);
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW01_StopCylinderDown))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
// SWLog("横移轨道12:阻挡1上升,等待横移1夹具检测信号 ");
// IOMove(IO_Type.SidesWay1_StopCylinderDown, IO_VALUE.LOW);
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay1_FixtureCheck, IO_VALUE.HIGH));
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW02_WaitFixtureCheck))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW03_TopCylinderUp);
// SWLog("横移轨道12:顶升气缸上升 ,横移1阻挡上升 ,至少等待1000 ");
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// IOMove(IO_Type.SidesWay1_StopCylinderDown, IO_VALUE.LOW);
// SideWay12TopCylinderMove(IO_VALUE.LOW, IO_VALUE.HIGH, SW12_MoveInfo);
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW03_TopCylinderUp))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW04_DriveMotorMove);
// SWLog("横移轨道12:开始转动电机 ,等待1000,等待SidesWay2_FixtureCheck=1, SidesWay1_FixtureCheck=0 ");
// IOMove(IO_Type.SidesWay12_DriveMotor, IO_VALUE.HIGH);
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay2_FixtureCheck, IO_VALUE.HIGH));
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay1_FixtureCheck, IO_VALUE.LOW));
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW04_DriveMotorMove))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW05_WaitOutFixtureCheck);
// SWLog("横移轨道12:等待托盘到达出口 ");
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay2_FixtureCheck, IO_VALUE.HIGH));
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW05_WaitOutFixtureCheck))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW06_WatOutFixture2);
// SWLog("横移轨道12:再次验证托盘是否在出口处 ");
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay2_FixtureCheck, IO_VALUE.HIGH));
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW02_WaitFixtureCheck
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW03_TopCylinderUp
);
SWLog
(
"横移轨道41:顶升气缸上升 ,至少等待1000 "
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW4_TopCylinder_Down
,
IO_Type
.
SW4_TopCylinder_Up
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW1_TopCylinder_Down
,
IO_Type
.
SW1_TopCylinder_Up
);
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW03_TopCylinderUp
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW04_DriveMotorMove
);
SWLog
(
"横移轨道41:开始转动电机 ,等待1000,SW4_TrayCheck=0, SW1_TrayCheck=1 "
);
IOMove
(
IO_Type
.
SW4_MotorRun
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SW1_MotorRun
,
IO_VALUE
.
HIGH
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW1_TrayCheck
,
IO_VALUE
.
HIGH
));
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW4_TrayCheck
,
IO_VALUE
.
LOW
));
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW04_DriveMotorMove
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
);
SWLog
(
"横移轨道41:等待托盘到达出口 "
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
800
));
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW1_TrayCheck
,
IO_VALUE
.
HIGH
));
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW06_WatOutFixture2
);
SWLog
(
"横移轨道41:再次验证托盘是否在出口处 "
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW1_TrayCheck
,
IO_VALUE
.
HIGH
));
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW06_WatOutFixture2))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW07_TopCylinderDown);
// SWLog("横移轨道12:托盘已到达出口,顶升气缸下降 ");
// SideWay12TopCylinderMove(IO_VALUE.HIGH, IO_VALUE.LOW, SW12_MoveInfo);
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_TopCylinderDown))
//{
// SW12_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitTrayGo);
// SWLog("横移轨道12:等待SidesWay2_FixtureCheck=0,最多等待5秒,关闭横移电机 ");
// IOMove(IO_Type.SidesWay12_DriveMotor, IO_VALUE.LOW);
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay2_FixtureCheck, IO_VALUE.LOW));
// SW12_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
// SW12_MoveInfo.OneWaitCanEndStep = true;
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_StopDrive))
//{
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW06_WatOutFixture2
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW07_TopCylinderDown
);
SWLog
(
"横移轨道41:托盘已到达出口,顶升气缸下降,判断入料1是否需要此托盘 "
);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW4_TopCylinder_Up
,
IO_Type
.
SW4_TopCylinder_Down
);
if
(!
CheckTrayIsNeed
(
101
))
{
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW1_TopCylinder_Up
,
IO_Type
.
SW1_TopCylinder_Down
);
}
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW07_TopCylinderDown
))
{
if
(
CheckTrayIsNeed
(
101
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道41:关闭皮带电机,不需要等待 托盘离开"
);
IOMove
(
IO_Type
.
SW4_MotorRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW1_MotorRun
,
IO_VALUE
.
LOW
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW4_MotorRun
,
IO_VALUE
.
LOW
));
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW1_MotorRun
,
IO_VALUE
.
LOW
));
}
else
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道41:关闭皮带电机,等待SW1_TrayCheck=0,最多等待5秒,关闭横移电机 "
);
IOMove
(
IO_Type
.
SW4_MotorRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW1_MotorRun
,
IO_VALUE
.
LOW
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW1_TrayCheck
,
IO_VALUE
.
LOW
));
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
SW41_MoveInfo
.
OneWaitCanEndStep
=
true
;
}
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW08_StopDrive
))
{
//}
//else if (SW12_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitTrayGo))
//{
// SW12_MoveInfo.EndMove();
// SWLog("横移轨道12:横移结束 ");
//}
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW09_WaitTrayGo
))
{
SW41_MoveInfo
.
EndMove
();
SWLog
(
"横移轨道41:横移结束 "
);
TrayManager
.
UpdateSWState
(
4
,
0
);
TrayManager
.
UpdateSWState
(
1
,
0
);
}
}
private
void
SideWay34BusyProcess
()
private
bool
CheckTrayIsNeed
(
int
deviceId
)
{
//横移1对应入料1
if
(
FeedingEquipMap
.
ContainsKey
(
deviceId
))
{
FeedingEquip
equip
=
FeedingEquipMap
[
deviceId
];
if
(
equip
.
runStatus
>=
LineRunStatus
.
Runing
)
{
if
(
equip
.
NeedCurrTray
())
{
return
true
;
}
}
}
return
false
;
}
private
void
SideWay23BusyProcess
()
{
if
(
SW
34
_MoveInfo
.
IsInWait
)
if
(
SW
23
_MoveInfo
.
IsInWait
)
{
CheckWait
(
SW
34
_MoveInfo
);
CheckWait
(
SW
23
_MoveInfo
);
}
if
(
SW
34
_MoveInfo
.
IsInWait
)
if
(
SW
23
_MoveInfo
.
IsInWait
)
{
return
;
}
//if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopCylinderDown);
// SWLog("横移轨道34:阻挡3下降,最多下降1000 ");
// IOMove(IO_Type.SidesWay3_StopCylinderDown, IO_VALUE.HIGH);
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW01_StopCylinderDown))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
// SWLog("横移轨道34:横移3阻挡上升,等待横移3夹具检测信号 ");
// IOMove(IO_Type.SidesWay3_StopCylinderDown, IO_VALUE.LOW);
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay3_FixtureCheck, IO_VALUE.HIGH));
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW02_WaitFixtureCheck))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW03_TopCylinderUp);
// SWLog("横移轨道34:顶升气缸上升 ,横移3阻挡上升,至少等待1000 ");
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// IOMove(IO_Type.SidesWay3_StopCylinderDown, IO_VALUE.LOW);
// SideWay34TopCylinderMove(IO_VALUE.LOW, IO_VALUE.HIGH, SW34_MoveInfo);
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW03_TopCylinderUp))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW04_DriveMotorMove);
// SWLog("横移轨道34:开始转动电机 ,等待1000 ,等待SidesWay4_FixtureCheck=1 ,SidesWay3_FixtureCheck=0 ");
// IOMove(IO_Type.SidesWay34_DriveMotor, IO_VALUE.HIGH);
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay4_FixtureCheck, IO_VALUE.HIGH));
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay3_FixtureCheck, IO_VALUE.LOW));
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW04_DriveMotorMove))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW05_WaitOutFixtureCheck);
// SWLog("横移轨道34:等待托盘到达出口 ");
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay4_FixtureCheck, IO_VALUE.HIGH));
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW05_WaitOutFixtureCheck))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW06_WatOutFixture2);
// SWLog("横移轨道34:再次验证托盘是否到达出口 ");
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay4_FixtureCheck, IO_VALUE.HIGH));
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW06_WatOutFixture2))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW07_TopCylinderDown);
// SWLog("横移轨道34:托盘已到达出口,顶升气缸下降 ");
// SideWay34TopCylinderMove(IO_VALUE.HIGH, IO_VALUE.LOW, SW34_MoveInfo);
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW07_TopCylinderDown))
//{
// SW34_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitTrayGo);
// SWLog("横移轨道34:等待SidesWay4_FixtureCheck=0 ,最多等待5秒,关闭横移电机 ");
// IOMove(IO_Type.SidesWay34_DriveMotor, IO_VALUE.LOW);
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SidesWay4_FixtureCheck, IO_VALUE.LOW));
// SW34_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
// SW34_MoveInfo.OneWaitCanEndStep = true;
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW08_StopDrive))
//{
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_LocationCylinderDown
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SWLog
(
"横移轨道23: 等待横移4托盘检测信号 "
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW2_TrayCheck
,
IO_VALUE
.
HIGH
));
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW02_WaitFixtureCheck
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW03_TopCylinderUp
);
SWLog
(
"横移轨道23:顶升气缸上升 ,至少等待1000 "
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_TopCylinder_Down
,
IO_Type
.
SW2_TopCylinder_Up
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW3_TopCylinder_Down
,
IO_Type
.
SW3_TopCylinder_Up
);
//}
//else if (SW34_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitTrayGo))
//{
// SW34_MoveInfo.EndMove();
// SWLog("横移轨道34:横移结束 ");
//}
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW03_TopCylinderUp
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW04_DriveMotorMove
);
SWLog
(
"横移轨道23:开始转动电机 ,等待1000,SW2_TrayCheck=0, SW3_TrayCheck=1 "
);
IOMove
(
IO_Type
.
SW2_MotorRun
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SW3_MotorRun
,
IO_VALUE
.
HIGH
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW3_TrayCheck
,
IO_VALUE
.
HIGH
));
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW2_TrayCheck
,
IO_VALUE
.
LOW
));
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW04_DriveMotorMove
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
);
SWLog
(
"横移轨道23:等待托盘到达出口 "
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
800
));
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW3_TrayCheck
,
IO_VALUE
.
HIGH
));
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW06_WatOutFixture2
);
SWLog
(
"横移轨道23:再次验证托盘是否在出口处 "
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW3_TrayCheck
,
IO_VALUE
.
HIGH
));
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW06_WatOutFixture2
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW07_TopCylinderDown
);
SWLog
(
"横移轨道23:托盘已到达出口,顶升气缸下降 "
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_TopCylinder_Up
,
IO_Type
.
SW2_TopCylinder_Down
);
if
(!
CheckTrayIsNeed
(
104
))
{
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW3_TopCylinder_Up
,
IO_Type
.
SW3_TopCylinder_Down
);
}
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW07_TopCylinderDown
))
{
if
(
CheckTrayIsNeed
(
104
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道41:关闭皮带电机,不需要等待 托盘离开"
);
IOMove
(
IO_Type
.
SW2_MotorRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW3_MotorRun
,
IO_VALUE
.
LOW
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW2_MotorRun
,
IO_VALUE
.
LOW
));
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW3_MotorRun
,
IO_VALUE
.
LOW
));
}
else
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道23:关闭皮带电机,等待SW3_TrayCheck=0,最多等待5秒,关闭横移电机 "
);
IOMove
(
IO_Type
.
SW2_MotorRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW3_MotorRun
,
IO_VALUE
.
LOW
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW3_TrayCheck
,
IO_VALUE
.
LOW
));
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
SW23_MoveInfo
.
OneWaitCanEndStep
=
true
;
}
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW08_StopDrive
))
{
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW09_WaitTrayGo
))
{
SW23_MoveInfo
.
EndMove
();
SWLog
(
"横移轨道23:横移结束 "
);
TrayManager
.
UpdateSWState
(
2
,
0
);
TrayManager
.
UpdateSWState
(
3
,
0
);
}
}
private
void
SWLog
(
string
msg
)
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
c0a0de6
...
...
@@ -38,7 +38,10 @@ namespace OnlineStore.DeviceLibrary
Config
.
UpDown_Axis
.
DelSpeed
=
Config
.
UpdownAxis_DelSpeed
;
Config
.
UpDown_Axis
.
HomeAddSpeed
=
Config
.
UpdownAxis_HomeAddSpeed
;
Config
.
UpDown_Axis
.
HomeHighSpeed
=
Config
.
UpdownAxis_HomeHighSpeed
;
Config
.
UpDown_Axis
.
HomeLowSpeed
=
Config
.
UpdownAxis_HomeLowSpeed
;
Config
.
UpDown_Axis
.
HomeLowSpeed
=
Config
.
UpdownAxis_HomeLowSpeed
;
Config
.
UpDown_Axis
.
ServerOnDO
=
IO_Type
.
UpDownAxis_ServoOn
;
Config
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpDownAxis_BreakOn
;
}
}
...
...
@@ -187,11 +190,11 @@ namespace OnlineStore.DeviceLibrary
runStatus
=
LineRunStatus
.
Reset
;
SecondMoveInfo
.
EndMove
();
MoveInfo
.
NewMove
(
LineMoveType
.
Reset
);
UpDown
StartReset
();
StartReset
();
return
true
;
}
private
void
UpDown
StartReset
()
private
void
StartReset
()
{
//移载装置原点状态:顶升气缸下降端,前后气缸后退端,上下气缸上升端,夹料气缸放松端,阻挡气缸输入=0
UpdownHomeMove
();
...
...
@@ -202,7 +205,7 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
}
else
{
{
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
);
}
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
c0a0de6
...
...
@@ -141,17 +141,10 @@ namespace OnlineStore.DeviceLibrary
{
OutStoreLog
(
"出库:(MO_07_ClampCylinderTighten 夹料气缸1放松 )"
);
int
bagWidth
=
MoveInfo
.
MoveParam
.
PlateW
;
if
(
MoveInfo
.
MoveParam
!=
null
)
{
LogInfo
(
"【"
+
posId
+
"】出库时,更新盘空满信息 托盘号【"
+
MoveInfo
.
MoveParam
.
TrayNumber
+
"】,是否有料盘【"
+
true
+
"】,出库入库【"
+
2
+
"】"
);
TrayManager
.
UpdateFixtureValue
(
MoveInfo
.
MoveParam
.
TrayNumber
,
true
,
2
,
bagWidth
);
}
else
{
int
num
=
TrayManager
.
GetNum
(
DeviceID
);
LogInfo
(
"【"
+
posId
+
"】出库时,更新盘空满信息 托盘号【"
+
num
+
"】,是否有料盘【"
+
true
+
"】,出库入库【"
+
2
+
"】"
);
TrayManager
.
UpdateFixtureValue
(
num
,
true
,
2
,
bagWidth
);
}
LogInfo
(
"【"
+
posId
+
"】出库时,更新盘空满信息 托盘号【"
+
MoveInfo
.
MoveParam
.
TrayNumber
+
"】,是否有料盘【"
+
true
+
"】,出库入库【"
+
2
+
"】"
);
TrayManager
.
UpdateFixtureValue
(
MoveInfo
.
MoveParam
.
TrayNumber
,
true
,
2
,
MoveInfo
.
MoveParam
.
WareCode
,
MoveInfo
.
MoveParam
.
PosId
,
MoveInfo
.
MoveParam
.
PlateH
,
bagWidth
);
//出库全部完成
lineStatus
=
LineStatus
.
StoreOnline
;
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_59_ClampCylinderTighten
);
...
...
@@ -256,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_10_WaitBox
);
LogInfo
(
"入库【"
+
posId
+
"】处理(等待移栽):(判断box门口没有盘, 且可以入库),更新盘号【"
+
num
+
"】为空盘"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitBoxCanReviceTray
());
TrayManager
.
UpdateFixtureValue
(
num
,
false
,
0
);
TrayManager
.
UpdateFixtureValue
(
num
);
//阻挡气缸移动
InStoreLog
(
"放托盘(放开阻挡):SecondStoreMove=MO_09_TopCylinder_Down 物品已移走,顶升气缸1下降)"
);
...
...
@@ -660,20 +653,7 @@ namespace OnlineStore.DeviceLibrary
#
endregion
private
void
CheckLog
(
string
msg
)
{
LogUtil
.
debug
(
Name
+
msg
);
}
private
void
InStoreLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
LogUtil
.
info
(
Name
+
"【"
+
posId
+
"】"
+
msg
);
}
private
void
OutStoreLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
LogUtil
.
info
(
Name
+
"【"
+
posId
+
"】"
+
msg
);
}
}
}
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
查看文件 @
c0a0de6
...
...
@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
MoveInfo
.
NewMove
(
LineMoveType
.
ReturnHome
);
UpdownCylinder
StartReset
();
StartReset
();
return
true
;
}
...
...
@@ -113,12 +113,12 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
MoveInfo
.
NewMove
(
LineMoveType
.
Reset
);
UpdownCylinder
StartReset
();
StartReset
();
return
true
;
}
private
void
UpdownCylinder
StartReset
()
private
void
StartReset
()
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
CylinderMove
(
MoveInfo
,
IO_Type
.
UpDownCylinder_Down
,
IO_Type
.
UpDownCylinder_Up
);
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
c0a0de6
...
...
@@ -19,6 +19,7 @@ namespace OnlineStore.DeviceLibrary
//托盘在两个阻挡内
if
(
num
>
0
)
{
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
2
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
...
...
@@ -35,6 +36,7 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopCylinder1Down
);
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
2
);
CheckLog
(
" 托盘检测:料盘检测 SecondStoreMove(MIO_01_StopCylinder1Down阻挡气缸1-1下降 ,最多等待1秒)"
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
));
...
...
@@ -194,12 +196,14 @@ namespace OnlineStore.DeviceLibrary
{
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
if
(
DeviceID
.
Equals
(
2
))
{
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitSideWay
());
SecondMoveInfo
.
OneWaitCanEndStep
=
true
;
}
//更新横移托盘已处理完成
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
1
);
//if (DeviceID.Equals(2))
//{
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
// SecondMoveInfo.OneWaitCanEndStep = true;
//}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_07_WaitCanGo
))
...
...
@@ -305,7 +309,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_05_WaitBox
);
LogInfo
(
"出料PO_05_WaitBox【"
+
posId
+
"】处理(等待可以移栽) 更新盘号【"
+
num
+
"】为空盘"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitBoxCanReviceTray
());
TrayManager
.
UpdateFixtureValue
(
num
,
false
,
0
);
TrayManager
.
UpdateFixtureValue
(
num
);
//阻挡气缸移动
InStoreLog
(
"放托盘(放开阻挡):SecondStoreMove=MO_09_TopCylinder_Down 物品已移走,顶升气缸1下降)"
);
...
...
@@ -354,20 +358,6 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
private
void
CheckLog
(
string
msg
)
{
LogUtil
.
debug
(
Name
+
msg
);
}
private
void
InStoreLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
LogUtil
.
info
(
Name
+
"【"
+
posId
+
"】"
+
msg
);
}
private
void
OutStoreLog
(
string
msg
)
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
LogUtil
.
info
(
Name
+
"【"
+
posId
+
"】"
+
msg
);
}
}
}
source/DeviceLibrary/assemblyLine/TrayManager.cs
查看文件 @
c0a0de6
...
...
@@ -13,9 +13,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 出库时,可以不下降直接放料盘的宽度
/// </summary>
public
const
int
CanPushBagWidth
=
7
;
public
const
int
CanPushBagWidth
=
7
;
/// <summary>
/// 放在公共地方,方便存取,夹料编码盘列表,key=编码(1-6),value=是否有物品,true=有物品
/// </summary>
...
...
@@ -24,11 +22,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 流水线需要的空盘数量
/// </summary>
public
static
int
LineNeedEmptyTrayNum
=
0
;
internal
static
int
LineNeedEmptyTrayNum
=
0
;
/// <summary>
/// 最大托盘号,必须按照顺序从1到6走过
/// </summary>
public
static
int
MaxTrayNum
=
0
;
internal
static
int
MaxTrayNum
=
0
;
/// <summary>
/// 托盘错误消息
/// </summary>
...
...
@@ -43,23 +41,20 @@ namespace OnlineStore.DeviceLibrary
{
LineRunTest
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
LineRunTest
).
Equals
(
1
);
}
public
static
bool
isNeedEmptyTray
()
{
if
(
LineRunTest
)
{
return
true
;
}
return
LineNeedEmptyTrayNum
>
0
;
}
public
static
void
AddNeedEmptyTrayNum
()
//public static bool isNeedEmptyTray()
//{
// if (LineRunTest)
// {
// return true;
// }
// return LineNeedEmptyTrayNum > 0;
//}
internal
static
void
AddNeedEmptyTrayNum
()
{
Interlocked
.
Increment
(
ref
LineNeedEmptyTrayNum
);
}
public
static
void
DelNeedEmptyTrayNum
()
internal
static
void
DelNeedEmptyTrayNum
()
{
Interlocked
.
Decrement
(
ref
LineNeedEmptyTrayNum
);
}
...
...
@@ -70,7 +65,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="trayNum">盘号1-6</param>
/// <returns>盘上是否有料盘</returns>
public
static
bool
IsFixTureFull
(
int
trayNum
)
internal
static
bool
IsFixTureFull
(
int
trayNum
)
{
lock
(
fixtureMapLock
)
{
...
...
@@ -103,17 +98,17 @@ namespace OnlineStore.DeviceLibrary
// }
// return false;
//}
public
static
void
UpdateFixtureValue
(
int
trayNum
,
bool
isFull
,
int
inOrOut
)
{
UpdateFixtureValue
(
trayNum
,
isFull
,
inOrOut
,
0
);
}
//
public static void UpdateFixtureValue(int trayNum, bool isFull, int inOrOut)
//
{
//
UpdateFixtureValue(trayNum, isFull, inOrOut, 0);
//
}
/// <summary>
/// 更新对应的盘号(1-6)是否有料盘
/// </summary>
/// <param name="trayNum"></param>
/// <param name="isFull"></param>
/// <param name="inOrOut">0=无操作,1=入库,2=出库</param>
public
static
void
UpdateFixtureValue
(
int
trayNum
,
bool
isFull
,
int
inOrOut
,
int
bagWidth
)
internal
static
void
UpdateFixtureValue
(
int
trayNum
,
bool
isFull
=
false
,
int
inOrOut
=
0
,
string
wareCode
=
""
,
string
posId
=
""
,
int
plateH
=
0
,
int
plateW
=
0
)
{
lock
(
fixtureMapLock
)
{
...
...
@@ -121,11 +116,16 @@ namespace OnlineStore.DeviceLibrary
{
fixtureCodeFullMap
[
trayNum
].
IsFull
=
isFull
;
fixtureCodeFullMap
[
trayNum
].
InOrOutStore
=
inOrOut
;
fixtureCodeFullMap
[
trayNum
].
BagWidth
=
bagWidth
;
fixtureCodeFullMap
[
trayNum
].
WareCode
=
wareCode
;
fixtureCodeFullMap
[
trayNum
].
PosId
=
posId
;
fixtureCodeFullMap
[
trayNum
].
PlateH
=
plateH
;
fixtureCodeFullMap
[
trayNum
].
PlateW
=
plateW
;
}
else
{
TrayInfo
fixture
=
new
TrayInfo
(
trayNum
,
isFull
,
inOrOut
,
bagWidth
);
TrayInfo
fixture
=
new
TrayInfo
(
trayNum
,
isFull
,
inOrOut
,
wareCode
,
posId
,
plateH
,
plateW
);
fixtureCodeFullMap
.
Add
(
trayNum
,
fixture
);
}
}
...
...
@@ -133,7 +133,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否还有有料仓的盘
/// </summary>
public
static
bool
IsHasFull
()
internal
static
bool
IsHasFull
()
{
foreach
(
int
key
in
fixtureCodeFullMap
.
Keys
)
{
...
...
@@ -147,7 +147,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否还有有料仓正在出库的盘
/// </summary>
public
static
bool
IsHasFullOutFixture
()
internal
static
bool
IsHasFullOutFixture
()
{
foreach
(
int
key
in
fixtureCodeFullMap
.
Keys
)
{
...
...
@@ -159,7 +159,7 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
public
static
bool
RightTrayCode
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
)
internal
static
bool
RightTrayCode
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
)
{
int
defNext
=
preTrayNum
+
1
;
if
(
preTrayNum
.
Equals
(
0
)
||
MaxTrayNum
.
Equals
(
0
)
||
trayNum
.
Equals
(
defNext
))
...
...
@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
public
static
void
UpdateTrayNumError
(
int
errorStoreID
,
string
errorMsg
)
internal
static
void
UpdateTrayNumError
(
int
errorStoreID
,
string
errorMsg
)
{
TrayErrorMsg
=
errorMsg
;
ErrorStoreId
=
errorStoreID
;
...
...
@@ -195,6 +195,55 @@ namespace OnlineStore.DeviceLibrary
return
subType
;
}
#
region
横移状态缓存
internal
static
Dictionary
<
int
,
int
>
SidesWayStateMap
=
new
Dictionary
<
int
,
int
>();
internal
static
object
swMapLock
=
""
;
internal
static
bool
CanMoveSidesWay
(
int
swNum
)
{
if
(
SidesWayStateMap
.
ContainsKey
(
swNum
))
{
if
(
SidesWayStateMap
[
swNum
].
Equals
(
1
))
{
return
true
;
}
else
if
(
swNum
.
Equals
(
1
)
||
swNum
.
Equals
(
2
))
{
if
(
SidesWayStateMap
[
swNum
].
Equals
(
0
))
{
return
true
;
}
}
}
return
false
;
}
/// <summary>
/// 更新横移托盘的处理状态
/// </summary>
/// <param name="swNum">横移编号</param>
/// <param name="value">0=未处理等待中,1=托盘处理完成,可处理横移,2=托盘正在处理中</param>
internal
static
void
UpdateSWState
(
int
swNum
,
int
value
)
{
if
(
swNum
<=
0
)
{
return
;
}
lock
(
swMapLock
)
{
if
(
SidesWayStateMap
.
ContainsKey
(
swNum
))
{
SidesWayStateMap
[
swNum
]
=
value
;
}
else
{
SidesWayStateMap
.
Add
(
swNum
,
value
);
}
}
}
#
endregion
}
}
source/DeviceLibrary/deviceLibrary/IO/IOManager.cs
查看文件 @
c0a0de6
...
...
@@ -38,7 +38,7 @@ namespace OnlineStore.DeviceLibrary
ConfigIO
configIo
=
GetDI
(
ioType
,
subType
);
if
(
configIo
==
null
)
{
configIo
=
GetDO
(
ioType
,
subType
);
configIo
=
GetDO
(
ioType
,
subType
);
}
if
(
configIo
!=
null
)
...
...
@@ -88,9 +88,10 @@ namespace OnlineStore.DeviceLibrary
{
if
(
LineManager
.
allConfigMap
.
ContainsKey
(
subType
))
{
if
(
LineManager
.
allConfigMap
[
subType
].
DIList
.
ContainsKey
(
ioType
))
string
newType
=
ioType
.
Replace
(
"SW1_"
,
"SW_"
).
Replace
(
"SW2_"
,
"SW_"
).
Replace
(
"SW3_"
,
"SW_"
).
Replace
(
"SW4_"
,
"SW_"
);
if
(
LineManager
.
allConfigMap
[
subType
].
DIList
.
ContainsKey
(
newType
))
{
return
LineManager
.
allConfigMap
[
subType
].
DIList
[
io
Type
];
return
LineManager
.
allConfigMap
[
subType
].
DIList
[
new
Type
];
}
}
...
...
@@ -111,9 +112,10 @@ namespace OnlineStore.DeviceLibrary
{
if
(
LineManager
.
allConfigMap
.
ContainsKey
(
subType
))
{
if
(
LineManager
.
allConfigMap
[
subType
].
DOList
.
ContainsKey
(
ioType
))
string
newType
=
ioType
.
Replace
(
"SW1_"
,
"SW_"
).
Replace
(
"SW2_"
,
"SW_"
).
Replace
(
"SW3_"
,
"SW_"
).
Replace
(
"SW4_"
,
"SW_"
);
if
(
LineManager
.
allConfigMap
[
subType
].
DOList
.
ContainsKey
(
newType
))
{
return
LineManager
.
allConfigMap
[
subType
].
DOList
[
io
Type
];
return
LineManager
.
allConfigMap
[
subType
].
DOList
[
new
Type
];
}
}
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
c0a0de6
...
...
@@ -380,9 +380,9 @@ namespace OnlineStore.DeviceLibrary
#
region
横移轨道处理
5000
开始
SW00_Wait
=
5000
,
/// <summary>
///
阻挡
气缸下降
///
定位
气缸下降
/// </summary>
SW01_
Stop
CylinderDown
=
5001
,
SW01_
Location
CylinderDown
=
5001
,
/// <summary>
/// 等待轨道1夹具检测信号
...
...
source/DeviceLibrary/model/TrayInfo.cs
查看文件 @
c0a0de6
...
...
@@ -12,14 +12,22 @@ namespace OnlineStore.DeviceLibrary
public
class
TrayInfo
{
public
TrayInfo
(
int
trayNum
,
bool
isFull
,
int
inOrOut
,
int
bagWidth
)
public
TrayInfo
(
int
trayNum
,
bool
isFull
=
false
,
int
inOrOut
=
0
)
{
this
.
TrayCode
=
trayNum
;
this
.
IsFull
=
isFull
;
this
.
InOrOutStore
=
inOrOut
;
BagWidth
=
bagWidth
;
this
.
InOrOutStore
=
inOrOut
;
}
public
TrayInfo
(
int
trayNum
,
bool
isFull
,
int
inOrOut
,
string
wareCode
,
string
posId
,
int
plateH
,
int
plateW
)
{
this
.
TrayCode
=
trayNum
;
this
.
IsFull
=
isFull
;
this
.
InOrOutStore
=
inOrOut
;
this
.
WareCode
=
wareCode
;
this
.
PosId
=
posId
;
this
.
PlateH
=
plateH
;
this
.
PlateW
=
plateW
;
}
/// <summary>
/// 夹具编码值(1-6)
/// </summary>
...
...
@@ -31,11 +39,23 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary>
public
int
InOrOutStore
{
get
;
set
;
}
/// <summary>
/// 如果是出库,需要记录盘宽,七寸小盘可以累积到托盘上
/// 只有出库才会有值
/// </summary>
public
int
BagWidth
{
get
;
set
;
}
public
int
InOrOutStore
{
get
;
set
;
}
/// <summary>
/// 物品二维码信息
/// </summary>
public
string
WareCode
{
get
;
set
;
}
/// <summary>
/// 位置坐标名(对应配置表的位置)
/// </summary>
public
string
PosId
{
get
;
set
;
}
/// <summary>
/// 料盘高度
/// </summary>
public
int
PlateH
{
get
;
set
;
}
/// <summary>
/// 料盘宽度
/// </summary>
public
int
PlateW
{
get
;
set
;
}
}
}
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
查看文件 @
c0a0de6
...
...
@@ -85,6 +85,14 @@ namespace OnlineStore.LoadCSVLibrary
public
class
ConfigMoveAxis
:
ConfigBase
{
/// <summary>
/// 伺服ON的Do信号
/// </summary>
public
string
ServerOnDO
=
""
;
/// <summary>
/// 伺服刹车信号
/// </summary>
public
string
BreakOnDO
=
""
;
/// <summary>
/// 使用AC伺服时表示串口号,使用康泰克运动版表示板卡名称
/// </summary>
[
CSVAttribute
(
"设备名称"
)]
...
...
source/LoadCVSLibrary/storeConfig/config/FeedingEquip_Config.cs
查看文件 @
c0a0de6
...
...
@@ -143,8 +143,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[
ConfigProAttribute
(
"UpdownAxis_HomeAddSpeed"
,
false
)]
public
int
UpdownAxis_HomeAddSpeed
{
get
;
set
;
}
/// <summary>
/// PRO,0,移栽上下轴走到待机点速度,UpdownAxis_P1Speed,400,,,,,
...
...
@@ -157,7 +156,11 @@ namespace OnlineStore.LoadCSVLibrary
[
ConfigProAttribute
(
"UpdownAxis_DownSpeed"
,
false
)]
public
int
UpdownAxis_DownSpeed
{
get
;
set
;
}
/// <summary>
/// PRO,0,是否是用来出料,IsCanOut,1,,,,,
/// </summary>
[
ConfigProAttribute
(
"IsCanOut"
,
false
)]
public
int
IsCanOut
{
get
;
set
;
}
private
Dictionary
<
int
,
int
>
UpDownPositionMap
=
null
;
public
int
GetUpdownPosition
(
int
trayHeight
)
...
...
@@ -277,12 +280,18 @@ namespace OnlineStore.LoadCSVLibrary
this
.
Batch_Axis
.
HomeHighSpeed
=
this
.
BatchAxis_HomeHighSpeed
;
this
.
Batch_Axis
.
HomeLowSpeed
=
this
.
BatchAxis_HomeLowSpeed
;
this
.
Batch_Axis
.
ServerOnDO
=
IO_Type
.
BatchAxis_ServoOn
;
this
.
Batch_Axis
.
BreakOnDO
=
IO_Type
.
BatchAxis_BreakOn
;
this
.
UpDown_Axis
.
TargetSpeed
=
this
.
UpdownAxis_TargetSpeed
;
this
.
UpDown_Axis
.
AddSpeed
=
this
.
UpdownAxis_AddSpeed
;
this
.
UpDown_Axis
.
DelSpeed
=
this
.
UpdownAxis_DelSpeed
;
this
.
UpDown_Axis
.
HomeAddSpeed
=
this
.
UpdownAxis_HomeAddSpeed
;
this
.
UpDown_Axis
.
HomeHighSpeed
=
this
.
UpdownAxis_HomeHighSpeed
;
this
.
UpDown_Axis
.
HomeLowSpeed
=
this
.
UpdownAxis_HomeLowSpeed
;
this
.
UpDown_Axis
.
ServerOnDO
=
IO_Type
.
UpDownAxis_ServoOn
;
this
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpDownAxis_BreakOn
;
}
}
}
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
c0a0de6
...
...
@@ -626,15 +626,15 @@ namespace OnlineStore.LoadCSVLibrary
/// DI /DO FL1顶升下降端 FL_TopCylinder_Down X174
/// </summary>
public
static
string
FL_TopCylinder_Down
=
"FL_TopCylinder_Down"
;
/// <summary>
/// DO FL1阻挡1下降SOL FL_Stop
1Down
Y165
/// DO FL1阻挡1下降SOL FL_Stop
Cylinder_Down1
Y165
/// </summary>
public
static
string
FL_Stop
1Down
=
"FL_Stop1Down
"
;
public
static
string
FL_Stop
Cylinder_Down1
=
"FL_StopCylinder_Down1
"
;
/// <summary>
/// DO FL1阻挡2下降SOL FL_Stop
2Down
Y166
/// DO FL1阻挡2下降SOL FL_Stop
Cylinder_Down2
Y166
/// </summary>
public
static
string
FL_Stop
2Down
=
"FL_Stop2Down
"
;
public
static
string
FL_Stop
Cylinder_Down2
=
"FL_StopCylinder_Down2
"
;
#
endregion
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论