Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit eed214ee
由
LN
编写于
2021-01-07 13:30:56 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
托盘横移条件修改。T4托盘放行修改。
1 个父辈
724c41a9
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
120 行增加
和
74 行删除
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1_SLStation.cs
source/DeviceLibrary/model/StoreStep.cs
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
eed214e
...
...
@@ -5,6 +5,7 @@ using System;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
...
...
@@ -86,8 +87,17 @@ namespace OnlineStore.DeviceLibrary
}
private
static
void
AgvClient_CloseDoor
(
string
id
,
string
rfid
)
{
// RFIDData data = new RFIDData(content);
LogUtil
.
info
(
"收到 AgvClient_CloseDoor ["
+
id
+
"] ["
+
rfid
+
"] "
);
LogUtil
.
info
(
"收到 AgvClient_CloseDoor ["
+
id
+
"] ["
+
rfid
+
"] 更新状态 "
);
UpdateAction
(
id
,
ClientAction
.
CloseDoor
);
Task
.
Factory
.
StartNew
(
delegate
{
Thread
.
Sleep
(
5000
);
if
(
GetAction
(
id
).
Equals
(
ClientAction
.
CloseDoor
))
{
SetStatus
(
id
);
LogUtil
.
error
(
"收到 AgvClient_CloseDoor ["
+
id
+
"] ["
+
rfid
+
"] 5秒后,更新状态为None "
);
}
});
}
private
static
void
AgvClient_Ready
(
string
id
,
string
rfid
)
{
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
eed214e
...
...
@@ -990,7 +990,7 @@ namespace OnlineStore.DeviceLibrary
});
}
internal
void
ShelfEnterProcess
()
{
{
Task
.
Factory
.
StartNew
(
delegate
{
string
logName
=
Name
+
"AGV料架进入 ["
+
Config
.
AgvInName
+
"] "
;
...
...
@@ -998,55 +998,55 @@ namespace OnlineStore.DeviceLibrary
{
if
(
IOValue
(
IO_Type
.
SL_Entry_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LogUtil
.
info
(
logName
+
" 开始"
);
//AgvClient.SetStatus(Config.AgvInName,"",ClientAction.MayEnter,ClientLevel.High
);
LogUtil
.
info
(
logName
+
" 开始
,设置状态=MayEnter
"
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
MayEnter
,
ClientLevel
.
High
,
true
);
ProcessShelfEnter
=
true
;
////进料阻挡上升
//IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);
//转动线体
IOMove
(
IO_Type
.
SL_Line_Run
,
IO_VALUE
.
HIGH
);
//等待进料检测信号
bool
result
=
WaitIo
(
IO_Type
.
SL_Entry_Check
,
IO_VALUE
.
HIGH
,
60000
);
bool
result
=
WaitIo
(
IO_Type
.
SL_Entry_Check
,
IO_VALUE
.
HIGH
,
60000
0
);
if
(!
result
)
{
LogUtil
.
info
(
logName
+
" 等待 SL_Entry_Check=High 超时, 等待 SL_Stop_Check 信号"
);
}
else
{
LogUtil
.
info
(
logName
+
"已收到 SL_Entry_Check=High , 等待 SL_Stop_Check 信号"
);
}
result
=
WaitIo
(
IO_Type
.
SL_Stop_Check
,
IO_VALUE
.
HIGH
,
60000
);
LogUtil
.
info
(
logName
+
" 等待 SL_Entry_Check=High "
+
result
+
", 等待 SL_Stop_Check 信号"
);
result
=
WaitIo
(
IO_Type
.
SL_Stop_Check
,
IO_VALUE
.
HIGH
,
600000
);
if
(!
result
)
LogUtil
.
info
(
logName
+
" 等待 SL_Stop_Check=High "
+
result
+
",开始等待CloseDoor 超时10分钟"
);
try
{
LogUtil
.
info
(
logName
+
" 等待 SL_Stop_Check=High 超时,等待3000后停止转动,发送 FinishEnter"
);
result
=
WaitUtil
.
Wait
(
600000
,
delegate
()
{
return
AgvClient
.
GetAction
(
Config
.
AgvInName
).
Equals
(
ClientAction
.
CloseDoor
);
},
logName
+
"等待CloseDoor超时"
);
}
else
catch
(
TimeoutException
te
)
{
LogUtil
.
info
(
logName
+
"已收到 SL_Stop_Check=High ,等待5000后停止转动,发送 FinishEnter"
);
LogUtil
.
error
(
logName
+
" 超时:"
+
te
);
}
//
等待200
毫秒后停止转动
Thread
.
Sleep
(
5000
);
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FI_05_LineStart
))
//
//等待 15000
毫秒后停止转动
//Thread.Sleep(1
5000);
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_05_LineStart
))
{
LogUtil
.
info
(
logName
+
"
等待5000后
, MoveInfo.MoveType= FI_03_LineStart 不需要停止链条转动"
);
LogUtil
.
info
(
logName
+
"
完成
, MoveInfo.MoveType= FI_03_LineStart 不需要停止链条转动"
);
}
else
{
LogUtil
.
info
(
logName
+
"
等待5000后
,停止链条转动"
);
LogUtil
.
info
(
logName
+
"
完成
,停止链条转动"
);
IOMove
(
IO_Type
.
SL_Line_Run
,
IO_VALUE
.
LOW
);
}
//料架可离开
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
,
true
);
//AgvClient.SetStatus(Config.AgvInName, "", ClientAction.FinishEnter, ClientLevel.High, true);
Thread
.
Sleep
(
1000
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
ProcessShelfEnter
=
false
;
LogUtil
.
info
(
logName
+
" 结束"
);
}
else
{
LogUtil
.
info
(
logName
+
"开始,未检测到料架信号,不处理,设置=None"
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
LastOutShelfId
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
}
}
catch
(
TimeoutException
te
)
{
...
...
@@ -1063,7 +1063,6 @@ namespace OnlineStore.DeviceLibrary
}
});
}
private
bool
ReadShelfId
()
{
try
...
...
@@ -1109,6 +1108,17 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
internal
bool
NeedEmptyTray
()
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
)
&&
MoveInfo
.
MoveStep
>
LineMoveStep
.
FI_14_TrayLocation_Before
&&
MoveInfo
.
MoveStep
<
LineMoveStep
.
FI_51_BatchAxisToP2
)
{
return
true
;
}
return
false
;
}
private
string
lastcode
=
""
;
public
override
string
GetMoveStr
()
{
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
eed214e
...
...
@@ -518,7 +518,6 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayManager
.
UpdateTrayInfo
(
currTrayNum
,
true
,
ReelType
.
InStore
,
LastPosParam
.
Clone
(),
LastPosParam
.
NgMsg
);
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":升降轴到P2: ["
+
targetPositon
+
"] 更新托盘信息【"
+
tray
.
ToStr
()
+
"】"
);
...
...
@@ -560,14 +559,23 @@ namespace OnlineStore.DeviceLibrary
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_36_TrayMoveOk
);
MoveInfo
.
MoveParam
=
new
InOutParam
();
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":升降轴已到P1,托盘放行"
);
TrayMoveOk
();
if
(
IOValue
(
IO_Type
.
SL_ClampCylinder_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
FI_37_TrayMoveOk
();
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_36_ClampCheck
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":等待夹爪无料"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_ClampCylinder_Check
,
IO_VALUE
.
LOW
));
}
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FI_36_TrayMoveOk
))
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FI_36_ClampCheck
))
{
FI_37_TrayMoveOk
();
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FI_37_TrayMoveOk
))
{
if
(
axisCheckTimer
!=
null
&&
axisCheckTimer
.
Enabled
)
{
...
...
@@ -719,6 +727,14 @@ namespace OnlineStore.DeviceLibrary
#
endregion
}
private
void
FI_37_TrayMoveOk
()
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_37_TrayMoveOk
);
MoveInfo
.
MoveParam
=
new
InOutParam
();
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":,托盘放行"
);
TrayMoveOk
();
}
private
Task
getPosTask
=
null
;
private
InOutParam
LastPosParam
=
null
;
private
int
LastResult
=
0
;
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
查看文件 @
eed214e
...
...
@@ -593,8 +593,7 @@ namespace OnlineStore.DeviceLibrary
{
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
))
{
{
int
targetP
=
Config
.
GetUpdownP2Detial
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
if
(
UpdownAxis
.
IsInPosition
(
targetP
))
...
...
@@ -613,13 +612,14 @@ namespace OnlineStore.DeviceLibrary
if
(
UpdownIsInP1
())
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_22_CylinderTake
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":上料横移机构取料端"
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":上料横移机构取料端
,等待夹爪无料
"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_ClampCylinder_Check
,
IO_VALUE
.
LOW
));
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_21_AxisDownMove
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":上料横移机构取料端 前升降轴先到P1 ["
+
Config
.
UpDownAxisP1
+
"]"
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":上料横移机构取料端 前升降轴先到P1 ["
+
Config
.
UpDownAxisP1
+
"]"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
}
}
...
...
@@ -660,38 +660,37 @@ namespace OnlineStore.DeviceLibrary
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
}
int
trayNum
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
TrayNumber
:
currTrayNum
;
//更新此托盘为空托盘
TrayManager
.
UpdateTrayInfo
(
trayNum
,
false
);
//SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
TrayMoveOk
();
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FO_26_UpdownAxisToP1
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_27_ClampCheck
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":检测夹爪料盘检测=HIGH"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_ClampCylinder_Check
,
IO_VALUE
.
HIGH
));
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FO_27_ClampCheck
))
{
if
(
UpdownIsInP1
())
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_28_CylinderGive
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":上料横移机构到放料端"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
);
if
(
IOValue
(
IO_Type
.
SL_ClampCylinder_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_27_ClampCheck
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":检测夹爪料盘检测=HIGH"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_ClampCylinder_Check
,
IO_VALUE
.
HIGH
));
}
else
{
FO_28_CylinderGive
(
outType
);
}
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_26_UpdownAxisToP1
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":上料横移机构到放料端前,先升降轴先到P1 ["
+
Config
.
UpDownAxisP1
+
"]"
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":上料横移机构到放料端前,先升降轴先到P1 ["
+
Config
.
UpDownAxisP1
+
"]"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FO_27_ClampCheck
))
{
FO_28_CylinderGive
(
outType
);
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FO_28_CylinderGive
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_29_UpdownAxisToP3
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":移栽伺服到P3 ["
+
Config
.
UpDownAxisP3
+
"]"
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":移栽伺服到P3 ["
+
Config
.
UpDownAxisP3
+
"]"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP3
,
Config
.
UpdownAxis_P3Speed
);
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FO_29_UpdownAxisToP3
))
...
...
@@ -795,6 +794,17 @@ namespace OnlineStore.DeviceLibrary
}
}
}
private
void
FO_28_CylinderGive
(
string
outType
)
{
int
trayNum
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
TrayNumber
:
currTrayNum
;
TrayManager
.
UpdateTrayInfo
(
trayNum
,
false
);
TrayMoveOk
();
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_28_CylinderGive
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":更新托盘【"
+
trayNum
+
"】为空,托盘可离开,上料横移机构到放料端 "
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
);
}
private
bool
afterPutOk
=
false
;
private
void
FO_25_CylinderTighten
(
string
outType
)
{
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
查看文件 @
eed214e
...
...
@@ -851,7 +851,7 @@ namespace OnlineStore.DeviceLibrary
FeedingEquip
feed1
=
LineManager
.
Line
.
FeedingEquipMap
[
101
];
FeedingEquip
feed2
=
LineManager
.
Line
.
FeedingEquipMap
[
102
];
if
((!
feed1
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
))
&&
(!
feed2
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
)))
if
((!
feed1
.
NeedEmptyTray
())
&&
(!
feed2
.
NeedEmptyTray
(
)))
{
return
true
;
}
...
...
@@ -864,15 +864,14 @@ namespace OnlineStore.DeviceLibrary
{
if
(
tray
.
InOrOutStore
.
Equals
(
1
))
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
List
<
int
>
instoreId
=
new
List
<
int
>
{
1
,
2
,
3
,
4
,
5
,
13
,
14
,
15
,
16
};
if
(!
instoreId
.
Contains
(
storeId
))
//NG料需要横移
if
(
tray
.
InoutPar
.
InStoreNg
)
{
return
true
;
}
//NG料需要横移
if
(
tray
.
InoutPar
.
InStoreNg
)
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
List
<
int
>
instoreId
=
new
List
<
int
>
{
1
,
2
,
3
,
4
,
5
,
13
,
14
,
15
,
16
};
if
(
!
instoreId
.
Contains
(
storeId
)
)
{
return
true
;
}
...
...
@@ -893,16 +892,17 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
tray
.
InOrOutStore
.
Equals
(
1
))
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
List
<
int
>
instoreId
=
new
List
<
int
>
{
11
,
12
,
23
,
24
};
if
(!
instoreId
.
Contains
(
storeId
))
if
(
tray
.
InoutPar
.
InStoreNg
)
{
return
true
;
}
if
(
tray
.
InoutPar
.
InStoreNg
)
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
List
<
int
>
instoreId
=
new
List
<
int
>
{
11
,
12
,
23
,
24
};
if
(!
instoreId
.
Contains
(
storeId
))
{
return
true
;
}
}
}
}
...
...
@@ -928,7 +928,7 @@ namespace OnlineStore.DeviceLibrary
}
FeedingEquip
feed5
=
LineManager
.
Line
.
FeedingEquipMap
[
105
];
if
(!
feed5
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
))
if
(!
feed5
.
NeedEmptyTray
(
))
{
return
true
;
}
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1_SLStation.cs
查看文件 @
eed214e
...
...
@@ -591,10 +591,6 @@ namespace OnlineStore.DeviceLibrary
if
(
Config
.
WorkDeviceId
>
0
)
{
TrayInfo
trayInfo
=
TrayManager
.
GetTrayInfo
(
trayNum
);
//if (trayInfo.IsFull)
//{
// return false;
//}
//如果是HY02,且T1在等待托盘,先放行一个托盘
if
(
DeviceID
.
Equals
(
202
))
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
eed214e
...
...
@@ -608,9 +608,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
FI_35_AxisToP1
,
/// <summary>
/// 料盘移栽:检测夹爪无料
/// </summary>
FI_36_ClampCheck
,
/// <summary>
/// 料盘移栽: 放托盘离开
/// </summary>
FI_3
6
_TrayMoveOk
,
FI_3
7
_TrayMoveOk
,
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论