Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4908c7bb
由
LN
编写于
2020-03-10 18:05:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出料皮带线NG优化
1 个父辈
fda20f11
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
66 行增加
和
125 行删除
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
4908c7b
...
...
@@ -40,10 +40,10 @@ namespace OnlineStore.DeviceLibrary
Name
=
(
" "
+
"_皮带线_"
+
(
DeviceID
.
Equals
(
301
)
?
"123"
:
"456"
)
+
" "
).
ToUpper
();
Init
();
UseAxis
=
false
;
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"["
+
Name
+
"-Move]"
);
SecondMoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"["
+
Name
+
"-SMove]"
);
int
id
=
DeviceID
%
100
;
hengyiName
=
"皮带线_"
+
((
id
-
1
)
*
3
+
3
)
+
" "
;
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"["
+
hengyiName
+
"-Move]"
);
SecondMoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"["
+
hengyiName
+
"-SMove]"
);
if
(
id
.
Equals
(
1
))
{
TrayLine1
=
new
OutTrayLineBean
(
"皮带线"
+
"_"
+
((
id
-
1
)
*
3
+
1
)
+
" "
,
IO_Type
.
EntryLocation_Check1
,
IO_Type
.
ExitLocation_Check1
,
IO_Type
.
ExitTray_Check1
,
IO_Type
.
DLine_Run1
,
IO_Type
.
EntryTray_Check3
,
this
.
DeviceID
);
...
...
@@ -472,6 +472,12 @@ namespace OnlineStore.DeviceLibrary
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
if
(
LastCodeList
.
Count
<=
0
)
{
Thread
.
Sleep
(
300
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
}
if
(
LastCodeList
.
Count
<=
0
)
{
Thread
.
Sleep
(
300
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
}
LastCode
=
SServerManager
.
ProcessCodeList
(
LastCodeList
);
...
...
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
查看文件 @
4908c7b
...
...
@@ -10,11 +10,8 @@ using System.Threading.Tasks;
namespace
OnlineStore.DeviceLibrary
{
partial
class
DischargeLine
{
// private List<string> LastCodeList = new List<string>();
// private string LastCode = "";
private
int
LastWidth
=
0
;
// private int scanCodeCount = 0;
{
private
int
LastWidth
=
0
;
protected
override
bool
CheckWaitResult
(
LineMoveInfo
moveInfo
,
WaitResultInfo
wait
)
{
...
...
@@ -73,54 +70,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
Name
+
" 启动出料失败,当前 storeStatus="
+
runStatus
);
return
false
;
}
}
//private void ScanCode()
//{
// MoveInfo.NextMoveStep(LineMoveStep.DO_02_ScanCode);
// List<string> cameraList = Config.GetCameraList();
// if (cameraList.Count > 0)
// {
// scanCodeCount++;
// LogUtil.info(hengyiName + "出口有料,开始第【" + scanCodeCount + "】次扫码,皮带线停止转动");
// MoveInfo.OneWaitCanEndStep = true;
// MoveInfo.WaitList.Add(WaitResultInfo.WaitDLineScanCode());
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
// try
// {
// Task<List<string>> scanTask = Task.Factory.StartNew(delegate
// {
// List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
// if (LastCodeList.Count <= 0)
// {
// LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
// }
// LastCode = SServerManager.ProcessCodeList(LastCodeList);
// return LastCodeList;
// });
// }
// catch (Exception ex)
// {
// LogUtil.error("FI_13_ScanCode扫码出错:", ex);
// }
// }
// else
// {
// LogUtil.info(hengyiName + "出口有料,未取到相机名称,不扫码,等待1000后继续");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
// }
//}
private
void
WaitSeparateCheck
()
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_07_SeparateCheck
);
// Line3LastTrayP++;
LogUtil
.
info
(
hengyiName
+
"出口有料,等待料盘到达分盘装置位置,最多等待60000"
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
60000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SeparateDevice_Check
,
IO_VALUE
.
HIGH
));
}
}
private
bool
TrayProcessCanStartLine
()
{
if
(
TrayLine2
.
Line3CanRun
&&
TrayLine1
.
Line3CanRun
...
...
@@ -154,7 +104,7 @@ namespace OnlineStore.DeviceLibrary
//{
// ScanCode();
//}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_02_ScanCode
))
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_02_ScanCode
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_03_GetTraySize
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
...
...
@@ -181,22 +131,10 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
MoveInfo
,
IO_Type
.
SeparateDevice_Up
,
IO_Type
.
SeparateDevice_Down
);
}
else
{
//NG料
if
(
DeviceID
.
Equals
(
301
))
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_10_StopSeparateLine
);
LogUtil
.
info
(
hengyiName
+
"扫码NG料, 先转动NG料到扫码后一个工位,需要停止接驳台皮带线"
);
SeparateStopRun
(
MoveInfo
);
}
else
if
(
TrayProcessCanStartLine
())
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_11_NGToNextStation
);
LogUtil
.
info
(
hengyiName
+
"扫码NG料, 先转动NG料到扫码后一个工位"
);
Line3Turn
.
StartLineRun
(
IO_Type
.
DLine_Run3
,
IO_Type
.
Location_Check3
,
Line3EndProcess
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Location_Check3
,
IO_VALUE
.
HIGH
));
}
SeparateStopRun
(
MoveInfo
);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_10_StopSeparateLine
))
...
...
@@ -208,6 +146,11 @@ namespace OnlineStore.DeviceLibrary
Line3Turn
.
StartLineRun
(
IO_Type
.
DLine_Run3
,
IO_Type
.
Location_Check3
,
Line3EndProcess
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Location_Check3
,
IO_VALUE
.
HIGH
));
Task
.
Factory
.
StartNew
(
delegate
{
Thread
.
Sleep
(
1000
);
SeparateBackRun
(
null
);
});
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_04_SUpDownMove
))
...
...
@@ -225,30 +168,15 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_05_LineRun1
))
{
if
(
DeviceID
.
Equals
(
301
))
{
//如果是301可以直接结束
WaitSeparateCheck
();
}
else
{
//302需要再转一个工位
if
(
TrayProcessCanStartLine
())
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_06_LineRun2
);
LogUtil
.
info
(
hengyiName
+
"出口有料,转动皮带线到扫码后二个工位,同时转动分盘装置"
);
IOMove
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
HIGH
);
Line3Turn
.
StartLineRun
(
IO_Type
.
DLine_Run3
,
IO_Type
.
Location_Check3
,
Line3EndProcess
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Location_Check3
,
IO_VALUE
.
HIGH
));
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_06_LineRun2
))
{
WaitSeparateCheck
();
}
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_07_SeparateCheck
);
// Line3LastTrayP++;
LogUtil
.
info
(
hengyiName
+
"出口有料,等待料盘到达分盘装置位置,最多等待60000"
);
MoveInfo
.
TimeOutSeconds
=
40
;
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
60000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SeparateDevice_Check
,
IO_VALUE
.
HIGH
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_07_SeparateCheck
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_08_CRun
);
...
...
@@ -396,6 +324,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DON_07_SeparateCheck
);
// Line3LastTrayP++;
LogUtil
.
info
(
hengyiName
+
MoveInfo
.
SLog
+
"送料,等待料盘到达接驳台,最多等待60000"
);
MoveInfo
.
TimeOutSeconds
=
40
;
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
60000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SeparateDevice_Check
,
IO_VALUE
.
HIGH
));
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
4908c7b
...
...
@@ -437,18 +437,22 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
//一分钟还未检测到
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
NoAlarm
()
)
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
alarmType
<=
LineAlarmType
.
IoSingleTimeOut
)
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时"
;
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
IoSingleTimeOut
);
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒"
;
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
DeviceID
+
13
);
if
(
NoAlarm
())
{
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
IoSingleTimeOut
);
}
}
else
if
(
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
LineManager
.
Config
.
IOSingle_TimerOut
*
2
)
{
preRWTime
=
DateTime
.
Now
;
string
msg
=
moveInfo
.
Name
+
" ["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
string
msg
=
moveInfo
.
Name
+
" ["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
bool
isLog
=
false
;
foreach
(
WaitResultInfo
ww
in
list
)
{
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
4908c7b
...
...
@@ -89,7 +89,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_53_DownWait
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_54_CylinderOpen
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_54_CylinderOpen
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 夹料气缸夹紧,更新料盘位置【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【MOVING】【"
+
DeviceID
+
"】"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Tighten
,
IO_Type
.
ClampCylinder_Slack
);
...
...
@@ -130,35 +130,37 @@ namespace OnlineStore.DeviceLibrary
#
region
移载装置,放物品到流水线操作
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_56_CylinderAfter
))
{
//if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember) && !SecondMoveInfo.IsInWait)
//{
if
(
TrayIsOk
())
if
(
CylinderIsOk
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
))
{
int
trayNum
=
SecondMoveInfo
.
MoveParam
.
TrayNumber
;
//去掉直接丢盘处理
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_58_CylinderDown
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 夹具检测编码完成, 上下气缸下降 ,更新料盘位置【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【INLINE】【"
+
trayNum
+
"】"
);
if
(
MoveInfo
.
MoveParam
!=
null
)
{
MoveInfo
.
MoveParam
.
TrayNumber
=
trayNum
;
}
else
//if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember) && !SecondMoveInfo.IsInWait)
//{
if
(
TrayIsOk
())
{
MoveInfo
.
MoveParam
=
SecondMoveInfo
.
MoveParam
;
}
int
trayNum
=
SecondMoveInfo
.
MoveParam
.
TrayNumber
;
//去掉直接丢盘处理
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_58_CylinderDown
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 夹具检测编码完成, 上下气缸下降 ,更新料盘位置【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【INLINE】【"
+
trayNum
+
"】"
);
if
(
MoveInfo
.
MoveParam
!=
null
)
{
MoveInfo
.
MoveParam
.
TrayNumber
=
trayNum
;
}
else
{
MoveInfo
.
MoveParam
=
SecondMoveInfo
.
MoveParam
;
}
//更新料盘位置
SServerManager
.
UpdateTrayLoc
(
Name
,
MoveInfo
.
MoveParam
.
WareCode
,
LocStatus
.
INLINE
,
"E"
+
trayNum
.
ToString
().
PadLeft
(
2
,
'0'
));
UpdownDownP2Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
//更新料盘位置
SServerManager
.
UpdateTrayLoc
(
Name
,
MoveInfo
.
MoveParam
.
WareCode
,
LocStatus
.
INLINE
,
"E"
+
trayNum
.
ToString
().
PadLeft
(
2
,
'0'
));
UpdownDownP2Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
}
//}
//else if (MoveInfo.IsTimeOut(180))
//{
// WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待空托盘到达超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
// LogUtil.error(WarnMsg, DeviceID + 12);
// Alarm(LineAlarmType.IoSingleTimeOut);
//}
}
//}
//else if (MoveInfo.IsTimeOut(180))
//{
// WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待空托盘到达超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
// LogUtil.error(WarnMsg, DeviceID + 12);
// Alarm(LineAlarmType.IoSingleTimeOut);
//}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_58_CylinderDown
))
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论